Loading services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +8 −3 Original line number Diff line number Diff line Loading @@ -928,13 +928,18 @@ public class AutoclickController extends BaseEventStreamTransformation { boolean moved = detectMovement(event); cacheLastEvent(event, policyFlags, mLastMotionEvent == null || moved /* useAsAnchor */); if (moved) { rescheduleClick(mDelay); if (Flags.enableAutoclickIndicator()) { // Give the indicator the latest mouse coordinates for when the indicator is ready // to redraw. final int pointerIndex = event.getActionIndex(); mAutoclickIndicatorView.setCoordination( event.getX(pointerIndex), event.getY(pointerIndex)); } if (moved) { rescheduleClick(mDelay); if (Flags.enableAutoclickIndicator()) { mAutoclickIndicatorScheduler.update(); } } Loading services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickIndicatorView.java +15 −9 Original line number Diff line number Diff line Loading @@ -53,9 +53,13 @@ public class AutoclickIndicatorView extends View { private final RectF mRingRect; // x and y coordinates of the visual indicator. private float mX; private float mY; // x and y coordinates of the mouse. private float mMouseX; private float mMouseY; // x and y coordinates of the visual indicator, set when drawing of the indicator begins. private float mSnapshotX; private float mSnapshotY; // Current sweep angle of the animated ring. private float mSweepAngle; Loading Loading @@ -114,10 +118,10 @@ public class AutoclickIndicatorView extends View { if (showIndicator) { mRingRect.set( /* left= */ mX - mRadius, /* top= */ mY - mRadius, /* right= */ mX + mRadius, /* bottom= */ mY + mRadius); /* left= */ mSnapshotX - mRadius, /* top= */ mSnapshotY - mRadius, /* right= */ mSnapshotX + mRadius, /* bottom= */ mSnapshotY + mRadius); canvas.drawArc(mRingRect, /* startAngle= */ -90, mSweepAngle, false, mPaint); } } Loading @@ -134,8 +138,8 @@ public class AutoclickIndicatorView extends View { } public void setCoordination(float x, float y) { mX = x; mY = y; mMouseX = x; mMouseY = y; } public void setRadius(int radius) { Loading @@ -148,6 +152,8 @@ public class AutoclickIndicatorView extends View { } public void redrawIndicator() { mSnapshotX = mMouseX; mSnapshotY = mMouseY; showIndicator = true; invalidate(); mAnimator.start(); Loading Loading
services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +8 −3 Original line number Diff line number Diff line Loading @@ -928,13 +928,18 @@ public class AutoclickController extends BaseEventStreamTransformation { boolean moved = detectMovement(event); cacheLastEvent(event, policyFlags, mLastMotionEvent == null || moved /* useAsAnchor */); if (moved) { rescheduleClick(mDelay); if (Flags.enableAutoclickIndicator()) { // Give the indicator the latest mouse coordinates for when the indicator is ready // to redraw. final int pointerIndex = event.getActionIndex(); mAutoclickIndicatorView.setCoordination( event.getX(pointerIndex), event.getY(pointerIndex)); } if (moved) { rescheduleClick(mDelay); if (Flags.enableAutoclickIndicator()) { mAutoclickIndicatorScheduler.update(); } } Loading
services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickIndicatorView.java +15 −9 Original line number Diff line number Diff line Loading @@ -53,9 +53,13 @@ public class AutoclickIndicatorView extends View { private final RectF mRingRect; // x and y coordinates of the visual indicator. private float mX; private float mY; // x and y coordinates of the mouse. private float mMouseX; private float mMouseY; // x and y coordinates of the visual indicator, set when drawing of the indicator begins. private float mSnapshotX; private float mSnapshotY; // Current sweep angle of the animated ring. private float mSweepAngle; Loading Loading @@ -114,10 +118,10 @@ public class AutoclickIndicatorView extends View { if (showIndicator) { mRingRect.set( /* left= */ mX - mRadius, /* top= */ mY - mRadius, /* right= */ mX + mRadius, /* bottom= */ mY + mRadius); /* left= */ mSnapshotX - mRadius, /* top= */ mSnapshotY - mRadius, /* right= */ mSnapshotX + mRadius, /* bottom= */ mSnapshotY + mRadius); canvas.drawArc(mRingRect, /* startAngle= */ -90, mSweepAngle, false, mPaint); } } Loading @@ -134,8 +138,8 @@ public class AutoclickIndicatorView extends View { } public void setCoordination(float x, float y) { mX = x; mY = y; mMouseX = x; mMouseY = y; } public void setRadius(int radius) { Loading @@ -148,6 +152,8 @@ public class AutoclickIndicatorView extends View { } public void redrawIndicator() { mSnapshotX = mMouseX; mSnapshotY = mMouseY; showIndicator = true; invalidate(); mAnimator.start(); Loading