summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2017-11-30 15:21:47 -0800
committerCopybara-Service <copybara-piper@google.com>2017-11-30 17:17:09 -0800
commit9873647e903574ee4ef62b2f13633650793c346e (patch)
tree8446501d66585a2910fdb1677a8e4e02ee400662 /java/com/android/dialer/app
parent71eae26ab4f9a8eaab16271edf63476762e28f75 (diff)
Implemented new favorites list UI.
Bug: 36841782 Test: implemented PiperOrigin-RevId: 177516412 Change-Id: If9478ce22c10fd17e352d5fdcc2c0bef5e14a6d8
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r--java/com/android/dialer/app/DialtactsActivity.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java
index 9144fc939..2d82b6f33 100644
--- a/java/com/android/dialer/app/DialtactsActivity.java
+++ b/java/com/android/dialer/app/DialtactsActivity.java
@@ -1555,6 +1555,10 @@ public class DialtactsActivity extends TransactionSafeActivity
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ // FAB does not move with the new favorites UI
+ if (newFavoritesIsEnabled()) {
+ return;
+ }
int tabIndex = mListsFragment.getCurrentTabIndex();
// Scroll the button from center to end when moving from the Speed Dial to Call History tab.
@@ -1615,7 +1619,8 @@ public class DialtactsActivity extends TransactionSafeActivity
@VisibleForTesting
public int getFabAlignment() {
- if (!mIsLandscape
+ if (!newFavoritesIsEnabled()
+ && !mIsLandscape
&& !isInSearchUi()
&& mListsFragment.getCurrentTabIndex() == DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL) {
return FloatingActionButtonController.ALIGN_MIDDLE;
@@ -1746,4 +1751,8 @@ public class DialtactsActivity extends TransactionSafeActivity
static void setVoiceSearchEnabledForTest(Optional<Boolean> enabled) {
sVoiceSearchEnabledForTest = enabled;
}
+
+ private boolean newFavoritesIsEnabled() {
+ return ConfigProviderBindings.get(this).getBoolean("enable_new_favorites_tab", false);
+ }
}