summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2010-12-21 17:32:43 -0800
committerGilles Debunne <debunne@google.com>2011-01-04 09:19:35 -0800
commitb2316968cfb96148ebcff268afd32f98150a8869 (patch)
treec8981ce61c1f5d1bf8ff355945ee9607defa1085
parentc01f3feeb09b96f666c35fa1858ab3034599a452 (diff)
downloadframeworks_base-b2316968cfb96148ebcff268afd32f98150a8869.zip
frameworks_base-b2316968cfb96148ebcff268afd32f98150a8869.tar.gz
frameworks_base-b2316968cfb96148ebcff268afd32f98150a8869.tar.bz2
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
-rw-r--r--core/java/android/widget/TextView.java16
-rwxr-xr-xcore/res/res/values/attrs.xml4
-rw-r--r--core/res/res/values/styles.xml1
-rw-r--r--core/res/res/values/themes.xml3
4 files changed, 3 insertions, 21 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 32da572..d4515d5 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -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,13 +6387,10 @@ 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
}
}
-
+
/**
* Causes words in the text that are longer than the view is wide
* to be ellipsized instead of broken in the middle. You may also
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index f6899ad..8333157 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -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
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index f6c88e7..8a86676 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -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>
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 43686bc..439d551 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -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>