diff options
| author | Lan Wei <azurewei@google.com> | 2021-02-03 16:44:31 +0800 |
|---|---|---|
| committer | Lan Wei <azurewei@google.com> | 2021-02-26 12:04:42 +0800 |
| commit | 41de37482ecfa80aed077fcc1d2196fad30afca6 (patch) | |
| tree | 6eb1037bd93c031dc2cf742809980d56c4491078 /core/java/android/widget/TextView.java | |
| parent | 878589db086d8d00005e30e9e7ec26c91559d81a (diff) | |
Update the cursor visibility correctly after dismissing popup window
The cursor visibilty should be resumed to previous without regard to
whether IME is temporarily cousming input.
Test: atest FrameworksCoreTests:SuggestionsPopupWindowTest
Bug: 179088361
Bug: 175362887
Change-Id: Ibcae7ef47d942b47c00734bd55c6712e0edc3990
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 0f2089a5463f..66d7463cf267 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -500,7 +500,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener private boolean mImeIsConsumingInput; // Whether cursor is visible without regard to {@link mImeConsumesInput}. - // {code true} is the default value. + // {@code true} is the default value. private boolean mCursorVisibleFromAttr = true; static class Drawables { @@ -10564,6 +10564,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return mEditor == null ? true : mEditor.mCursorVisible; } + /** + * @return whether cursor is visible without regard to {@code mImeIsConsumingInput}. + * {@code true} is the default value. + * + * @see #setCursorVisible(boolean) + * @hide + */ + public boolean isCursorVisibleFromAttr() { + return mCursorVisibleFromAttr; + } + private boolean canMarquee() { int width = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight(); return width > 0 && (mLayout.getLineWidth(0) > width |
