From 9873647e903574ee4ef62b2f13633650793c346e Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Thu, 30 Nov 2017 15:21:47 -0800 Subject: Implemented new favorites list UI. Bug: 36841782 Test: implemented PiperOrigin-RevId: 177516412 Change-Id: If9478ce22c10fd17e352d5fdcc2c0bef5e14a6d8 --- java/com/android/dialer/app/DialtactsActivity.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/app') 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 enabled) { sVoiceSearchEnabledForTest = enabled; } + + private boolean newFavoritesIsEnabled() { + return ConfigProviderBindings.get(this).getBoolean("enable_new_favorites_tab", false); + } } -- cgit v1.2.3