diff options
56 files changed, 77 insertions, 22 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index b143325ae071..fbc8549a96e3 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -305,6 +305,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener int mTextSelectHandleRes; int mTextEditPasteWindowLayout; int mTextEditNoPasteWindowLayout; + Drawable mEditTextMultilineBackground; + Drawable mEditTextSingleLineBackground; Drawable mSelectHandleLeft; Drawable mSelectHandleRight; @@ -751,6 +753,10 @@ 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_textLineHeight: int lineHeight = a.getDimensionPixelSize(attr, 0); if (lineHeight != 0) { @@ -765,6 +771,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } a.recycle(); + mEditTextSingleLineBackground = getBackground(); BufferType bufferType = BufferType.EDITABLE; final int variation = @@ -6192,12 +6199,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (applyTransformation) { setTransformationMethod(SingleLineTransformationMethod.getInstance()); } + setBackgroundDrawable(mEditTextSingleLineBackground); } else { setMaxLines(Integer.MAX_VALUE); setHorizontallyScrolling(false); if (applyTransformation) { setTransformationMethod(null); } + setBackgroundDrawable(mEditTextMultilineBackground); } } diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..a38c03ac15dc --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_active_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..6a88a695bfd0 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_active_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png Binary files differindex 7ec219242167..87d9c21b47c5 100644 --- a/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/textfield_default_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png Binary files differindex c03e4f6bb4b2..720ee781383a 100644 --- a/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png +++ b/core/res/res/drawable-hdpi/textfield_default_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..4275da07e6b1 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..3ec9c1f711f1 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png Binary files differindex 664271762622..227bde2043d6 100644 --- a/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png +++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png Binary files differindex 957275241b31..6ddfab0fb637 100644 --- a/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png +++ b/core/res/res/drawable-hdpi/textfield_disabled_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png Binary files differdeleted file mode 100644 index 0ad248c16051..000000000000 --- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png Binary files differdeleted file mode 100644 index b7a07c4a0bd8..000000000000 --- a/core/res/res/drawable-hdpi/textfield_disabled_selected_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..7528479d0b25 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..4c7d9e78172b --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_active_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..09ca253edbc5 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..0a7d3a18c162 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_default_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..54a1519abfb4 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..06ca0d407a09 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..9015299a0022 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..b355cb398e41 --- /dev/null +++ b/core/res/res/drawable-hdpi/textfield_multiline_disabled_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/textfield_pressed.9.png b/core/res/res/drawable-hdpi/textfield_pressed.9.png Binary files differdeleted file mode 100644 index a42d87f05f41..000000000000 --- a/core/res/res/drawable-hdpi/textfield_pressed.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png Binary files differdeleted file mode 100644 index a271ac9bfe45..000000000000 --- a/core/res/res/drawable-hdpi/textfield_pressed_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png Binary files differdeleted file mode 100644 index 521722dcaa4e..000000000000 --- a/core/res/res/drawable-hdpi/textfield_pressed_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png Binary files differdeleted file mode 100644 index a271ac9bfe45..000000000000 --- a/core/res/res/drawable-hdpi/textfield_selected_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png Binary files differdeleted file mode 100644 index 521722dcaa4e..000000000000 --- a/core/res/res/drawable-hdpi/textfield_selected_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-ldpi/textfield_pressed.9.png b/core/res/res/drawable-ldpi/textfield_pressed.9.png Binary files differdeleted file mode 100644 index 1433365208b2..000000000000 --- a/core/res/res/drawable-ldpi/textfield_pressed.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..d37c8b2bb98a --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_active_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..16f2197ae371 --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_active_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png Binary files differindex 3a5f36d38db2..c98c951dbbb8 100644 --- a/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/textfield_default_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png Binary files differindex b8cc76f83699..7691f81418d1 100644 --- a/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png +++ b/core/res/res/drawable-mdpi/textfield_default_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..500ede31ae4e --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..99f7f38e526c --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png Binary files differindex a1f0c71a82f3..fab86acae8e5 100644 --- a/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png Binary files differindex 71e310397ddd..876eb79418f0 100644 --- a/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png +++ b/core/res/res/drawable-mdpi/textfield_disabled_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png Binary files differdeleted file mode 100644 index ac6d406aa434..000000000000 --- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png Binary files differdeleted file mode 100644 index bb6e9531deef..000000000000 --- a/core/res/res/drawable-mdpi/textfield_disabled_selected_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..2646899c4ac3 --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..374d457d121f --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_active_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..65c87badc80e --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..724b3fd9de99 --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_default_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..5f0ad56d65fb --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..df03a15f2d9f --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_focused_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png Binary files differnew file mode 100644 index 000000000000..2cc7f62f81e9 --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png Binary files differnew file mode 100644 index 000000000000..a2d9d8af07d8 --- /dev/null +++ b/core/res/res/drawable-mdpi/textfield_multiline_disabled_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/textfield_pressed.9.png b/core/res/res/drawable-mdpi/textfield_pressed.9.png Binary files differdeleted file mode 100644 index c909ad2a5d54..000000000000 --- a/core/res/res/drawable-mdpi/textfield_pressed.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png Binary files differdeleted file mode 100644 index 7667d958854d..000000000000 --- a/core/res/res/drawable-mdpi/textfield_pressed_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png Binary files differdeleted file mode 100644 index 269affd70c36..000000000000 --- a/core/res/res/drawable-mdpi/textfield_pressed_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png Binary files differdeleted file mode 100644 index 7667d958854d..000000000000 --- a/core/res/res/drawable-mdpi/textfield_selected_holo_dark.9.png +++ /dev/null diff --git a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png b/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png Binary files differdeleted file mode 100644 index 269affd70c36..000000000000 --- a/core/res/res/drawable-mdpi/textfield_selected_holo_light.9.png +++ /dev/null diff --git a/core/res/res/drawable/edit_text.xml b/core/res/res/drawable/edit_text.xml index 315278d5444d..e9ba84b6326d 100644 --- a/core/res/res/drawable/edit_text.xml +++ b/core/res/res/drawable/edit_text.xml @@ -15,11 +15,8 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/textfield_default" /> - <item android:state_window_focused="false" android:state_enabled="false" - android:drawable="@drawable/textfield_disabled" /> - <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed" /> + <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default" /> + <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled" /> <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected" /> <item android:state_enabled="true" android:drawable="@drawable/textfield_default" /> <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected" /> diff --git a/core/res/res/drawable/edit_text_holo_dark.xml b/core/res/res/drawable/edit_text_holo_dark.xml index b7d24ffa0ac4..63ccd1d6ba01 100644 --- a/core/res/res/drawable/edit_text_holo_dark.xml +++ b/core/res/res/drawable/edit_text_holo_dark.xml @@ -15,14 +15,11 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/textfield_default_holo_dark" /> - <item android:state_window_focused="false" android:state_enabled="false" - android:drawable="@drawable/textfield_disabled_holo_dark" /> - <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_dark" /> - <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_dark" /> + <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" /> + <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_dark" /> + <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_dark" /> <item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_dark" /> - <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_dark" /> + <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_dark" /> <item android:drawable="@drawable/textfield_disabled_holo_dark" /> </selector> diff --git a/core/res/res/drawable/edit_text_holo_light.xml b/core/res/res/drawable/edit_text_holo_light.xml index dae39e32e283..324acda1c857 100644 --- a/core/res/res/drawable/edit_text_holo_light.xml +++ b/core/res/res/drawable/edit_text_holo_light.xml @@ -15,14 +15,11 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_window_focused="false" android:state_enabled="true" - android:drawable="@drawable/textfield_default_holo_light" /> - <item android:state_window_focused="false" android:state_enabled="false" - android:drawable="@drawable/textfield_disabled_holo_light" /> - <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_holo_light" /> - <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_holo_light" /> + <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" /> + <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_holo_light" /> + <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_active_holo_light" /> <item android:state_enabled="true" android:drawable="@drawable/textfield_default_holo_light" /> - <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_holo_light" /> + <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_focused_holo_light" /> <item android:drawable="@drawable/textfield_disabled_holo_light" /> </selector> diff --git a/core/res/res/drawable/edit_text_multiline_holo_dark.xml b/core/res/res/drawable/edit_text_multiline_holo_dark.xml new file mode 100644 index 000000000000..67d274891bfa --- /dev/null +++ b/core/res/res/drawable/edit_text_multiline_holo_dark.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_dark" /> + <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_dark" /> + <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_dark" /> + <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_dark" /> + <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_dark" /> + <item android:drawable="@drawable/textfield_multiline_disabled_holo_dark" /> +</selector> diff --git a/core/res/res/drawable/edit_text_multiline_holo_light.xml b/core/res/res/drawable/edit_text_multiline_holo_light.xml new file mode 100644 index 000000000000..08b3ec68d885 --- /dev/null +++ b/core/res/res/drawable/edit_text_multiline_holo_light.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" /> + <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_multiline_disabled_holo_light" /> + <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_multiline_active_holo_light" /> + <item android:state_enabled="true" android:drawable="@drawable/textfield_multiline_default_holo_light" /> + <item android:state_focused="true" android:drawable="@drawable/textfield_multiline_disabled_focused_holo_light" /> + <item android:drawable="@drawable/textfield_multiline_disabled_holo_light" /> +</selector> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 0b6120277c83..55b3258e86d8 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -142,6 +142,8 @@ <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 @@ -2508,7 +2510,8 @@ <attr name="textLineHeight" /> <!-- Indicates that 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 b2db9b4e0457..dc67f45bbdc7 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -422,6 +422,7 @@ <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 88e755ff5717..dd7c8e4828fd 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -72,6 +72,7 @@ <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> @@ -685,6 +686,7 @@ <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> @@ -917,10 +919,11 @@ <item name="textAppearanceSearchResultSubtitle">@android:style/TextAppearance.Holo.Light.SearchResult.Subtitle</item> <item name="textAppearanceButton">@android:style/TextAppearance.Holo.Light.Widget.Button</item> - + <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> <item name="textCheckMark">@android:drawable/indicator_check_mark_light</item> |