diff options
author | 2024-09-09 19:09:50 +0000 | |
---|---|---|
committer | 2024-09-09 19:09:50 +0000 | |
commit | 7d509f2ecce60768077d51448ac1dacb63e355b7 (patch) | |
tree | 3ae908dc9fc15feef056c34a20de5b4f9adfbee7 | |
parent | 8a3440c99afd2beace1d2bf3dcff7dc0443cd719 (diff) | |
parent | 843a30bb3461775a25ae2cf62762c75c50e3b5f7 (diff) |
Merge "Note that View.onTouchEvent is called for touchpad events too" into main am: 843a30bb34
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3257013
Change-Id: Ifbc4859b28016286d98b55f150a56dc3a40b5d01
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | core/java/android/view/View.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index abb6f41a70ef..232cfcb3d5e6 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -371,7 +371,7 @@ import java.util.function.Predicate; * </tr> * <tr> * <td><code>{@link #onTouchEvent(MotionEvent)}</code></td> - * <td>Called when a touch screen motion event occurs. + * <td>Called when a motion event occurs with pointers down on the view. * </td> * </tr> * <tr> @@ -17843,7 +17843,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** - * Implement this method to handle touch screen motion events. + * Implement this method to handle pointer events. + * <p> + * This method is called to handle motion events where pointers are down on + * the view. For example, this could include touchscreen touches, stylus + * touches, or click-and-drag events from a mouse. However, it is not called + * for motion events that do not involve pointers being down, such as hover + * events or mouse scroll wheel movements. * <p> * If this method is used to detect click actions, it is recommended that * the actions be performed by implementing and calling |