From 38019af70eb1ca084d36291390bbc54dc81027de Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 14 Jul 2015 17:05:38 -0700 Subject: 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 --- res/layout/call_log_fragment.xml | 3 +- res/layout/empty_content_view.xml | 50 +++++++++++++++++++++++++++++++ res/layout/empty_list_view.xml | 42 -------------------------- res/layout/show_all_contacts_fragment.xml | 3 +- res/layout/speed_dial_fragment.xml | 3 +- res/values/styles.xml | 10 +++++-- 6 files changed, 60 insertions(+), 51 deletions(-) create mode 100644 res/layout/empty_content_view.xml delete mode 100644 res/layout/empty_list_view.xml (limited to 'res') 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" /> - diff --git a/res/layout/empty_content_view.xml b/res/layout/empty_content_view.xml new file mode 100644 index 000000000..18633d0f9 --- /dev/null +++ b/res/layout/empty_content_view.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + diff --git a/res/layout/empty_list_view.xml b/res/layout/empty_list_view.xml deleted file mode 100644 index 7f961a350..000000000 --- a/res/layout/empty_list_view.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - 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" /> - 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" /> - 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 @@ @color/background_dialer_call_log_list_item - + + -- cgit v1.2.3