diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5dc7f934a..901a9b278 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -365,6 +365,8 @@ public class Launcher extends Activity private boolean mUseScrubber = true; + private boolean mIsDrawerSearchBarEnabled; + // This is set to the view that launched the activity that navigated the user away from // launcher. Since there is no callback for when the activity has finished launching, enable // the press state and keep this reference to reset the press state when we return to launcher. @@ -5154,18 +5156,25 @@ public class Launcher extends Activity } private void setupSearchBar(Context context) { - boolean isDrawerSearchBarEnabled = SettingsProvider.getBoolean(context, + mIsDrawerSearchBarEnabled = SettingsProvider.getBoolean(context, SettingsProvider.SETTINGS_UI_DRAWER_SEARCH, R.bool.preferences_interface_homescreen_search_default); - if (mLauncherCallbacks != null && mLauncherCallbacks.getAllAppsSearchBarController() != null) { - mAppsView.setSearchBarController(mLauncherCallbacks.getAllAppsSearchBarController()); + if (mIsDrawerSearchBarEnabled) { + if (mLauncherCallbacks != null + && mLauncherCallbacks.getAllAppsSearchBarController() != null) { + mAppsView + .setSearchBarController(mLauncherCallbacks.getAllAppsSearchBarController()); + } else { + mAppsView.setSearchBarController(mAppsView.newDefaultAppSearchController()); + } } else { - mAppsView.setSearchBarController(mAppsView.newDefaultAppSearchController()); + mAppsView.setSearchBarController(null); + mAppsView.setHasSearchBar(mIsDrawerSearchBarEnabled); + mAppsView.setSearchBarContainerViewVisibility( + mIsDrawerSearchBarEnabled ? View.VISIBLE : View.GONE); + mAppsView.updateBackgroundAndPaddings(); } - mAppsView.setHasSearchBar(isDrawerSearchBarEnabled); - mAppsView.setSearchBarContainerViewVisibility( - isDrawerSearchBarEnabled ? View.VISIBLE : View.GONE); } class SettingsPanelSlideListener extends VerticalSlidingPanel.SimplePanelSlideListener { |