From 3cdfbdc5b3c90538b49073c3193f400c539c3697 Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Thu, 8 Jun 2023 16:33:15 -0700 Subject: [PATCH] Small tweak to floating search on phone. When you swipe down from all apps back home, the search bar was expanding due to the size being slightly larger when resting on home. However this looks a bit off with the search protection, so created this special case to keep it at the all apps size during this transition. Bug: 261866704 Test: Manual on tablet phone and foldable. Flag: ENABLE_FLOATING_SEARCH_BAR Change-Id: If9399224d0c456629d094139eef7f4d1b2c3bbc9 --- .../allapps/LauncherAllAppsContainerView.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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);