diff options
author | yueg <yueg@google.com> | 2018-06-19 16:54:38 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-19 16:55:54 -0700 |
commit | 406de13ab4326bbedae0262709a004da2211d04c (patch) | |
tree | 5e9f525d8dc782b1ba778b191184d0960617bcc9 /java/com/android/dialer/speeddial/res | |
parent | acfab4ed674bb7b0154373c626ce494f37629509 (diff) |
Drag favorite to remove
Test: RemoveViewHolderTest, SpeedDialAdapterTest
PiperOrigin-RevId: 201266033
Change-Id: Ie7ed9bac8ad9c7bbc35c351409b629e3fbad3de8
Diffstat (limited to 'java/com/android/dialer/speeddial/res')
4 files changed, 59 insertions, 2 deletions
diff --git a/java/com/android/dialer/speeddial/res/layout/favorite_remove_view_layout.xml b/java/com/android/dialer/speeddial/res/layout/favorite_remove_view_layout.xml new file mode 100644 index 000000000..825658c37 --- /dev/null +++ b/java/com/android/dialer/speeddial/res/layout/favorite_remove_view_layout.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 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 + --> + +<!-- Sets android:importantForAccessibility="no" to avoid being announced when navigating with + talkback enabled. It will still be announced when user drag or drop contact onto it. + This is required since drag and drop event is only sent to views are visible when drag + starts. --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/favorite_remove_view" + android:layout_width="match_parent" + android:layout_height="@dimen/expanded_search_bar_height" + android:background="?android:attr/colorPrimary" + android:gravity="center" + android:orientation="horizontal" + android:visibility="invisible" + android:contentDescription="@string/speed_dial_remove_favorites" + android:importantForAccessibility="no"> + + <ImageView + android:id="@+id/remove_view_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:src="@drawable/quantum_ic_close_vd_theme_24" + android:tint="?colorIconOnUnthemedDarkBackground"/> + + <TextView + android:id="@+id/remove_view_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/speed_dial_remove_favorites" + android:textColor="?colorTextOnUnthemedDarkBackground" + android:textSize="16sp"/> +</LinearLayout>
\ No newline at end of file diff --git a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml index e289bb794..472f9e951 100644 --- a/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml +++ b/java/com/android/dialer/speeddial/res/layout/fragment_speed_dial.xml @@ -17,14 +17,17 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/speed_dial_root" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:clipChildren="false" + android:clipToPadding="false"> <android.support.v7.widget.RecyclerView android:id="@+id/speed_dial_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" + android:layout_marginTop="@dimen/expanded_search_bar_height_minus" android:clipToPadding="false" - android:background="?android:attr/colorBackground" + android:background="@android:color/transparent" android:paddingBottom="@dimen/floating_action_button_list_bottom_padding"/> <com.android.dialer.widget.EmptyContentView diff --git a/java/com/android/dialer/speeddial/res/values/dimens.xml b/java/com/android/dialer/speeddial/res/values/dimens.xml index a4cf16c17..624c60dd3 100644 --- a/java/com/android/dialer/speeddial/res/values/dimens.xml +++ b/java/com/android/dialer/speeddial/res/values/dimens.xml @@ -32,4 +32,6 @@ <dimen name="speed_dial_context_menu_x_offset">-24dp</dimen> <dimen name="speed_dial_context_menu_corner_radius">16dp</dimen> <dimen name="disambig_dialog_width">280dp</dimen> + <dimen name="expanded_search_bar_height">64dp</dimen> + <dimen name="expanded_search_bar_height_minus">-64dp</dimen> </resources>
\ No newline at end of file diff --git a/java/com/android/dialer/speeddial/res/values/strings.xml b/java/com/android/dialer/speeddial/res/values/strings.xml index 7f8fed51f..397ec8f5e 100644 --- a/java/com/android/dialer/speeddial/res/values/strings.xml +++ b/java/com/android/dialer/speeddial/res/values/strings.xml @@ -71,4 +71,7 @@ <!-- [CHAR LIMIT=NONE] Shown as an action when the all contacts list is empty --> <string name="speed_dial_no_contacts_action_text">Add favorite</string> + + <!-- Text shown on a dragging target that removes the contact from favorites --> + <string name="speed_dial_remove_favorites">Remove from favorites</string> </resources>
\ No newline at end of file |