diff options
author | Scott Kennedy <skennedy@google.com> | 2014-07-10 14:36:05 -0700 |
---|---|---|
committer | Scott Kennedy <skennedy@google.com> | 2014-07-10 15:49:04 -0700 |
commit | c85e75e231fab797a4b0bda5a0d8373419718dab (patch) | |
tree | a2b16109133df3ac97351ab535f848c4b3ff4933 /res | |
parent | 15259d5bab45b9e561d33e5d1d23df3a1476a430 (diff) | |
download | android_frameworks_opt_chips-c85e75e231fab797a4b0bda5a0d8373419718dab.tar.gz android_frameworks_opt_chips-c85e75e231fab797a4b0bda5a0d8373419718dab.tar.bz2 android_frameworks_opt_chips-c85e75e231fab797a4b0bda5a0d8373419718dab.zip |
Update dropdown assets/layouts for Material
Change-Id: I4b5684896e4e70b6f44f3feb2bf0f997265be848
Diffstat (limited to 'res')
-rw-r--r-- | res/color/chips_dropdown_text.xml (renamed from res/layout/chips_alternate_item.xml) | 12 | ||||
-rw-r--r-- | res/drawable-hdpi/chips_popup_background.9.png | bin | 0 -> 149 bytes | |||
-rw-r--r-- | res/drawable-mdpi/chips_popup_background.9.png | bin | 0 -> 209 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/chips_popup_background.9.png | bin | 0 -> 169 bytes | |||
-rw-r--r-- | res/drawable-xxhdpi/chips_popup_background.9.png | bin | 0 -> 207 bytes | |||
-rw-r--r-- | res/drawable/chips_dropdown_background.xml | 25 | ||||
-rw-r--r-- | res/layout/chips_recipient_dropdown_item.xml | 79 | ||||
-rw-r--r-- | res/values-v17/styles.xml (renamed from res/values-v17/styles-v17.xml) | 7 | ||||
-rw-r--r-- | res/values/colors.xml | 23 | ||||
-rw-r--r-- | res/values/dimen.xml | 5 | ||||
-rw-r--r-- | res/values/styles.xml | 9 |
11 files changed, 104 insertions, 56 deletions
diff --git a/res/layout/chips_alternate_item.xml b/res/color/chips_dropdown_text.xml index 9bc7b6d..f6addfd 100644 --- a/res/layout/chips_alternate_item.xml +++ b/res/color/chips_dropdown_text.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2011 The Android Open Source Project +<!-- + Copyright (C) 2014 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. @@ -14,10 +15,9 @@ limitations under the License. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="wrap_content"> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <include layout="@layout/chips_recipient_dropdown_item"/> + <item android:state_activated="true" android:color="#212121"/> + <item android:color="#757575"/> -</FrameLayout> +</selector>
\ No newline at end of file diff --git a/res/drawable-hdpi/chips_popup_background.9.png b/res/drawable-hdpi/chips_popup_background.9.png Binary files differnew file mode 100644 index 0000000..060ffad --- /dev/null +++ b/res/drawable-hdpi/chips_popup_background.9.png diff --git a/res/drawable-mdpi/chips_popup_background.9.png b/res/drawable-mdpi/chips_popup_background.9.png Binary files differnew file mode 100644 index 0000000..2989590 --- /dev/null +++ b/res/drawable-mdpi/chips_popup_background.9.png diff --git a/res/drawable-xhdpi/chips_popup_background.9.png b/res/drawable-xhdpi/chips_popup_background.9.png Binary files differnew file mode 100644 index 0000000..f8b809a --- /dev/null +++ b/res/drawable-xhdpi/chips_popup_background.9.png diff --git a/res/drawable-xxhdpi/chips_popup_background.9.png b/res/drawable-xxhdpi/chips_popup_background.9.png Binary files differnew file mode 100644 index 0000000..bb4f281 --- /dev/null +++ b/res/drawable-xxhdpi/chips_popup_background.9.png diff --git a/res/drawable/chips_dropdown_background.xml b/res/drawable/chips_dropdown_background.xml new file mode 100644 index 0000000..6a7eeec --- /dev/null +++ b/res/drawable/chips_dropdown_background.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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:drawable="@color/chips_dropdown_background_activated" + android:state_activated="true"/> + <item android:drawable="@color/chips_dropdown_background_pressed" android:state_pressed="true"/> + <item android:drawable="@android:color/white"/> + +</selector>
\ 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 b02b197..52d3007 100644 --- a/res/layout/chips_recipient_dropdown_item.xml +++ b/res/layout/chips_recipient_dropdown_item.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2011 The Android Open Source Project +<!-- + Copyright (C) 2014 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. @@ -13,45 +14,43 @@ See the License for the specific language governing permissions and limitations under the License. --> - -<LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="48dip" - android:orientation="horizontal" - android:gravity="center_vertical" - android:background="?android:attr/activatedBackgroundIndicator"> - <LinearLayout - android:layout_width="0dip" - android:layout_height="wrap_content" - android:gravity="center_vertical" - android:orientation="vertical" - android:layout_weight="1"> - <TextView android:id="@android:id/title" - android:textColor="@drawable/list_item_font_primary" - android:textSize="18sp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - style="@style/ChipTitleStyle" /> - <TextView android:id="@android:id/text1" - android:textColor="@drawable/list_item_font_secondary" - android:textSize="14sp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:ellipsize="end" - android:layout_marginTop="-4dip" - style="@style/ChipSubtitleStyle" /> - </LinearLayout> + android:layout_height="match_parent" + android:background="@drawable/chips_dropdown_background" + android:padding="16dp" > + <ImageView android:id="@android:id/icon" - android:layout_width="48dip" - android:layout_height="48dip" - android:src="@drawable/ic_contact_picture" - android:cropToPadding="true" - android:scaleType="centerCrop" - style="@style/ChipIconStyle" /> -</LinearLayout> + style="@style/ChipIconStyle" + android:layout_width="48dp" + android:layout_height="48dp" + android:contentDescription="@null" /> + + <TextView + android:id="@android:id/title" + style="@style/ChipTitleStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="5dp" + android:ellipsize="middle" + android:singleLine="true" + android:textColor="@color/chips_dropdown_text" + android:textSize="14sp" + android:textStyle="bold" /> + + <!-- Use bottom padding instead of margin to workaround RelativeLayout bug. --> + + <TextView + android:id="@android:id/text1" + style="@style/ChipSubtitleStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentBottom="true" + android:ellipsize="middle" + android:paddingBottom="5dp" + android:singleLine="true" + android:textColor="@color/chips_dropdown_text" + android:textSize="14sp" /> + +</RelativeLayout>
\ No newline at end of file diff --git a/res/values-v17/styles-v17.xml b/res/values-v17/styles.xml index d151a75..03f6ae3 100644 --- a/res/values-v17/styles-v17.xml +++ b/res/values-v17/styles.xml @@ -15,14 +15,15 @@ --> <resources> <style name="ChipTitleStyle"> - <item name="android:paddingStart">@dimen/chip_title_padding_start</item> + <item name="android:layout_toEndOf">@android:id/icon</item> </style> <style name="ChipSubtitleStyle"> - <item name="android:paddingStart">@dimen/chip_subtitle_padding_start</item> + <item name="android:layout_toEndOf">@android:id/icon</item> </style> <style name="ChipIconStyle"> - <item name="android:layout_marginStart">@dimen/chip_icon_margin_start</item> + <item name="android:layout_marginEnd">@dimen/chip_icon_margin_end</item> + <item name="android:layout_alignParentStart">true</item> </style> </resources> diff --git a/res/values/colors.xml b/res/values/colors.xml new file mode 100644 index 0000000..8b6347c --- /dev/null +++ b/res/values/colors.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2014 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. +--> + +<resources> + + <color name="chips_dropdown_background_activated">#4285f4</color> + <color name="chips_dropdown_background_pressed">#ededed</color> + +</resources>
\ No newline at end of file diff --git a/res/values/dimen.xml b/res/values/dimen.xml index 0304e1f..60049df 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -20,8 +20,5 @@ <dimen name="chip_text_size">14sp</dimen> <dimen name="line_spacing_extra">4dip</dimen> <integer name="chips_max_lines">-1</integer> - - <dimen name="chip_title_padding_start">8dip</dimen> - <dimen name="chip_subtitle_padding_start">16dip</dimen> - <dimen name="chip_icon_margin_start">12dip</dimen> + <dimen name="chip_icon_margin_end">16dp</dimen> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 9b60cde..21ca7ed 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -24,21 +24,24 @@ <item name="android:layout_width">match_parent</item> <item name="android:dropDownVerticalOffset">-6dip</item> <item name="android:dropDownHorizontalOffset">-16dip</item> + <item name="android:dropDownWidth">match_parent</item> <item name="android:minHeight">48dip</item> <item name="android:lineSpacingExtra">@dimen/line_spacing_extra</item> <item name="android:textAlignment" tools:ignore="NewApi">viewStart</item> <item name="android:textDirection" tools:ignore="NewApi">locale</item> + <item name="android:popupBackground">@drawable/chips_popup_background</item> </style> <style name="ChipTitleStyle"> - <item name="android:paddingLeft">@dimen/chip_title_padding_start</item> + <item name="android:layout_toRightOf">@android:id/icon</item> </style> <style name="ChipSubtitleStyle"> - <item name="android:paddingLeft">@dimen/chip_subtitle_padding_start</item> + <item name="android:layout_toRightOf">@android:id/icon</item> </style> <style name="ChipIconStyle"> - <item name="android:layout_marginLeft">@dimen/chip_icon_margin_start</item> + <item name="android:layout_marginRight">@dimen/chip_icon_margin_end</item> + <item name="android:layout_alignParentLeft">true</item> </style> </resources> |