Loading core/java/android/widget/AbsListView.java +17 −11 Original line number Diff line number Diff line Loading @@ -3121,9 +3121,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private boolean performStylusButtonPressAction(MotionEvent ev) { if (ev.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS && ev.isButtonPressed(MotionEvent.BUTTON_SECONDARY) && mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode == null) { if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode == null) { final View child = getChildAt(mMotionPosition - mFirstPosition); if (child != null) { final int longPressPosition = mMotionPosition; Loading Loading @@ -3793,7 +3791,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } if (mTouchMode == TOUCH_MODE_DOWN && mMotionPosition != INVALID_POSITION && (performButtonActionOnTouchDown(ev) || performStylusButtonPressAction(ev))) { && performButtonActionOnTouchDown(ev)) { removeCallbacks(mPendingCheckForTap); } } Loading Loading @@ -3836,11 +3834,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchMode = TOUCH_MODE_DONE_WAITING; updateSelectorState(); } else if (motionView != null) { if (performStylusButtonPressAction(ev)) { removeCallbacks(mPendingCheckForTap); removeCallbacks(mPendingCheckForLongPress); } // Still within bounds, update the hotspot. final float[] point = mTmpPoint; point[0] = x; Loading Loading @@ -4080,7 +4073,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te public boolean onGenericMotionEvent(MotionEvent event) { if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { switch (event.getAction()) { case MotionEvent.ACTION_SCROLL: { case MotionEvent.ACTION_SCROLL: if (mTouchMode == TOUCH_MODE_REST) { final float vscroll = event.getAxisValue(MotionEvent.AXIS_VSCROLL); if (vscroll != 0) { Loading @@ -4090,9 +4083,22 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } } break; case MotionEvent.ACTION_BUTTON_PRESS: int actionButton = event.getActionButton(); if ((actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY || actionButton == MotionEvent.BUTTON_SECONDARY) && (mTouchMode == TOUCH_MODE_DOWN || mTouchMode == TOUCH_MODE_TAP)) { if (performStylusButtonPressAction(event)) { removeCallbacks(mPendingCheckForLongPress); removeCallbacks(mPendingCheckForTap); } } break; } } return super.onGenericMotionEvent(event); } Loading Loading
core/java/android/widget/AbsListView.java +17 −11 Original line number Diff line number Diff line Loading @@ -3121,9 +3121,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } private boolean performStylusButtonPressAction(MotionEvent ev) { if (ev.getToolType(0) == MotionEvent.TOOL_TYPE_STYLUS && ev.isButtonPressed(MotionEvent.BUTTON_SECONDARY) && mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode == null) { if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode == null) { final View child = getChildAt(mMotionPosition - mFirstPosition); if (child != null) { final int longPressPosition = mMotionPosition; Loading Loading @@ -3793,7 +3791,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } if (mTouchMode == TOUCH_MODE_DOWN && mMotionPosition != INVALID_POSITION && (performButtonActionOnTouchDown(ev) || performStylusButtonPressAction(ev))) { && performButtonActionOnTouchDown(ev)) { removeCallbacks(mPendingCheckForTap); } } Loading Loading @@ -3836,11 +3834,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mTouchMode = TOUCH_MODE_DONE_WAITING; updateSelectorState(); } else if (motionView != null) { if (performStylusButtonPressAction(ev)) { removeCallbacks(mPendingCheckForTap); removeCallbacks(mPendingCheckForLongPress); } // Still within bounds, update the hotspot. final float[] point = mTmpPoint; point[0] = x; Loading Loading @@ -4080,7 +4073,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te public boolean onGenericMotionEvent(MotionEvent event) { if ((event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != 0) { switch (event.getAction()) { case MotionEvent.ACTION_SCROLL: { case MotionEvent.ACTION_SCROLL: if (mTouchMode == TOUCH_MODE_REST) { final float vscroll = event.getAxisValue(MotionEvent.AXIS_VSCROLL); if (vscroll != 0) { Loading @@ -4090,9 +4083,22 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } } break; case MotionEvent.ACTION_BUTTON_PRESS: int actionButton = event.getActionButton(); if ((actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY || actionButton == MotionEvent.BUTTON_SECONDARY) && (mTouchMode == TOUCH_MODE_DOWN || mTouchMode == TOUCH_MODE_TAP)) { if (performStylusButtonPressAction(event)) { removeCallbacks(mPendingCheckForLongPress); removeCallbacks(mPendingCheckForTap); } } break; } } return super.onGenericMotionEvent(event); } Loading