summaryrefslogtreecommitdiffstats
path: root/src/com/android/dialer/DialtactsActivity.java
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 /src/com/android/dialer/DialtactsActivity.java
parent5a6204880d2fd98a0f887741186ca5f3d16526f7 (diff)
downloadandroid_packages_apps_Dialer-38019af70eb1ca084d36291390bbc54dc81027de.tar.gz
android_packages_apps_Dialer-38019af70eb1ca084d36291390bbc54dc81027de.tar.bz2
android_packages_apps_Dialer-38019af70eb1ca084d36291390bbc54dc81027de.zip
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 'src/com/android/dialer/DialtactsActivity.java')
-rw-r--r--src/com/android/dialer/DialtactsActivity.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 31d1b94bf..85197a530 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -66,6 +66,7 @@ import com.android.contacts.common.util.PermissionsUtil;
import com.android.contacts.common.widget.FloatingActionButtonController;
import com.android.contacts.commonbind.analytics.AnalyticsUtil;
import com.android.dialer.calllog.CallLogActivity;
+import com.android.dialer.calllog.CallLogFragment;
import com.android.dialer.database.DialerDatabaseHelper;
import com.android.dialer.dialpad.DialpadFragment;
import com.android.dialer.dialpad.SmartDialNameMatcher;
@@ -101,6 +102,7 @@ import java.util.List;
public class DialtactsActivity extends TransactionSafeActivity implements View.OnClickListener,
DialpadFragment.OnDialpadQueryChangedListener,
OnListFragmentScrolledListener,
+ CallLogFragment.HostInterface,
ListsFragment.HostInterface,
SpeedDialFragment.HostInterface,
SearchFragment.HostInterface,
@@ -1207,6 +1209,24 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
mListsFragment.getRemoveView().setDragDropController(dragController);
}
+ /**
+ * Implemented to satisfy {@link SpeedDialFragment.HostInterface}
+ */
+ @Override
+ public void showAllContactsTab() {
+ if (mListsFragment != null) {
+ mListsFragment.showTab(ListsFragment.TAB_INDEX_ALL_CONTACTS);
+ }
+ }
+
+ /**
+ * Implemented to satisfy {@link CallLogFragment.HostInterface}
+ */
+ @Override
+ public void showDialpad() {
+ showDialpadFragment(true);
+ }
+
@Override
public void onPickPhoneNumberAction(Uri dataUri) {
// Specify call-origin so that users will see the previous tab instead of
@@ -1322,7 +1342,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
return mActionBarHeight;
}
-
private int getFabAlignment() {
if (!mIsLandscape && !isInSearchUi() &&
mListsFragment.getCurrentTabIndex() == ListsFragment.TAB_INDEX_SPEED_DIAL) {