summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2012-11-08 06:14:11 -0800
committer Android Git Automerger <android-git-automerger@android.com> 2012-11-08 06:14:11 -0800
commita965fc5e8f0c84cbeeaae7006eddbaf3bba64586 (patch)
tree9d58e529710802a18de916a0c05c8b9de2eb4d06
parentf4334f63c5162035ead3b44131c48015dfc6be58 (diff)
parentb37e5d756f04489ff95226e26ebfdf141d135f91 (diff)
am b37e5d75: am 7b9b41c1: am 1b3b2544: Merge "Dismiss error icon on setError(null) [regression] Bug #7442935" into jb-mr1-dev
* commit 'b37e5d756f04489ff95226e26ebfdf141d135f91': Dismiss error icon on setError(null) [regression] Bug #7442935
-rw-r--r--core/java/android/widget/Editor.java27
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;