Removed zero suggest from dialpad search in new search fragment.
Zero suggest in dialpad search clutters the UI and we shouldn't show and search
results until the user has input something into the dialpad.
Additionally, this change ensures the fab stays hidden through device rotation
in regular search.
Bug: 65858825
Test: implemented
PiperOrigin-RevId: 169270161
Change-Id: Ia08ce56ffd02f74ea9e4d9d8a1efc3726fcc66d9
diff --git a/java/com/android/dialer/app/DialtactsActivity.java b/java/com/android/dialer/app/DialtactsActivity.java
index 588f9d7..74bf98d 100644
--- a/java/com/android/dialer/app/DialtactsActivity.java
+++ b/java/com/android/dialer/app/DialtactsActivity.java
@@ -173,6 +173,7 @@
private static final String KEY_FIRST_LAUNCH = "first_launch";
private static final String KEY_WAS_CONFIGURATION_CHANGE = "was_configuration_change";
private static final String KEY_IS_DIALPAD_SHOWN = "is_dialpad_shown";
+ private static final String KEY_FAB_VISIBLE = "fab_visible";
private static final String TAG_NEW_SEARCH_FRAGMENT = "new_search";
private static final String TAG_REGULAR_SEARCH_FRAGMENT = "search";
private static final String TAG_SMARTDIAL_SEARCH_FRAGMENT = "smartdial";
@@ -435,6 +436,7 @@
mFirstLaunch = savedInstanceState.getBoolean(KEY_FIRST_LAUNCH);
mWasConfigurationChange = savedInstanceState.getBoolean(KEY_WAS_CONFIGURATION_CHANGE);
mShowDialpadOnResume = savedInstanceState.getBoolean(KEY_IS_DIALPAD_SHOWN);
+ mFloatingActionButtonController.setVisible(savedInstanceState.getBoolean(KEY_FAB_VISIBLE));
mActionBarController.restoreInstanceState(savedInstanceState);
}
@@ -629,6 +631,7 @@
outState.putBoolean(KEY_IN_NEW_SEARCH_UI, mInNewSearch);
outState.putBoolean(KEY_FIRST_LAUNCH, mFirstLaunch);
outState.putBoolean(KEY_IS_DIALPAD_SHOWN, mIsDialpadShown);
+ outState.putBoolean(KEY_FAB_VISIBLE, mFloatingActionButtonController.isVisible());
outState.putBoolean(KEY_WAS_CONFIGURATION_CHANGE, isChangingConfigurations());
mActionBarController.saveInstanceState(outState);
mStateSaved = true;
@@ -1180,7 +1183,7 @@
Fragment fragment = getFragmentManager().findFragmentByTag(tag);
if (fragment == null) {
if (useNewSearch) {
- fragment = new NewSearchFragment();
+ fragment = NewSearchFragment.newInstance(!isDialpadShown());
} else if (smartDialSearch) {
fragment = new SmartDialSearchFragment();
} else {