summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/list/ContactListItemView.java
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-09 16:24:10 -0700
committerAndrew Lee <anwlee@google.com>2014-06-09 17:00:48 -0700
commitfc9221ef57bfb9311dda798f67030d40215be859 (patch)
tree4ce7c0a8009c80245cf21c6a1f4196c3f6e5e720 /src/com/android/contacts/common/list/ContactListItemView.java
parent83efea72b5bba256ac2421f14c2591c00c64a8d0 (diff)
downloadandroid_packages_apps_ContactsCommon-fc9221ef57bfb9311dda798f67030d40215be859.tar.gz
android_packages_apps_ContactsCommon-fc9221ef57bfb9311dda798f67030d40215be859.tar.bz2
android_packages_apps_ContactsCommon-fc9221ef57bfb9311dda798f67030d40215be859.zip
Add support for full-bleed selection of contact list items.
- Adding the concept of "adjustSelectionBoundsEnabled", which allows us to control whether the headerWithoutBounds is used to override the selection list items bounds. We want to be able to do this in some cases (eg. in the contacts list when there is a header on the left) but in others (eg. a search list), we want the ripple to fill out the entire bounds of the list item. - Allow for this to be set by the ContactEntryListFragment, and then passed through the ContactEntryListAdapter to the ContactListItemView. - No longer apply scrollbar padding to the list view regardless of whether the scrollbar is present, because this messes with the ripple propagation. Bug: 15517457 Change-Id: I174a462ac1e45b987ac0ee70de318ed037d91762
Diffstat (limited to 'src/com/android/contacts/common/list/ContactListItemView.java')
-rw-r--r--src/com/android/contacts/common/list/ContactListItemView.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index da452cf3..93c7dcef 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -210,6 +210,7 @@ public class ContactListItemView extends ViewGroup
private final CharArrayBuffer mPhoneticNameBuffer = new CharArrayBuffer(128);
private boolean mActivatedStateSupported;
+ private boolean mAdjustSelectionBoundsEnabled = true;
private Rect mBoundsWithoutHeader = new Rect();
@@ -635,10 +636,12 @@ public class ContactListItemView extends ViewGroup
@Override
public void adjustListItemSelectionBounds(Rect bounds) {
- bounds.top += mBoundsWithoutHeader.top;
- bounds.bottom = bounds.top + mBoundsWithoutHeader.height();
- bounds.left = mBoundsWithoutHeader.left;
- bounds.right = mBoundsWithoutHeader.right;
+ if (mAdjustSelectionBoundsEnabled) {
+ bounds.top += mBoundsWithoutHeader.top;
+ bounds.bottom = bounds.top + mBoundsWithoutHeader.height();
+ bounds.left = mBoundsWithoutHeader.left;
+ bounds.right = mBoundsWithoutHeader.right;
+ }
}
protected boolean isVisible(View view) {
@@ -1390,6 +1393,10 @@ public class ContactListItemView extends ViewGroup
this.mActivatedStateSupported = flag;
}
+ public void setAdjustSelectionBoundsEnabled(boolean enabled) {
+ mAdjustSelectionBoundsEnabled = enabled;
+ }
+
@Override
public void requestLayout() {
// We will assume that once measured this will not need to resize