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

Commit bf5f2b3f authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 3005359 - onListItemClick and ActionMode conflict

CHOICE_MODE_MULTIPLE_MODAL should not dispatch item click events
when in selection mode.

Change-Id: I664fdd01e5c5691ea6ad071bc36a9497fd97ce4d
parent a8cbdb9a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -856,6 +856,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
    @Override
    public boolean performItemClick(View view, int position, long id) {
        boolean handled = false;
        boolean dispatchItemClick = true;

        if (mChoiceMode != CHOICE_MODE_NONE) {
            handled = true;
@@ -879,6 +880,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                if (mChoiceActionMode != null) {
                    mMultiChoiceModeCallback.onItemCheckedStateChanged(mChoiceActionMode,
                            position, id, newValue);
                    dispatchItemClick = false;
                }
            } else if (mChoiceMode == CHOICE_MODE_SINGLE) {
                boolean newValue = !mCheckStates.get(position, false);
@@ -900,7 +902,9 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            requestLayout();
        }

        if (dispatchItemClick) {
            handled |= super.performItemClick(view, position, id);
        }

        return handled;
    }