Merge "Add CLASSIFICATION_TWO_FINGER_SCROLL for touchpad scrolling"
This commit is contained in:
@@ -49254,6 +49254,7 @@ package android.view {
|
||||
field public static final int CLASSIFICATION_AMBIGUOUS_GESTURE = 1; // 0x1
|
||||
field public static final int CLASSIFICATION_DEEP_PRESS = 2; // 0x2
|
||||
field public static final int CLASSIFICATION_NONE = 0; // 0x0
|
||||
field public static final int CLASSIFICATION_TWO_FINGER_SWIPE = 3; // 0x3
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.view.MotionEvent> CREATOR;
|
||||
field public static final int EDGE_BOTTOM = 2; // 0x2
|
||||
field public static final int EDGE_LEFT = 4; // 0x4
|
||||
|
||||
@@ -1457,10 +1457,20 @@ public final class MotionEvent extends InputEvent implements Parcelable {
|
||||
*/
|
||||
public static final int CLASSIFICATION_DEEP_PRESS = 2;
|
||||
|
||||
/**
|
||||
* Classification constant: touchpad scroll.
|
||||
*
|
||||
* The current event stream represents the user scrolling with two fingers on a touchpad.
|
||||
*
|
||||
* @see #getClassification
|
||||
*/
|
||||
public static final int CLASSIFICATION_TWO_FINGER_SWIPE = 3;
|
||||
|
||||
/** @hide */
|
||||
@Retention(SOURCE)
|
||||
@IntDef(prefix = { "CLASSIFICATION" }, value = {
|
||||
CLASSIFICATION_NONE, CLASSIFICATION_AMBIGUOUS_GESTURE, CLASSIFICATION_DEEP_PRESS})
|
||||
CLASSIFICATION_NONE, CLASSIFICATION_AMBIGUOUS_GESTURE, CLASSIFICATION_DEEP_PRESS,
|
||||
CLASSIFICATION_TWO_FINGER_SWIPE})
|
||||
public @interface Classification {};
|
||||
|
||||
/**
|
||||
@@ -3862,9 +3872,11 @@ public final class MotionEvent extends InputEvent implements Parcelable {
|
||||
return "AMBIGUOUS_GESTURE";
|
||||
case CLASSIFICATION_DEEP_PRESS:
|
||||
return "DEEP_PRESS";
|
||||
case CLASSIFICATION_TWO_FINGER_SWIPE:
|
||||
return "TWO_FINGER_SWIPE";
|
||||
|
||||
}
|
||||
return "NONE";
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -295,6 +295,8 @@ int32_t AMotionEvent_getClassification(const AInputEvent* motion_event) {
|
||||
return AMOTION_EVENT_CLASSIFICATION_AMBIGUOUS_GESTURE;
|
||||
case android::MotionClassification::DEEP_PRESS:
|
||||
return AMOTION_EVENT_CLASSIFICATION_DEEP_PRESS;
|
||||
case android::MotionClassification::TWO_FINGER_SWIPE:
|
||||
return AMOTION_EVENT_CLASSIFICATION_TWO_FINGER_SWIPE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user