Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e83b3e6 authored by Adam Powell's avatar Adam Powell
Browse files

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
parent d4fdc0f5
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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);
            }
            // 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;
        }