Loading core/java/android/view/View.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -14639,9 +14639,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Recomputes the matrix if necessary. * Recomputes the matrix if necessary. * * * @return True if the transform matrix is the identity matrix, false otherwise. * @return True if the transform matrix is the identity matrix, false otherwise. * @hide */ */ @UnsupportedAppUsage @UnsupportedAppUsage final boolean hasIdentityMatrix() { public final boolean hasIdentityMatrix() { return mRenderNode.hasIdentityMatrix(); return mRenderNode.hasIdentityMatrix(); } } core/java/android/widget/Editor.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,7 @@ import android.view.View.OnClickListener; import android.view.ViewConfiguration; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo; Loading Loading @@ -4800,6 +4801,24 @@ public class Editor { return glyphHeight > magnifierContentHeight; return glyphHeight > magnifierContentHeight; } } private boolean viewIsMatrixTransformed() { if (mMagnifierAnimator.mMagnifierIsShowing) { // Do not check again when the magnifier is currently showing. return false; } if (!mTextView.hasIdentityMatrix()) { return true; } ViewParent viewParent = mTextView.getParent(); while (viewParent != null) { if (viewParent instanceof View && !((View) viewParent).hasIdentityMatrix()) { return true; } viewParent = viewParent.getParent(); } return false; } /** /** * Computes the position where the magnifier should be shown, relative to * Computes the position where the magnifier should be shown, relative to * {@code mTextView}, and writes them to {@code showPosInView}. Also decides * {@code mTextView}, and writes them to {@code showPosInView}. Also decides Loading Loading @@ -4928,6 +4947,7 @@ public class Editor { final PointF showPosInView = new PointF(); final PointF showPosInView = new PointF(); final boolean shouldShow = !tooLargeTextForMagnifier() final boolean shouldShow = !tooLargeTextForMagnifier() && !viewIsMatrixTransformed() && obtainMagnifierShowCoordinates(event, showPosInView); && obtainMagnifierShowCoordinates(event, showPosInView); if (shouldShow) { if (shouldShow) { // Make the cursor visible and stop blinking. // Make the cursor visible and stop blinking. Loading Loading
core/java/android/view/View.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -14639,9 +14639,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Recomputes the matrix if necessary. * Recomputes the matrix if necessary. * * * @return True if the transform matrix is the identity matrix, false otherwise. * @return True if the transform matrix is the identity matrix, false otherwise. * @hide */ */ @UnsupportedAppUsage @UnsupportedAppUsage final boolean hasIdentityMatrix() { public final boolean hasIdentityMatrix() { return mRenderNode.hasIdentityMatrix(); return mRenderNode.hasIdentityMatrix(); } }
core/java/android/widget/Editor.java +20 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,7 @@ import android.view.View.OnClickListener; import android.view.ViewConfiguration; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.ViewGroup.LayoutParams; import android.view.ViewParent; import android.view.ViewTreeObserver; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.accessibility.AccessibilityNodeInfo; Loading Loading @@ -4800,6 +4801,24 @@ public class Editor { return glyphHeight > magnifierContentHeight; return glyphHeight > magnifierContentHeight; } } private boolean viewIsMatrixTransformed() { if (mMagnifierAnimator.mMagnifierIsShowing) { // Do not check again when the magnifier is currently showing. return false; } if (!mTextView.hasIdentityMatrix()) { return true; } ViewParent viewParent = mTextView.getParent(); while (viewParent != null) { if (viewParent instanceof View && !((View) viewParent).hasIdentityMatrix()) { return true; } viewParent = viewParent.getParent(); } return false; } /** /** * Computes the position where the magnifier should be shown, relative to * Computes the position where the magnifier should be shown, relative to * {@code mTextView}, and writes them to {@code showPosInView}. Also decides * {@code mTextView}, and writes them to {@code showPosInView}. Also decides Loading Loading @@ -4928,6 +4947,7 @@ public class Editor { final PointF showPosInView = new PointF(); final PointF showPosInView = new PointF(); final boolean shouldShow = !tooLargeTextForMagnifier() final boolean shouldShow = !tooLargeTextForMagnifier() && !viewIsMatrixTransformed() && obtainMagnifierShowCoordinates(event, showPosInView); && obtainMagnifierShowCoordinates(event, showPosInView); if (shouldShow) { if (shouldShow) { // Make the cursor visible and stop blinking. // Make the cursor visible and stop blinking. Loading