summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2015-07-14 17:05:38 -0700
committerYorke Lee <yorkelee@google.com>2015-07-15 11:36:54 -0700
commit38019af70eb1ca084d36291390bbc54dc81027de (patch)
tree36753e132aa81fda9c61244e1882ce63e9a52a94 /res
parent5a6204880d2fd98a0f887741186ca5f3d16526f7 (diff)
Update Dialer UI to prompt for permissions
First pass at adding functionality to Dialer to prompt for permissions. Also updates the UI for various fragments when there are no contacts/calls available to unify the UI with the new UI for the permissions denied state. * Refactor existing empty view functionality and encapsulate into a new custom view class * Add action buttons to existing empty views in various fragments -> Speed Dial (Add to favorites) - scrolls to all contacts fragment -> Recents (Make a call) - shows dialpad -> All contacts (Add a contact) - Launches add contact dialog * Add functionality to various fragments to detect if permissions are denied, and request the permission when the action button is pressed. -> Speed Dial (request for contacts permission) -> Call Log (request for phone permission) -> All contacts (request for contacts permission) * Remove now unneeded EmptyContactsListAdapter Remaining issues (to be addressed in a follow up CL to avoid bloating this CL): UI alignment tweaks for empty view to match mocks If the read contacts permission is requested from the speed dial screen, the all contacts fragment doesn't update with the list of contacts until restarted. Bug: 22174668 Change-Id: I70721914bb9b32910d746de288ccac049749e42e
Diffstat (limited to 'res')
-rw-r--r--res/layout/call_log_fragment.xml3
-rw-r--r--res/layout/empty_content_view.xml (renamed from res/layout/empty_list_view.xml)28
-rw-r--r--res/layout/show_all_contacts_fragment.xml3
-rw-r--r--res/layout/speed_dial_fragment.xml3
-rw-r--r--res/values/styles.xml10
5 files changed, 28 insertions, 19 deletions
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
index 68e306074..3a7013d57 100644
--- a/res/layout/call_log_fragment.xml
+++ b/res/layout/call_log_fragment.xml
@@ -27,11 +27,10 @@
android:paddingStart="@dimen/call_log_horizontal_margin"
android:paddingEnd="@dimen/call_log_horizontal_margin" />
- <include
+ <com.android.dialer.widget.EmptyContentView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- layout="@layout/empty_list_view"
android:visibility="gone" />
</FrameLayout>
diff --git a/res/layout/empty_list_view.xml b/res/layout/empty_content_view.xml
index 7f961a350..18633d0f9 100644
--- a/res/layout/empty_list_view.xml
+++ b/res/layout/empty_content_view.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2012 The Android Open Source Project
+<!-- Copyright (C) 2015 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,15 +13,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingTop="@dimen/empty_list_message_top_padding"
- android:paddingBottom="@dimen/actionbar_and_tab_height"
- android:minHeight="?android:attr/listPreferredItemHeight">
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/emptyListViewImage"
android:layout_height="wrap_content"
@@ -39,4 +32,19 @@
android:paddingRight="16dp"
android:paddingLeft="16dp" />
-</LinearLayout>
+ <TextView
+ android:id="@+id/emptyListViewAction"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:layout_gravity="center_horizontal"
+ android:paddingRight="16dp"
+ android:paddingLeft="16dp"
+ android:paddingTop="8dp"
+ android:paddingBottom="8dp"
+ android:text="@string/permission_single_turn_on"
+ android:background="?android:attr/selectableItemBackground"
+ android:clickable="true"
+ style="@style/TextActionStyle" />
+
+</merge>
diff --git a/res/layout/show_all_contacts_fragment.xml b/res/layout/show_all_contacts_fragment.xml
index 00358dc47..3b501fb88 100644
--- a/res/layout/show_all_contacts_fragment.xml
+++ b/res/layout/show_all_contacts_fragment.xml
@@ -44,11 +44,10 @@
android:nestedScrollingEnabled="true" />
</FrameLayout>
- <include
+ <com.android.dialer.widget.EmptyContentView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- layout="@layout/empty_list_view"
android:visibility="gone"/>
</LinearLayout>
diff --git a/res/layout/speed_dial_fragment.xml b/res/layout/speed_dial_fragment.xml
index 18820497e..55dd158d2 100644
--- a/res/layout/speed_dial_fragment.xml
+++ b/res/layout/speed_dial_fragment.xml
@@ -41,11 +41,10 @@
android:nestedScrollingEnabled="true" />
</FrameLayout>
- <include
+ <com.android.dialer.widget.EmptyContentView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- layout="@layout/empty_list_view"
android:visibility="gone"/>
</FrameLayout>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 957fabf86..e3a2f9974 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -218,20 +218,24 @@
<item name="cardBackgroundColor">@color/background_dialer_call_log_list_item</item>
</style>
- <style name="PromoCardActionStyle">
+ <style name="TextActionStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">@dimen/call_log_action_height</item>
<item name="android:gravity">end|center_vertical</item>
<item name="android:paddingStart">@dimen/call_log_action_horizontal_padding</item>
<item name="android:paddingEnd">@dimen/call_log_action_horizontal_padding</item>
- <item name="android:textColor">@color/promo_card_text</item>
- <item name="android:textSize">@dimen/call_log_list_item_actions_text_size</item>
+ <item name="android:textColor">@color/dialtacts_theme_color</item>
<item name="android:fontFamily">"sans-serif-medium"</item>
<item name="android:focusable">true</item>
<item name="android:singleLine">true</item>
<item name="android:textAllCaps">true</item>
</style>
+ <style name="PromoCardActionStyle" parent="TextActionStyle">
+ <item name="android:textColor">@color/promo_card_text</item>
+ <item name="android:textSize">@dimen/call_log_list_item_actions_text_size</item>
+ </style>
+
<style name="VoicemailPlaybackLayoutTextStyle">
<item name="android:textSize">14sp</item>
</style>