diff options
author | Cole Faust <colefaust@google.com> | 2019-06-27 10:43:17 -0700 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2019-07-15 11:20:52 -0700 |
commit | 9252974cd7107c88a3568043524de8bc2831fdc7 (patch) | |
tree | faaae7b9a61a38b3ff51613e201689ba2fba2ddd /res | |
parent | c895b9b14bbd9063a8c37f8f32791c062484157b (diff) | |
download | platform_packages_apps_Car_Dialer-9252974cd7107c88a3568043524de8bc2831fdc7.tar.gz platform_packages_apps_Car_Dialer-9252974cd7107c88a3568043524de8bc2831fdc7.tar.bz2 platform_packages_apps_Car_Dialer-9252974cd7107c88a3568043524de8bc2831fdc7.zip |
Implement the favorite picker page.
This lets you search for a contact and then select favorites to add
from a dialog with a list of phone numbers. Currently the numbers
already added as a favorite are not filtered out. And the actual
functionality to add a favorite isn't there yet.
Bug: 135949998
Test: Manually
Change-Id: Id20ab5e5d89f2e544cb73801ac52db7caa7c76e2
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/phone_number_favorite_list_item.xml | 56 | ||||
-rw-r--r-- | res/values/dimens.xml | 1 | ||||
-rw-r--r-- | res/values/strings.xml | 4 |
3 files changed, 61 insertions, 0 deletions
diff --git a/res/layout/phone_number_favorite_list_item.xml b/res/layout/phone_number_favorite_list_item.xml new file mode 100644 index 00000000..94cb81ee --- /dev/null +++ b/res/layout/phone_number_favorite_list_item.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 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. +--> +<androidx.constraintlayout.widget.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingStart="?android:listPreferredItemPaddingStart" + android:paddingEnd="?android:listPreferredItemPaddingEnd" + android:paddingTop="@dimen/phone_number_favorite_list_item_vertical_padding" + android:paddingBottom="@dimen/phone_number_favorite_list_item_vertical_padding"> + + <TextView + android:id="@+id/phone_number" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_toEndOf="@id/phone_number_checkbox" + android:textAppearance="?android:attr/textAppearanceMedium" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toTopOf="@id/phone_number_description" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintVertical_chainStyle="packed"/> + <TextView + android:id="@+id/phone_number_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/phone_number" + android:layout_toEndOf="@id/phone_number_checkbox" + android:textAppearance="?android:attr/textAppearanceSmall" + app:layout_constraintTop_toBottomOf="@id/phone_number" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent"/> + <ImageView + android:id="@+id/phone_number_checkbox" + android:src="@drawable/ic_favorite_activatable" + android:layout_width="@dimen/primary_icon_size" + android:layout_height="@dimen/primary_icon_size" + android:tint="@color/primary_icon_color" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent"/> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2a9f5c42..20a8ed40 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -139,6 +139,7 @@ <dimen name="contact_avatar_corner_radius_percent" format="float">0.5</dimen> <dimen name="touch_target_width">156dp</dimen> <dimen name="phone_number_radio_list_padding">@*android:dimen/car_padding_2</dimen> + <dimen name="phone_number_favorite_list_item_vertical_padding">@*android:dimen/car_padding_2</dimen> <!-- Toolbar --> <!-- Half of the difference between car_margin and touch_target_size--> diff --git a/res/values/strings.xml b/res/values/strings.xml index bc7996ab..4b48392e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -69,6 +69,10 @@ <string name="add_favorite_button">Add a favorite</string> <!-- Error message shown when on the favorites page without any favorites added [CHAR_LIMIT=80] --> <string name="favorites_empty">You haven\'t added any favorites yet</string> + <!-- Button to cancel the dialog where you pick a phone number to add as a favorite [CHAR_LIMIT=30] --> + <string name="cancel_add_favorites_dialog">@android:string/cancel</string> + <!-- Button to confirm the dialog where you pick a phone number to add as a favorite [CHAR_LIMIT=30] --> + <string name="confirm_add_favorites_dialog">@android:string/ok</string> <!-- Keypad strings--> <string name="one" translatable="false">1</string> |