diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-04-12 20:36:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-04-12 20:36:47 +0000 |
commit | b5f075b9f77c76143621372cd46c47f28c6795e3 (patch) | |
tree | 8d5b5d5f7bb82804b6fb77141e90742556b08fe7 /java | |
parent | 165dc1de6528e0648034f1c495b6f63ae39acfef (diff) | |
parent | 1851d95dcfcf9c8885042add361855110cf65071 (diff) |
Merge "Add SpeedDialFragment to the old peer."
Diffstat (limited to 'java')
-rw-r--r-- | java/com/android/dialer/main/impl/OldMainActivityPeer.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java index d2a6fd8a4..1c0cad0b0 100644 --- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java @@ -106,6 +106,7 @@ import com.android.dialer.postcall.PostCall; import com.android.dialer.precall.PreCall; import com.android.dialer.searchfragment.list.NewSearchFragment.SearchFragmentListener; import com.android.dialer.smartdial.util.SmartDialPrefix; +import com.android.dialer.speeddial.SpeedDialFragment; import com.android.dialer.storage.StorageComponent; import com.android.dialer.telecom.TelecomUtil; import com.android.dialer.util.DialerUtils; @@ -1230,8 +1231,17 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen } Logger.get(activity).logScreenView(ScreenEvent.Type.MAIN_SPEED_DIAL, activity); selectedTab = TabIndex.SPEED_DIAL; - Fragment fragment = fragmentManager.findFragmentByTag(SPEED_DIAL_TAG); - showFragment(fragment == null ? new OldSpeedDialFragment() : fragment, SPEED_DIAL_TAG); + + if (ConfigProviderBindings.get(activity).getBoolean("enable_new_favorites_tab", false)) { + android.support.v4.app.Fragment supportFragment = + supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG); + showSupportFragment( + supportFragment == null ? SpeedDialFragment.newInstance() : supportFragment, + SPEED_DIAL_TAG); + } else { + Fragment fragment = fragmentManager.findFragmentByTag(SPEED_DIAL_TAG); + showFragment(fragment == null ? new OldSpeedDialFragment() : fragment, SPEED_DIAL_TAG); + } fab.show(); } @@ -1390,13 +1400,13 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen @Nullable android.support.v4.app.Fragment supportFragment, String tag) { LogUtil.enterBlock("MainBottomNavBarBottomNavTabListener.showFragment"); - Fragment speedDial = fragmentManager.findFragmentByTag(SPEED_DIAL_TAG); + Fragment oldSpeedDial = fragmentManager.findFragmentByTag(SPEED_DIAL_TAG); Fragment oldCallLog = fragmentManager.findFragmentByTag(CALL_LOG_TAG); Fragment contacts = fragmentManager.findFragmentByTag(CONTACTS_TAG); Fragment oldVoicemail = fragmentManager.findFragmentByTag(VOICEMAIL_TAG); FragmentTransaction transaction = fragmentManager.beginTransaction(); - boolean fragmentShown = showIfEqualElseHide(transaction, fragment, speedDial); + boolean fragmentShown = showIfEqualElseHide(transaction, fragment, oldSpeedDial); fragmentShown |= showIfEqualElseHide(transaction, fragment, oldCallLog); fragmentShown |= showIfEqualElseHide(transaction, fragment, contacts); fragmentShown |= showIfEqualElseHide(transaction, fragment, oldVoicemail); @@ -1410,6 +1420,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen // Handle support fragments. // TODO(calderwoodra): Handle other new fragments. + android.support.v4.app.Fragment speedDial = + supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG); android.support.v4.app.Fragment newCallLog = supportFragmentManager.findFragmentByTag(CALL_LOG_TAG); android.support.v4.app.Fragment newVoicemail = @@ -1418,6 +1430,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen android.support.v4.app.FragmentTransaction supportTransaction = supportFragmentManager.beginTransaction(); boolean supportFragmentShown = + showIfEqualElseHideSupport(supportTransaction, supportFragment, speedDial); + supportFragmentShown |= showIfEqualElseHideSupport(supportTransaction, supportFragment, newCallLog); supportFragmentShown |= showIfEqualElseHideSupport(supportTransaction, supportFragment, newVoicemail); |