summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-10-09 11:14:00 -0700
committerAndrew Lee <anwlee@google.com>2014-10-09 12:53:21 -0700
commit0e847677919b24223c822b1f2e278e7d3e0264cb (patch)
treed2b69583f3e3acc1ee480e982177b242a895bc84
parent13db18325d7f10f08df5e54759389a8e023fb2f0 (diff)
Remove accessibility delegate on shortcut card.
An accessbility delegate is set in the Call Log Adaptor to automatically expand the call log list item when tapped in accessibility mode. We don't want this for the shortcut card, because it shouldn't be expandable. When not doing this expansion, the shortcut card now obtains accessibility focus and reading properly. Change the description text for the shortcut card so it reads "call back #/name". Should update this later with a string to include the other information, but it's not straightforward to do right now. Bug: 17929331 Change-Id: I691fe238ea436916ab7505c39039b6c1cea27781
-rw-r--r--src/com/android/dialer/list/ShortcutCardsAdapter.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/dialer/list/ShortcutCardsAdapter.java b/src/com/android/dialer/list/ShortcutCardsAdapter.java
index 09f4e4928..4fe638ea1 100644
--- a/src/com/android/dialer/list/ShortcutCardsAdapter.java
+++ b/src/com/android/dialer/list/ShortcutCardsAdapter.java
@@ -21,7 +21,6 @@ import android.content.res.Resources;
import android.database.Cursor;
import android.database.DataSetObserver;
import android.graphics.Rect;
-import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
@@ -29,6 +28,7 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
+import android.widget.TextView;
import com.android.dialer.R;
import com.android.dialer.calllog.CallLogAdapter;
@@ -197,7 +197,8 @@ public class ShortcutCardsAdapter extends BaseAdapter {
// the PhoneFavoriteMergedAdapter, but keep the original look of the item in
// the CallLogAdapter.
final View view = mCallLogAdapter.getView(position, convertView == null ?
- null : wrapper.getChildAt(0), parent);
+ null : wrapper.getChildAt(0), parent
+ );
wrapper.removeAllViews();
wrapper.prepareChildView(view);
wrapper.addView(view);
@@ -234,6 +235,8 @@ public class ShortcutCardsAdapter extends BaseAdapter {
}
private void prepareChildView(View view) {
+ // Override CallLogAdapter's accessibility behavior; don't expand the shortcut card.
+ view.setAccessibilityDelegate(null);
view.setBackgroundResource(R.drawable.rounded_corner_bg);
final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
@@ -247,13 +250,18 @@ public class ShortcutCardsAdapter extends BaseAdapter {
view.setLayoutParams(params);
LinearLayout actionView =
- (LinearLayout)view.findViewById(R.id.primary_action_view);
+ (LinearLayout) view.findViewById(R.id.primary_action_view);
actionView.setPaddingRelative(
mCallLogPaddingStart,
mCallLogPaddingTop,
actionView.getPaddingEnd(),
mCallLogPaddingBottom);
+ // TODO: Set content description including type/location and time information.
+ TextView nameView = (TextView) actionView.findViewById(R.id.name);
+ actionView.setContentDescription(getResources().getString(
+ R.string.description_call_back_action, nameView.getText()));
+
mPreviousTranslationZ = getResources().getDimensionPixelSize(
R.dimen.recent_call_log_item_translation_z);
view.setTranslationZ(mPreviousTranslationZ);