diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2015-03-01 22:02:16 +0100 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-18 14:20:13 -0700 |
commit | ecb20c9fb1273b84b14c6aee4a80f39339d72d93 (patch) | |
tree | 0f61bef0856c2eed7bd0660ad608f43659d98abe /res | |
parent | 33da92201b255fe3282b0a85eba09ff490eb1a10 (diff) | |
download | android_frameworks_opt_chips-ecb20c9fb1273b84b14c6aee4a80f39339d72d93.tar.gz android_frameworks_opt_chips-ecb20c9fb1273b84b14c6aee4a80f39339d72d93.tar.bz2 android_frameworks_opt_chips-ecb20c9fb1273b84b14c6aee4a80f39339d72d93.zip |
chips: suggested contacts
This change adds support for custom suggested contacts (not associated/present in
the contacts provider) in BaseRecipientAdapter.
Basically an implementor MUST overload BaseRecipientAdapter#loadSuggestedEntries
and return a set of SuggestionEntry. This class also should react to onAddSuggestion
and onDeleteSuggestion methods, invoked when the user request add/delete the
suggested contact.
Vectors/SVG: https://cloud.ruesga.com/f/633563d38f/
Change-Id: I8312cba56251caab82b92e4e7520f8c9db7d9690
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable-hdpi/ic_suggested_contact_add.png | bin | 0 -> 1889 bytes | |||
-rw-r--r-- | res/drawable-hdpi/ic_suggested_contact_delete.png | bin | 0 -> 2018 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_suggested_contact_add.png | bin | 0 -> 1276 bytes | |||
-rw-r--r-- | res/drawable-mdpi/ic_suggested_contact_delete.png | bin | 0 -> 1336 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_suggested_contact_add.png | bin | 0 -> 2698 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/ic_suggested_contact_delete.png | bin | 0 -> 2949 bytes | |||
-rw-r--r-- | res/drawable-xxhdpi/ic_suggested_contact_add.png | bin | 0 -> 3559 bytes | |||
-rw-r--r-- | res/drawable-xxhdpi/ic_suggested_contact_delete.png | bin | 0 -> 3945 bytes | |||
-rw-r--r-- | res/drawable-xxxhdpi/ic_suggested_contact_add.png | bin | 0 -> 5250 bytes | |||
-rw-r--r-- | res/drawable-xxxhdpi/ic_suggested_contact_delete.png | bin | 0 -> 5810 bytes | |||
-rw-r--r-- | res/drawable/suggestion_button_bg.xml | 19 | ||||
-rw-r--r-- | res/layout/chips_autocomplete_recipient_dropdown_item.xml | 25 | ||||
-rw-r--r-- | res/values/colors.xml | 1 | ||||
-rw-r--r-- | res/values/dimen.xml | 1 | ||||
-rw-r--r-- | res/values/styles.xml | 27 |
15 files changed, 72 insertions, 1 deletions
diff --git a/res/drawable-hdpi/ic_suggested_contact_add.png b/res/drawable-hdpi/ic_suggested_contact_add.png Binary files differnew file mode 100644 index 0000000..e6fb9e0 --- /dev/null +++ b/res/drawable-hdpi/ic_suggested_contact_add.png diff --git a/res/drawable-hdpi/ic_suggested_contact_delete.png b/res/drawable-hdpi/ic_suggested_contact_delete.png Binary files differnew file mode 100644 index 0000000..c23652b --- /dev/null +++ b/res/drawable-hdpi/ic_suggested_contact_delete.png diff --git a/res/drawable-mdpi/ic_suggested_contact_add.png b/res/drawable-mdpi/ic_suggested_contact_add.png Binary files differnew file mode 100644 index 0000000..a594633 --- /dev/null +++ b/res/drawable-mdpi/ic_suggested_contact_add.png diff --git a/res/drawable-mdpi/ic_suggested_contact_delete.png b/res/drawable-mdpi/ic_suggested_contact_delete.png Binary files differnew file mode 100644 index 0000000..7a17537 --- /dev/null +++ b/res/drawable-mdpi/ic_suggested_contact_delete.png diff --git a/res/drawable-xhdpi/ic_suggested_contact_add.png b/res/drawable-xhdpi/ic_suggested_contact_add.png Binary files differnew file mode 100644 index 0000000..890d876 --- /dev/null +++ b/res/drawable-xhdpi/ic_suggested_contact_add.png diff --git a/res/drawable-xhdpi/ic_suggested_contact_delete.png b/res/drawable-xhdpi/ic_suggested_contact_delete.png Binary files differnew file mode 100644 index 0000000..1ad1105 --- /dev/null +++ b/res/drawable-xhdpi/ic_suggested_contact_delete.png diff --git a/res/drawable-xxhdpi/ic_suggested_contact_add.png b/res/drawable-xxhdpi/ic_suggested_contact_add.png Binary files differnew file mode 100644 index 0000000..8b7bb85 --- /dev/null +++ b/res/drawable-xxhdpi/ic_suggested_contact_add.png diff --git a/res/drawable-xxhdpi/ic_suggested_contact_delete.png b/res/drawable-xxhdpi/ic_suggested_contact_delete.png Binary files differnew file mode 100644 index 0000000..aba0596 --- /dev/null +++ b/res/drawable-xxhdpi/ic_suggested_contact_delete.png diff --git a/res/drawable-xxxhdpi/ic_suggested_contact_add.png b/res/drawable-xxxhdpi/ic_suggested_contact_add.png Binary files differnew file mode 100644 index 0000000..231a585 --- /dev/null +++ b/res/drawable-xxxhdpi/ic_suggested_contact_add.png diff --git a/res/drawable-xxxhdpi/ic_suggested_contact_delete.png b/res/drawable-xxxhdpi/ic_suggested_contact_delete.png Binary files differnew file mode 100644 index 0000000..2287f0c --- /dev/null +++ b/res/drawable-xxxhdpi/ic_suggested_contact_delete.png diff --git a/res/drawable/suggestion_button_bg.xml b/res/drawable/suggestion_button_bg.xml new file mode 100644 index 0000000..708400c --- /dev/null +++ b/res/drawable/suggestion_button_bg.xml @@ -0,0 +1,19 @@ +<?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. +--> + +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="#40000000"> +</ripple> diff --git a/res/layout/chips_autocomplete_recipient_dropdown_item.xml b/res/layout/chips_autocomplete_recipient_dropdown_item.xml index ec512c2..80341f3 100644 --- a/res/layout/chips_autocomplete_recipient_dropdown_item.xml +++ b/res/layout/chips_autocomplete_recipient_dropdown_item.xml @@ -39,7 +39,30 @@ </LinearLayout> - <com.android.ex.chips.CircularImageView style="@style/ChipEndIconStyle" /> + <FrameLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + <LinearLayout + android:id="@+id/chips_recipients_icons_layout" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + + <com.android.ex.chips.CircularImageView style="@style/ChipEndIconStyle" /> + + <com.android.ex.chips.CircularImageView + android:id="@+id/chip_suggested_contact_add" + style="@style/ChipAddSuggestedIconStyle" /> + + <com.android.ex.chips.CircularImageView + android:id="@+id/chip_suggested_contact_delete" + style="@style/ChipDeleteSuggestedIconStyle" /> + </LinearLayout> + + <ImageView + android:id="@+id/chip_recipients_action_layout" + android:visibility="gone" + style="@style/ChipActionResultDrawableStyle"/> + </FrameLayout> </LinearLayout> diff --git a/res/values/colors.xml b/res/values/colors.xml index 5130a32..4282ffb 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -30,4 +30,5 @@ <color name="chips_dropdown_text_activated">@android:color/white</color> <color name="chips_dropdown_text_highlighted">#757575</color> + <color name="chip_suggestion_action">#c3c3c3</color> </resources> diff --git a/res/values/dimen.xml b/res/values/dimen.xml index 042021d..4edfe8a 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -27,6 +27,7 @@ <integer name="chips_max_lines">-1</integer> <!-- dropdown --> + <dimen name="chip_icon_margin_separator">5dp</dimen> <dimen name="chip_icon_margin_end">12dp</dimen> <dimen name="chip_dropdown_height">72dp</dimen> <dimen name="chip_custom_divider_height">0.5dp</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index 8cb48e0..b5d5b66 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -90,6 +90,33 @@ <item name="android:layout_marginLeft">@dimen/chip_icon_margin_end</item> </style> + <style name="ChipSuggestedIconStyle"> + <item name="android:layout_width">40dp</item> + <item name="android:layout_height">40dp</item> + <item name="android:layout_gravity">center_vertical</item> + <item name="android:scaleType">centerInside</item> + <item name="android:contentDescription">@null</item> + <item name="android:background">@drawable/suggestion_button_bg</item> + </style> + + <style name="ChipAddSuggestedIconStyle" parent="@style/ChipSuggestedIconStyle"> + <item name="android:src">@drawable/ic_suggested_contact_add</item> + <item name="android:layout_marginLeft">@dimen/chip_icon_margin_end</item> + </style> + + <style name="ChipDeleteSuggestedIconStyle" parent="@style/ChipSuggestedIconStyle"> + <item name="android:src">@drawable/ic_suggested_contact_delete</item> + <item name="android:layout_marginLeft">@dimen/chip_icon_margin_separator</item> + </style> + + <style name="ChipActionResultDrawableStyle"> + <item name="android:layout_width">32dp</item> + <item name="android:layout_height">32dp</item> + <item name="android:layout_gravity">center</item> + <item name="android:contentDescription">@null</item> + <item name="android:layout_marginLeft">@dimen/chip_icon_margin_end</item> + </style> + <style name="ChipDeleteIconBaseStyle"> <item name="android:id">@android:id/icon1</item> <item name="android:layout_width">36dp</item> |