summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-09-13 18:09:21 -0700
committerAdam Powell <adamp@google.com>2011-09-13 18:13:31 -0700
commit1e83b3e6ab69456db5d308c12e367a5d7166610d (patch)
tree8f32eb1a8a4461e3c61606144e5f20e5ef15a6e7
parentd4fdc0f5621098d89c686a0edbfc22247005c46c (diff)
downloadframeworks_base-1e83b3e6ab69456db5d308c12e367a5d7166610d.zip
frameworks_base-1e83b3e6ab69456db5d308c12e367a5d7166610d.tar.gz
frameworks_base-1e83b3e6ab69456db5d308c12e367a5d7166610d.tar.bz2
Fix bug 5312352 - ListView modal multi-select mode bugs
When the provided callback returned false for creating the mode, the item was still getting checked and the bar was flickering. Don't do that. Change-Id: I384962742edeac0c43aec6f7898bd50dab064738
-rw-r--r--core/java/android/widget/AbsListView.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 353d83c..5642b7b 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2576,13 +2576,11 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final int longPressPosition, final long longPressId) {
// CHOICE_MODE_MULTIPLE_MODAL takes over long press.
if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
- if (mChoiceActionMode == null) {
- mChoiceActionMode = startActionMode(mMultiChoiceModeCallback);
+ if (mChoiceActionMode == null &&
+ (mChoiceActionMode = startActionMode(mMultiChoiceModeCallback)) != null) {
setItemChecked(longPressPosition, true);
+ performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
}
- // TODO Should we select the long pressed item if we were already in
- // selection mode? (i.e. treat it like an item click?)
- performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
return true;
}