Merge "Changes based on API council feedback for performContextClick" into nyc-dev

This commit is contained in:
Mady Mellor
2016-05-25 19:00:07 +00:00
committed by Android (Google) Code Review
4 changed files with 16 additions and 1 deletions

View File

@@ -42503,6 +42503,7 @@ package android.view {
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
method public boolean performAccessibilityAction(int, android.os.Bundle);
method public boolean performClick();
method public boolean performContextClick(float, float);
method public boolean performContextClick();
method public boolean performHapticFeedback(int);
method public boolean performHapticFeedback(int, int);

View File

@@ -45501,6 +45501,7 @@ package android.view {
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
method public boolean performAccessibilityAction(int, android.os.Bundle);
method public boolean performClick();
method public boolean performContextClick(float, float);
method public boolean performContextClick();
method public boolean performHapticFeedback(int);
method public boolean performHapticFeedback(int, int);

View File

@@ -42582,6 +42582,7 @@ package android.view {
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
method public boolean performAccessibilityAction(int, android.os.Bundle);
method public boolean performClick();
method public boolean performContextClick(float, float);
method public boolean performContextClick();
method public boolean performHapticFeedback(int);
method public boolean performHapticFeedback(int, int);

View File

@@ -5695,6 +5695,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return handled;
}
/**
* Call this view's OnContextClickListener, if it is defined.
*
* @param x the x coordinate of the context click
* @param y the y coordinate of the context click
* @return True if there was an assigned OnContextClickListener that consumed the event, false
* otherwise.
*/
public boolean performContextClick(float x, float y) {
return performContextClick();
}
/**
* Call this view's OnContextClickListener, if it is defined.
*
@@ -10044,7 +10056,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (isContextClickable() && !mInContextButtonPress && !mHasPerformedLongPress
&& (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY
|| actionButton == MotionEvent.BUTTON_SECONDARY)) {
if (performContextClick()) {
if (performContextClick(event.getX(), event.getY())) {
mInContextButtonPress = true;
setPressed(true, event.getX(), event.getY());
removeTapCallback();