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

Commit b2316968 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Multi-line EditText background is set using a state.

Step 1/2: remove the previous code that relied on a specific theme attribute.

Bug 3214105

Change-Id: Ib4fc55a9093d64e69ac798ec56503ccdb284cbec
parent c01f3fee
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -310,8 +310,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    int mTextSelectHandleRes;
    int mTextEditPasteWindowLayout;
    int mTextEditNoPasteWindowLayout;
    Drawable mEditTextMultilineBackground;
    Drawable mEditTextSingleLineBackground;

    Drawable mSelectHandleLeft;
    Drawable mSelectHandleRight;
@@ -765,10 +763,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                mTextEditNoPasteWindowLayout = a.getResourceId(attr, 0);
                break;

            case com.android.internal.R.styleable.TextView_multilineBackground:
                mEditTextMultilineBackground = a.getDrawable(attr);
                break;

            case com.android.internal.R.styleable.TextView_textIsSelectable:
                mTextIsSelectable = a.getBoolean(attr, false);
                break;
@@ -776,7 +770,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
        a.recycle();

        mEditTextSingleLineBackground = getBackground();
        BufferType bufferType = BufferType.EDITABLE;

        final int variation =
@@ -6385,7 +6378,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            if (applyTransformation) {
                setTransformationMethod(SingleLineTransformationMethod.getInstance());
            }
            setBackgroundDrawable(mEditTextSingleLineBackground);
            // TODO setState
        } else {
            if (changeMaxLines) {
                setMaxLines(Integer.MAX_VALUE);
@@ -6394,10 +6387,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            if (applyTransformation) {
                setTransformationMethod(null);
            }
            // mEditTextMultilineBackground is defined and used only in EditText
            if (mEditTextMultilineBackground != null) {
                setBackgroundDrawable(mEditTextMultilineBackground);
            }
            // TODO setState
        }
    }

+0 −4
Original line number Diff line number Diff line
@@ -141,8 +141,6 @@
        <attr name="editTextColor" format="reference|color" />
        <!-- EditText background drawable. -->
        <attr name="editTextBackground" format="reference" />
        <!-- EditText background drawable for multiline EditText. -->
        <attr name="editTextMultilineBackground" format="reference" />

        <!-- A styled string, specifying the style to be used for showing
             inline candidate text when composing with an input method.  The
@@ -2685,8 +2683,6 @@
        <attr name="textEditNoPasteWindowLayout" />
        <!-- Indicates that the content of a non-editable text can be selected. -->
        <attr name="textIsSelectable" />
        <!--  A specific background drawable used by multi-line EditText only. -->
        <attr name="multilineBackground" format="reference"/>
    </declare-styleable>
    <!-- An <code>input-extras</code> is a container for extra data to supply to
         an input method.  Contains
+0 −1
Original line number Diff line number Diff line
@@ -444,7 +444,6 @@
        <item name="android:focusableInTouchMode">true</item>
        <item name="android:clickable">true</item>
        <item name="android:background">?android:attr/editTextBackground</item>
        <item name="android:multilineBackground">?android:attr/editTextMultilineBackground</item>
        <item name="android:textAppearance">?android:attr/textAppearanceMediumInverse</item>
        <item name="android:textColor">?android:attr/editTextColor</item>
        <item name="android:gravity">center_vertical</item>
+0 −3
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@
        
        <item name="editTextColor">?android:attr/textColorPrimaryInverse</item>
        <item name="editTextBackground">@android:drawable/edit_text</item>
        <item name="editTextMultilineBackground">@android:drawable/edit_text</item>
        
        <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
        
@@ -736,7 +735,6 @@
        
        <item name="editTextColor">?android:attr/textColorPrimary</item>
        <item name="editTextBackground">@android:drawable/edit_text_holo_dark</item>
        <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_dark</item>
        
        <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>
        
@@ -995,7 +993,6 @@

        <item name="editTextColor">?android:attr/textColorPrimary</item>
        <item name="editTextBackground">@android:drawable/edit_text_holo_light</item>
        <item name="editTextMultilineBackground">@android:drawable/edit_text_multiline_holo_light</item>

        <item name="candidatesTextStyleSpans">@android:string/candidates_style</item>