diff options
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/TextView.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 47e10cc..6ac889a 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -4266,6 +4266,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } @Override + public void onScreenStateChanged(int screenState) { + super.onScreenStateChanged(screenState); + if (mEditor != null) getEditor().onScreenStateChanged(screenState); + } + + @Override protected boolean isPaddingOffsetRequired() { return mShadowRadius != 0 || mDrawables != null; } @@ -11386,6 +11392,30 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener hideControllers(); } + void onScreenStateChanged(int screenState) { + switch (screenState) { + case SCREEN_STATE_ON: + resumeBlink(); + break; + case SCREEN_STATE_OFF: + suspendBlink(); + break; + } + } + + private void suspendBlink() { + if (mBlink != null) { + mBlink.cancel(); + } + } + + private void resumeBlink() { + if (mBlink != null) { + mBlink.uncancel(); + makeBlink(); + } + } + void adjustInputType(boolean password, boolean passwordInputType, boolean webPasswordInputType, boolean numberPasswordInputType) { // mInputType has been set from inputType, possibly modified by mInputMethod. |