diff options
Diffstat (limited to 'java/com/android/dialer/main/impl')
-rw-r--r-- | java/com/android/dialer/main/impl/NewMainActivityPeer.java | 23 | ||||
-rw-r--r-- | java/com/android/dialer/main/impl/OldMainActivityPeer.java | 23 |
2 files changed, 35 insertions, 11 deletions
diff --git a/java/com/android/dialer/main/impl/NewMainActivityPeer.java b/java/com/android/dialer/main/impl/NewMainActivityPeer.java index 0ab69a443..f2d6fa6d3 100644 --- a/java/com/android/dialer/main/impl/NewMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/NewMainActivityPeer.java @@ -29,7 +29,6 @@ import com.android.dialer.main.MainActivityPeer; import com.android.dialer.main.impl.bottomnav.BottomNavBar; import com.android.dialer.main.impl.bottomnav.BottomNavBar.OnBottomNavTabSelectedListener; import com.android.dialer.main.impl.bottomnav.BottomNavBar.TabIndex; -import com.android.dialer.speeddial.SpeedDialFragment; import com.android.dialer.voicemail.listui.NewVoicemailFragment; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.MoreExecutors; @@ -106,16 +105,18 @@ public class NewMainActivityPeer implements MainActivityPeer { @Override public void onSpeedDialSelected() { hideAllFragments(); - SpeedDialFragment fragment = - (SpeedDialFragment) supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG); - if (fragment == null) { - supportFragmentManager - .beginTransaction() - .add(R.id.fragment_container, SpeedDialFragment.newInstance(), SPEED_DIAL_TAG) - .commit(); - } else { - supportFragmentManager.beginTransaction().show(fragment).commit(); - } + // TODO(calderwoodra): Since we aren't using fragment utils in this peer, let's disable + // speed dial until we figure out a solution. + // SpeedDialFragment fragment = + // (SpeedDialFragment) supportFragmentManager.findFragmentByTag(SPEED_DIAL_TAG); + // if (fragment == null) { + // supportFragmentManager + // .beginTransaction() + // .add(R.id.fragment_container, SpeedDialFragment.newInstance(), SPEED_DIAL_TAG) + // .commit(); + // } else { + // supportFragmentManager.beginTransaction().show(fragment).commit(); + // } } @Override diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java index 1c0cad0b0..9ac351094 100644 --- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java +++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java @@ -183,6 +183,7 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen // Speed Dial private MainOnPhoneNumberPickerActionListener onPhoneNumberPickerActionListener; private MainOldSpeedDialFragmentHost oldSpeedDialFragmentHost; + private MainSpeedDialFragmentHost speedDialFragmentHost; /** Language the device was in last time {@link #onSaveInstanceState(Bundle)} was called. */ private String savedLanguageCode; @@ -293,6 +294,7 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen activity.findViewById(R.id.remove_view), activity.findViewById(R.id.search_view_container), toolbar); + speedDialFragmentHost = new MainSpeedDialFragmentHost(toolbar); lastTabController = new LastTabController(activity, bottomNav, showVoicemailTab); @@ -639,6 +641,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen return (T) oldSpeedDialFragmentHost; } else if (callbackInterface.isInstance(searchController)) { return (T) searchController; + } else if (callbackInterface.isInstance(speedDialFragmentHost)) { + return (T) speedDialFragmentHost; } else { return null; } @@ -1191,6 +1195,25 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen } /** + * Handles the callbacks for {@link SpeedDialFragment}. + * + * @see SpeedDialFragment.HostInterface + */ + private static final class MainSpeedDialFragmentHost implements SpeedDialFragment.HostInterface { + + private final MainToolbar toolbar; + + MainSpeedDialFragmentHost(MainToolbar toolbar) { + this.toolbar = toolbar; + } + + @Override + public void setHasFrequents(boolean hasFrequents) { + toolbar.showClearFrequents(hasFrequents); + } + } + + /** * Implementation of {@link OnBottomNavTabSelectedListener} that handles logic for showing each of * the main tabs and FAB. * |