summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2019-06-20 15:41:50 -0700
committerCole Faust <colefaust@google.com>2019-06-24 14:37:23 -0700
commitbe536fea8399fd2ef7f9c75a692f7bb9e7c9daaf (patch)
tree024e9f16d71161377c054f143322db5371d3d2fe /res
parentd4cd644f3189ee57700d89ec29db00485de48199 (diff)
downloadplatform_packages_apps_Car_Dialer-be536fea8399fd2ef7f9c75a692f7bb9e7c9daaf.tar.gz
platform_packages_apps_Car_Dialer-be536fea8399fd2ef7f9c75a692f7bb9e7c9daaf.tar.bz2
platform_packages_apps_Car_Dialer-be536fea8399fd2ef7f9c75a692f7bb9e7c9daaf.zip
Create a page for when you don't have any favorites
Fixes: 135639094 Test: Manually Change-Id: Idd5fc0bb121ff43a3c7485dd6227c6b6bfe27c9d
Diffstat (limited to 'res')
-rw-r--r--res/layout/favorite_fragment.xml55
-rw-r--r--res/values/dimens.xml2
-rw-r--r--res/values/strings.xml2
3 files changed, 59 insertions, 0 deletions
diff --git a/res/layout/favorite_fragment.xml b/res/layout/favorite_fragment.xml
new file mode 100644
index 00000000..f21bc489
--- /dev/null
+++ b/res/layout/favorite_fragment.xml
@@ -0,0 +1,55 @@
+<?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.
+ -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <fragment
+ android:id="@+id/favorite_list_fragment"
+ android:name="com.android.car.dialer.ui.favorite.FavoriteListFragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"/>
+
+ <LinearLayout
+ android:id="@+id/empty_page_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:text="@string/favorites_empty"
+ android:layout_marginBottom="@dimen/favorite_add_button_and_text_separation"/>
+
+ <TextView
+ android:id="@+id/add_favorite_button"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/touch_target_size"
+ android:text="@string/add_favorite_button"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:background="@drawable/hero_button_background"
+ android:paddingStart="@dimen/favorite_add_button_padding"
+ android:paddingEnd="@dimen/favorite_add_button_padding"
+ android:gravity="center"/>
+
+ </LinearLayout>
+
+</FrameLayout> \ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1e5ab955..222e11b3 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -87,6 +87,8 @@
<dimen name="favorite_card_space_horizontal">@*android:dimen/car_padding_3</dimen>
<dimen name="favorite_card_space_vertical">@*android:dimen/car_padding_4</dimen>
<dimen name="favorites_avatar_margin_bottom">@*android:dimen/car_padding_3</dimen>
+ <dimen name="favorite_add_button_and_text_separation">@*android:dimen/car_padding_5</dimen>
+ <dimen name="favorite_add_button_padding">@*android:dimen/car_padding_4</dimen>
<dimen name="call_fab_elevation">8dp</dimen>
<dimen name="bksp_button_width">@dimen/touch_target_size</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f6823d8f..554c5f9a 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -79,6 +79,8 @@
<!-- Button to add start choosing a contact to add as a new favorite [CHAR_LIMIT=50] -->
<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>
<!-- Keypad strings-->
<string name="one" translatable="false">1</string>