summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-07-30 10:11:07 -0700
committerJin Cao <jinyan@google.com>2014-07-31 10:22:38 -0700
commit4db8cccf3332ad7c6fb1915f9f0f169953c3953a (patch)
tree85ae1f41f0c70a670d306c4455da7a1a6240b1b7 /res
parent6fc1fee597ebe3c30ebe5efebb4d6ea105641e0f (diff)
downloadandroid_frameworks_opt_chips-4db8cccf3332ad7c6fb1915f9f0f169953c3953a.tar.gz
android_frameworks_opt_chips-4db8cccf3332ad7c6fb1915f9f0f169953c3953a.tar.bz2
android_frameworks_opt_chips-4db8cccf3332ad7c6fb1915f9f0f169953c3953a.zip
[Quantum chips] add delete button in dropdown
For single/alternate recipient dropdown there is now a delete button next to the currently selected contact for easier removal of the selected chip. b/16383133 Change-Id: Ied238b91b42673142de88a159b50772bd6b7b937
Diffstat (limited to 'res')
-rw-r--r--res/layout/chips_autocomplete_recipient_dropdown_item.xml18
-rw-r--r--res/layout/chips_recipient_dropdown_item.xml18
-rw-r--r--res/values-v17/styles.xml22
-rw-r--r--res/values/styles.xml38
4 files changed, 46 insertions, 50 deletions
diff --git a/res/layout/chips_autocomplete_recipient_dropdown_item.xml b/res/layout/chips_autocomplete_recipient_dropdown_item.xml
index 4f8427d..d3d0c8f 100644
--- a/res/layout/chips_autocomplete_recipient_dropdown_item.xml
+++ b/res/layout/chips_autocomplete_recipient_dropdown_item.xml
@@ -14,16 +14,24 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/chip_dropdown_height"
android:background="@drawable/chips_dropdown_background"
style="@style/ChipAutocompleteWrapperStyle">
- <com.android.ex.chips.CircularImageView style="@style/ChipEndIconStyle" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <TextView style="@style/ChipTitleStyle" />
- <TextView style="@style/ChipTitleEndIconStyle" />
+ <TextView style="@style/ChipSubtitleStyle" />
- <TextView style="@style/ChipSubtitleEndIconStyle" />
+ </LinearLayout>
+
+ <com.android.ex.chips.CircularImageView style="@style/ChipEndIconStyle" />
-</RelativeLayout> \ No newline at end of file
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/chips_recipient_dropdown_item.xml b/res/layout/chips_recipient_dropdown_item.xml
index ec0740b..8587baa 100644
--- a/res/layout/chips_recipient_dropdown_item.xml
+++ b/res/layout/chips_recipient_dropdown_item.xml
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/chip_dropdown_height"
android:background="@drawable/chips_dropdown_background"
@@ -22,8 +22,18 @@
<com.android.ex.chips.CircularImageView style="@style/ChipStartIconStyle" />
- <TextView style="@style/ChipTitleStartIconStyle" />
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
- <TextView style="@style/ChipSubtitleStartIconStyle" />
+ <TextView style="@style/ChipTitleStyle" />
-</RelativeLayout> \ No newline at end of file
+ <TextView style="@style/ChipSubtitleStyle" />
+
+ </LinearLayout>
+
+ <com.android.ex.chips.CircularImageView style="@style/ChipDeleteIconStyle" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/values-v17/styles.xml b/res/values-v17/styles.xml
index 7674bad..f7b2477 100644
--- a/res/values-v17/styles.xml
+++ b/res/values-v17/styles.xml
@@ -21,29 +21,15 @@
<item name="android:paddingBottom">@dimen/chip_wrapper_bottom_padding</item>
</style>
- <style name="ChipTitleStartIconStyle" parent="@style/ChipTitleBaseStyle">
- <item name="android:layout_toEndOf">@android:id/icon</item>
- </style>
-
- <style name="ChipTitleEndIconStyle" parent="@style/ChipTitleBaseStyle">
- <item name="android:layout_toStartOf">@android:id/icon</item>
- </style>
-
- <style name="ChipSubtitleStartIconStyle" parent="@style/ChipSubtitleBaseStyle">
- <item name="android:layout_toEndOf">@android:id/icon</item>
- </style>
-
- <style name="ChipSubtitleEndIconStyle" parent="@style/ChipSubtitleBaseStyle">
- <item name="android:layout_toStartOf">@android:id/icon</item>
- </style>
-
<style name="ChipStartIconStyle" parent="@style/ChipIconBaseStyle">
<item name="android:layout_marginEnd">@dimen/chip_icon_margin_end</item>
- <item name="android:layout_alignParentStart">true</item>
</style>
<style name="ChipEndIconStyle" parent="@style/ChipIconBaseStyle">
<item name="android:layout_marginStart">@dimen/chip_icon_margin_end</item>
- <item name="android:layout_alignParentEnd">true</item>
+ </style>
+
+ <style name="ChipDeleteIconStyle" parent="@style/ChipDeleteIconBaseStyle">
+ <item name="android:paddingStart">20dp</item>
</style>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 8b671d1..bdee911 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -39,46 +39,28 @@
<item name="android:paddingBottom">@dimen/chip_wrapper_bottom_padding</item>
</style>
- <style name="ChipTitleBaseStyle">
+ <style name="ChipTitleStyle">
<item name="android:id">@android:id/title</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:ellipsize">middle</item>
- <item name="android:paddingTop">1dp</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">@color/chips_dropdown_title_text</item>
<item name="android:textSize">16sp</item>
</style>
- <style name="ChipTitleStartIconStyle" parent="@style/ChipTitleBaseStyle">
- <item name="android:layout_toRightOf">@android:id/icon</item>
- </style>
-
- <style name="ChipTitleEndIconStyle" parent="@style/ChipTitleBaseStyle">
- <item name="android:layout_toLeftOf">@android:id/icon</item>
- </style>
-
- <style name="ChipSubtitleBaseStyle">
+ <style name="ChipSubtitleStyle">
<item name="android:id">@android:id/text1</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_alignParentBottom">true</item>
+ <item name="android:layout_gravity">center_vertical</item>
<item name="android:ellipsize">middle</item>
- <item name="android:paddingBottom">1dp</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">@color/chips_dropdown_subtitle_text</item>
<item name="android:textSize">14sp</item>
</style>
- <style name="ChipSubtitleStartIconStyle" parent="@style/ChipSubtitleBaseStyle">
- <item name="android:layout_toRightOf">@android:id/icon</item>
- </style>
-
- <style name="ChipSubtitleEndIconStyle" parent="@style/ChipSubtitleBaseStyle">
- <item name="android:layout_toLeftOf">@android:id/icon</item>
- </style>
-
<style name="ChipIconBaseStyle">
<item name="android:id">@android:id/icon</item>
<item name="android:layout_width">40dp</item>
@@ -88,11 +70,21 @@
<style name="ChipStartIconStyle" parent="@style/ChipIconBaseStyle">
<item name="android:layout_marginRight">@dimen/chip_icon_margin_end</item>
- <item name="android:layout_alignParentLeft">true</item>
</style>
<style name="ChipEndIconStyle" parent="@style/ChipIconBaseStyle">
<item name="android:layout_marginLeft">@dimen/chip_icon_margin_end</item>
- <item name="android:layout_alignParentRight">true</item>
+ </style>
+
+ <style name="ChipDeleteIconBaseStyle">
+ <item name="android:id">@android:id/icon1</item>
+ <item name="android:layout_width">40dp</item>
+ <item name="android:layout_height">40dp</item>
+ <item name="android:paddingTop">10dp</item>
+ <item name="android:paddingBottom">10dp</item>
+ </style>
+
+ <style name="ChipDeleteIconStyle" parent="@style/ChipDeleteIconBaseStyle">
+ <item name="android:paddingLeft">20dp</item>
</style>
</resources>