diff options
| author | 2024-09-09 10:56:05 +0000 | |
|---|---|---|
| committer | 2024-09-09 10:56:05 +0000 | |
| commit | afcbf60ca2034caafc9db8615d8b7cb6d833f448 (patch) | |
| tree | 0374e7911511850318c9d09b8cd75e0408e80599 | |
| parent | fcfc6c13f523807a9d7e7f5a18683ee7f8b9d233 (diff) | |
Note that View.onTouchEvent is called for touchpad events too
Bug: 352413658
Change-Id: Ic93055fd295c13964fcdfc2343b3e1af226cfe64
Test: none
Flag: DOCS_ONLY
| -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 f50dc8ddd262..8fa00587e6bb 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -328,7 +328,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> * @@ -16410,7 +16410,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 |