Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b37e5d75 authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 7b9b41c1: am 1b3b2544: Merge "Dismiss error icon on setError(null)...

am 7b9b41c1: am 1b3b2544: Merge "Dismiss error icon on setError(null) [regression] Bug #7442935" into jb-mr1-dev

* commit '7b9b41c1':
  Dismiss error icon on setError(null) [regression] Bug #7442935
parents 9671e6e1 7b9b41c1
Loading
Loading
Loading
Loading
+17 −10
Original line number Original line Diff line number Diff line
@@ -289,13 +289,7 @@ public class Editor {
    public void setError(CharSequence error, Drawable icon) {
    public void setError(CharSequence error, Drawable icon) {
        mError = TextUtils.stringOrSpannedString(error);
        mError = TextUtils.stringOrSpannedString(error);
        mErrorWasChanged = true;
        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 (mError == null) {
            if (mErrorPopup != null) {
            if (mErrorPopup != null) {
                if (mErrorPopup.isShowing()) {
                if (mErrorPopup.isShowing()) {
@@ -304,11 +298,22 @@ public class Editor {


                mErrorPopup = null;
                mErrorPopup = null;
            }
            }
        } else {

            if (mTextView.isFocused()) {
            setErrorIcon(null);
        } else if (mTextView.isFocused()) {
            showError();
            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 {
            mTextView.setCompoundDrawables(null, null, icon, null);
        }
    }
    }


    private void hideError() {
    private void hideError() {
@@ -316,6 +321,8 @@ public class Editor {
            if (mErrorPopup.isShowing()) {
            if (mErrorPopup.isShowing()) {
                mErrorPopup.dismiss();
                mErrorPopup.dismiss();
            }
            }

            setErrorIcon(null);
        }
        }


        mShowErrorAfterAttach = false;
        mShowErrorAfterAttach = false;