summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-11-13 14:12:08 -0800
committerYorke Lee <yorkelee@google.com>2013-11-13 14:12:08 -0800
commit538e05b3bbde399f25ccf1aad251fca6d7f4d6b3 (patch)
tree9bbb71a873a5f9ad4e2e03f4e011abd7466bc34a
parent3d9abc2aee2dd9bb73580de71c599f4cb8a61a7b (diff)
downloadandroid_packages_apps_ContactsCommon-538e05b3bbde399f25ccf1aad251fca6d7f4d6b3.tar.gz
android_packages_apps_ContactsCommon-538e05b3bbde399f25ccf1aad251fca6d7f4d6b3.tar.bz2
android_packages_apps_ContactsCommon-538e05b3bbde399f25ccf1aad251fca6d7f4d6b3.zip
Fix a bug with pressed state in ContactListItemView
ContactListItemView was incorrectly maintaining its pressed state even when touch events were moved outside its bounds. Bug: 11668831 Change-Id: I36b596d33be4e44f78990a9fa8e5fd05d3388037
-rw-r--r--src/com/android/contacts/common/list/ContactListItemView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index 7d99dd6d..5d96d2c2 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -1534,7 +1534,10 @@ public class ContactListItemView extends ViewGroup
public boolean onTouchEvent(MotionEvent event) {
final float x = event.getX();
final float y = event.getY();
- if (mBoundsWithoutHeader.contains((int) x, (int) y)) {
+ // If the touch event's coordinates are not within the view's header, then delegate
+ // to super.onTouchEvent so that regular view behavior is preserved. Otherwise, consume
+ // and ignore the touch event.
+ if (mBoundsWithoutHeader.contains((int) x, (int) y) || !pointInView(x, y, 0)) {
return super.onTouchEvent(event);
} else {
return true;