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

Commit 6b20dc43 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Error popup no longer flickers in TextViews." into honeycomb

parents 637739d4 a85467bc
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -3426,8 +3426,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            setError(null, null);
        } else {
            Drawable dr = getContext().getResources().
                getDrawable(com.android.internal.R.drawable.
                            indicator_input_error);
                getDrawable(com.android.internal.R.drawable.indicator_input_error);

            dr.setBounds(0, 0, dr.getIntrinsicWidth(), dr.getIntrinsicHeight());
            setError(error, dr);
@@ -3450,8 +3449,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        mErrorWasChanged = true;
        final Drawables dr = mDrawables;
        if (dr != null) {
            setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop,
                                 icon, dr.mDrawableBottom);
            setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon, dr.mDrawableBottom);
        } else {
            setCompoundDrawables(null, null, icon, null);
        }
@@ -3479,8 +3477,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        if (mPopup == null) {
            LayoutInflater inflater = LayoutInflater.from(getContext());
            final TextView err = (TextView) inflater.inflate(com.android.internal.R.layout.textview_hint,
                    null);
            final TextView err = (TextView) inflater.inflate(
                    com.android.internal.R.layout.textview_hint, null);

            final float scale = getResources().getDisplayMetrics().density;
            mPopup = new ErrorPopup(err, (int) (200 * scale + 0.5f),
+0 −4
Original line number Diff line number Diff line
@@ -142,10 +142,6 @@ public class EditableInputConnection extends BaseInputConnection {
        boolean success = super.commitText(text, newCursorPosition);
        CharSequence errorAfter = mTextView.getError();

        if (errorAfter != null && errorBefore == errorAfter) {
            mTextView.setError(null, null);
        }

        return success;
    }
}