diff --git a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java index d78e453218..5e48177d75 100644 --- a/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/LauncherAllAppsContainerView.java @@ -102,6 +102,12 @@ public class LauncherAllAppsContainerView extends ActivityAllAppsContainerView stateManager = mActivityContext.getStateManager(); + // Special case to not expand the search bar when exiting All Apps on phones. + if (stateManager.getCurrentStableState() == LauncherState.ALL_APPS + && mActivityContext.getDeviceProfile().isPhone) { + return LauncherState.ALL_APPS.getFloatingSearchBarRestingMarginStart(mActivityContext); + } + if (stateManager.isInTransition() && stateManager.getTargetState() != null) { return stateManager.getTargetState() .getFloatingSearchBarRestingMarginStart(mActivityContext); @@ -118,6 +124,12 @@ public class LauncherAllAppsContainerView extends ActivityAllAppsContainerView stateManager = mActivityContext.getStateManager(); + // Special case to not expand the search bar when exiting All Apps on phones. + if (stateManager.getCurrentStableState() == LauncherState.ALL_APPS + && mActivityContext.getDeviceProfile().isPhone) { + return LauncherState.ALL_APPS.getFloatingSearchBarRestingMarginEnd(mActivityContext); + } + if (stateManager.isInTransition() && stateManager.getTargetState() != null) { return stateManager.getTargetState() .getFloatingSearchBarRestingMarginEnd(mActivityContext);