diff options
| author | Romain Guy <romainguy@google.com> | 2012-11-06 16:21:05 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-06 16:21:05 -0800 |
| commit | b37e5d756f04489ff95226e26ebfdf141d135f91 (patch) | |
| tree | b70b30c8c8886d36a190a22c49ec9a198b89f9b7 /core/java/android | |
| parent | 9671e6e116bbb8a82784457382cab3f90289e31b (diff) | |
| parent | 7b9b41c18d0dc9d238111fa1865c72e4a5bb22cc (diff) | |
am 7b9b41c1: am 1b3b2544: Merge "Dismiss error icon on setError(null) [regression] Bug #7442935" into jb-mr1-dev
* commit '7b9b41c18d0dc9d238111fa1865c72e4a5bb22cc':
Dismiss error icon on setError(null) [regression] Bug #7442935
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/widget/Editor.java | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 5397eb6634fa..b1a44c5a89bc 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -289,13 +289,7 @@ public class Editor { public void setError(CharSequence error, Drawable icon) { mError = TextUtils.stringOrSpannedString(error); mErrorWasChanged = true; - final Drawables dr = mTextView.mDrawables; - if (dr != null) { - mTextView.setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon, - dr.mDrawableBottom); - } else { - mTextView.setCompoundDrawables(null, null, icon, null); - } + if (mError == null) { if (mErrorPopup != null) { if (mErrorPopup.isShowing()) { @@ -304,10 +298,21 @@ public class Editor { mErrorPopup = null; } + + setErrorIcon(null); + } else if (mTextView.isFocused()) { + showError(); + setErrorIcon(icon); + } + } + + private void setErrorIcon(Drawable icon) { + final Drawables dr = mTextView.mDrawables; + if (dr != null) { + mTextView.setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon, + dr.mDrawableBottom); } else { - if (mTextView.isFocused()) { - showError(); - } + mTextView.setCompoundDrawables(null, null, icon, null); } } @@ -316,6 +321,8 @@ public class Editor { if (mErrorPopup.isShowing()) { mErrorPopup.dismiss(); } + + setErrorIcon(null); } mShowErrorAfterAttach = false; |
