From a4e39c4f596ebcc3769afdc358d78386c9f6f63b Mon Sep 17 00:00:00 2001 From: Mihai Popa Date: Tue, 20 Feb 2018 15:31:11 +0000 Subject: [Magnifier-23] Fix invisible cursor in magnifier Previously, if the magnifier was triggered when the cursor was invisible between blinks, the cursor would remain invisible until its position first changed as a result of user dragging. This CL fixes this, by forcing the cursor to become visible when the magnifier is triggered. Test: manual testing Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest Bug: 72314929 Bug: 63531115 Change-Id: I95dd0c2474f1cd1695ff3083e062ee38867b8a0c --- core/java/android/widget/TextView.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/java/android/widget/TextView.java') diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 1e02c3062d97..9ac5d59119fb 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -6965,9 +6965,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final int selEnd = getSelectionEnd(); if (mMovement != null && (isFocused() || isPressed()) && selStart >= 0) { if (selStart == selEnd) { - if (mEditor != null && mEditor.isCursorVisible() - && (SystemClock.uptimeMillis() - mEditor.mShowCursor) - % (2 * Editor.BLINK) < Editor.BLINK) { + if (mEditor != null && mEditor.shouldRenderCursor()) { if (mHighlightPathBogus) { if (mHighlightPath == null) mHighlightPath = new Path(); mHighlightPath.reset(); -- cgit v1.2.3