diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 493cb87e92d7b..d8a48c91c19d6 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -3999,13 +3999,12 @@ public class Activity extends ContextThemeWrapper /** * Called when a touch screen event was not handled by any of the views - * under it. This is most useful to process touch events that happen + * inside of the activity. This is most useful to process touch events that happen * outside of your window bounds, where there is no view to receive it. * * @param event The touch screen event being processed. * * @return Return true if you have consumed the event, false if you haven't. - * The default implementation always returns false. */ public boolean onTouchEvent(MotionEvent event) { if (mWindow.shouldCloseOnTouch(this, event)) { @@ -4038,12 +4037,12 @@ public class Activity extends ContextThemeWrapper * Called when a generic motion event was not handled by any of the * views inside of the activity. *
- * Generic motion events describe joystick movements, mouse hovers, track pad - * touches, scroll wheel movements and other input events. The - * {@link MotionEvent#getSource() source} of the motion event specifies + * Generic motion events describe joystick movements, hover events from mouse or stylus + * devices, trackpad touches, scroll wheel movements and other motion events not handled + * by {@link #onTouchEvent(MotionEvent)} or {@link #onTrackballEvent(MotionEvent)}. + * The {@link MotionEvent#getSource() source} of the motion event specifies * the class of input that was received. Implementations of this method * must examine the bits in the source before processing the event. - * The following code example shows how this is done. *
* Generic motion events with source class * {@link android.view.InputDevice#SOURCE_CLASS_POINTER} @@ -4254,6 +4253,8 @@ public class Activity extends ContextThemeWrapper * @param ev The touch screen event. * * @return boolean Return true if this event was consumed. + * + * @see #onTouchEvent(MotionEvent) */ public boolean dispatchTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { @@ -4274,6 +4275,8 @@ public class Activity extends ContextThemeWrapper * @param ev The trackball event. * * @return boolean Return true if this event was consumed. + * + * @see #onTrackballEvent(MotionEvent) */ public boolean dispatchTrackballEvent(MotionEvent ev) { onUserInteraction(); @@ -4292,6 +4295,8 @@ public class Activity extends ContextThemeWrapper * @param ev The generic motion event. * * @return boolean Return true if this event was consumed. + * + * @see #onGenericMotionEvent(MotionEvent) */ public boolean dispatchGenericMotionEvent(MotionEvent ev) { onUserInteraction(); diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 1e9769e6270b9..c9c00accbe713 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -310,7 +310,7 @@ import java.util.function.Predicate; * * *
{@link #onKeyDown(int, KeyEvent)}{@link #onGenericMotionEvent(MotionEvent)}{@link #onHoverEvent(MotionEvent)}+ * The relative movement of the trackball since the last event * can be retrieve with {@link MotionEvent#getX MotionEvent.getX()} and * {@link MotionEvent#getY MotionEvent.getY()}. These are normalized so * that a movement of 1 corresponds to the user pressing one DPAD key (so * they will often be fractional values, representing the more fine-grained * movement information available from a trackball). + *
* * @param event The motion event. * @return True if the event was handled, false otherwise. @@ -16058,9 +16077,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Implement this method to handle generic motion events. *- * Generic motion events describe joystick movements, mouse hovers, track pad - * touches, scroll wheel movements and other input events. The - * {@link MotionEvent#getSource() source} of the motion event specifies + * Generic motion events describe joystick movements, hover events from mouse or stylus + * devices, trackpad touches, scroll wheel movements and other motion events not handled + * by {@link #onTouchEvent(MotionEvent)} or {@link #onTrackballEvent(MotionEvent)}. + * The {@link MotionEvent#getSource() source} of the motion event specifies * the class of input that was received. Implementations of this method * must examine the bits in the source before processing the event. * The following code example shows how this is done. @@ -16079,7 +16099,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * if (event.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) { * switch (event.getAction()) { * case MotionEvent.ACTION_HOVER_MOVE: - * // process the mouse hover movement... + * // process the hover movement... * return true; * case MotionEvent.ACTION_SCROLL: * // process the scroll wheel movement...