Created
March 15, 2018 03:20
-
-
Save hiking93/503e923fe227504bb7124f6bce268bda to your computer and use it in GitHub Desktop.
Perform long click internal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean performLongClickInternal(float x, float y) { | |
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); | |
boolean handled = false; | |
final ListenerInfo li = mListenerInfo; | |
if (li != null && li.mOnLongClickListener != null) { | |
handled = li.mOnLongClickListener.onLongClick(View.this); | |
} | |
if (!handled) { | |
final boolean isAnchored = !Float.isNaN(x) && !Float.isNaN(y); | |
handled = isAnchored ? showContextMenu(x, y) : showContextMenu(); | |
} | |
if ((mViewFlags & TOOLTIP) == TOOLTIP) { | |
if (!handled) { | |
handled = showLongClickTooltip((int) x, (int) y); | |
} | |
} | |
if (handled) { | |
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); | |
} | |
return handled; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment