diff options
author | Gilles Debunne <debunne@google.com> | 2010-09-07 18:32:28 -0700 |
---|---|---|
committer | Gilles Debunne <debunne@google.com> | 2010-09-07 18:32:28 -0700 |
commit | 49271c941ed965c20ed834c5efc52b07ed616e34 (patch) | |
tree | 5b5dbfed75fe58b81b4c909d9c94f4f09bcd0d83 | |
parent | d0f74ae081bac9a9c8f7faf9288305647735d743 (diff) | |
download | frameworks_base-49271c941ed965c20ed834c5efc52b07ed616e34.zip frameworks_base-49271c941ed965c20ed834c5efc52b07ed616e34.tar.gz frameworks_base-49271c941ed965c20ed834c5efc52b07ed616e34.tar.bz2 |
Hide mCursorController field in ArrowKeyMovementMethod.
Made the field private and added a description of its use.
Bug http://b/issue?id=2975284
Change-Id: Id8acf756218915cb2ae756789b62cfe7201a5c67
-rw-r--r-- | core/java/android/text/method/ArrowKeyMovementMethod.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/text/method/ArrowKeyMovementMethod.java b/core/java/android/text/method/ArrowKeyMovementMethod.java index 3fe14f9..0408673 100644 --- a/core/java/android/text/method/ArrowKeyMovementMethod.java +++ b/core/java/android/text/method/ArrowKeyMovementMethod.java @@ -34,7 +34,7 @@ public class ArrowKeyMovementMethod implements MovementMethod { * An optional controller for the cursor. * Use {@link #setCursorController(CursorController)} to set this field. */ - protected CursorController mCursorController; + private CursorController mCursorController; private boolean isCap(Spannable buffer) { return ((MetaKeyKeyListener.getMetaState(buffer, KeyEvent.META_SHIFT_ON) == 1) || @@ -302,7 +302,17 @@ public class ArrowKeyMovementMethod implements MovementMethod { /** * Defines the cursor controller. * - * When set, this object can be used to handle events, that can be translated in cursor updates. + * When set, this object can be used to handle touch events, that can be translated into cursor + * updates. + * + * {@link MotionEvent#ACTION_MOVE} events will call back the + * {@link CursorController#updatePosition(int, int)} controller's method, passing the current + * finger coordinates (offset by {@link CursorController#getOffsetX()} and + * {@link CursorController#getOffsetY()}) as parameters. + * + * When the gesture is finished (on a {@link MotionEvent#ACTION_UP} or + * {@link MotionEvent#ACTION_CANCEL} event), the controller is reset to null. + * * @param cursorController A cursor controller implementation */ public void setCursorController(CursorController cursorController) { |