Fixes TouchDelegate in RTL and applying color to empty contact
Bug: 16325484
Change-Id: I4052e2d6b976307ce1c304f16fc9b17dbf206dd1
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index 69b0d49..633185b 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -508,9 +508,13 @@
final Rect alternateIconRect = new Rect();
alternateIcon.getHitRect(alternateIconRect);
- alternateIconRect.right = entryRect.right;
alternateIconRect.bottom = entryRect.bottom;
alternateIconRect.top = entryRect.top;
+ if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
+ alternateIconRect.left = entryRect.left;
+ } else {
+ alternateIconRect.right = entryRect.right;
+ }
final TouchDelegate touchDelegate =
new TouchDelegate(alternateIconRect, alternateIcon);
view.setTouchDelegate(touchDelegate);
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 1f01c24..e453a4b 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -845,7 +845,7 @@
phoneIcon, getString(R.string.quickcontact_add_phone_number),
/* subHeader = */ null, /* text = */ null, getEditContactIntent(),
/* alternateIcon = */ null, /* alternateIntent = */ null,
- /* alternateContentDescription = */ null, /* shouldApplyColor = */ false,
+ /* alternateContentDescription = */ null, /* shouldApplyColor = */ true,
/* isEditable = */ false);
final Drawable emailIcon = getResources().getDrawable(
@@ -854,7 +854,7 @@
emailIcon, getString(R.string.quickcontact_add_email), /* subHeader = */ null,
/* text = */ null, getEditContactIntent(), /* alternateIcon = */ null,
/* alternateIntent = */ null, /* alternateContentDescription = */ null,
- /* shouldApplyColor = */ false, /* isEditable = */ false);
+ /* shouldApplyColor = */ true, /* isEditable = */ false);
final List<List<Entry>> promptEntries = new ArrayList<>();
promptEntries.add(new ArrayList<Entry>(1));