Revert "Put the "floating" in ENABLE_FLOATING_SEARCH_BAR."

Revert submission 23624636-draglayer-inline-qsb

Reason for revert: b/287172381

Reverted changes: /q/submissionid:23624636-draglayer-inline-qsb
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:92784b5bf646e2fd872f693839319849d08659d2)
Merged-In: Ie4f9606baa724f543f034e0d5ca7ac4aa07bf747
Change-Id: Ie4f9606baa724f543f034e0d5ca7ac4aa07bf747
This commit is contained in:
Neha Jain
2023-06-14 17:45:18 +00:00
committed by Android Build Coastguard Worker
parent 7a87d59813
commit 996bfae0b2
19 changed files with 75 additions and 275 deletions
@@ -22,7 +22,6 @@ import android.view.WindowInsets;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.statemanager.StateManager;
/**
* AllAppsContainerView with launcher specific callbacks
@@ -54,43 +53,4 @@ public class LauncherAllAppsContainerView extends ActivityAllAppsContainerView<L
public boolean isInAllApps() {
return mActivityContext.getStateManager().isInStableState(LauncherState.ALL_APPS);
}
@Override
public boolean shouldFloatingSearchBarBePillWhenUnfocused() {
if (!isSearchBarFloating()) {
return false;
}
Launcher launcher = mActivityContext;
StateManager<LauncherState> manager = launcher.getStateManager();
if (manager.isInTransition() && manager.getTargetState() != null) {
return manager.getTargetState().shouldFloatingSearchBarUsePillWhenUnfocused(launcher);
}
return manager.getCurrentStableState()
.shouldFloatingSearchBarUsePillWhenUnfocused(launcher);
}
@Override
public int getFloatingSearchBarRestingMarginBottom() {
if (!isSearchBarFloating()) {
return super.getFloatingSearchBarRestingMarginBottom();
}
Launcher launcher = mActivityContext;
StateManager<LauncherState> stateManager = launcher.getStateManager();
// We want to rest at the current state's resting position, unless we are in transition and
// the target state's resting position is higher (that way if we are closing the keyboard,
// we can stop translating at that point).
int currentStateMarginBottom = stateManager.getCurrentStableState()
.getFloatingSearchBarRestingMarginBottom(launcher);
int targetStateMarginBottom = -1;
if (stateManager.isInTransition() && stateManager.getTargetState() != null) {
targetStateMarginBottom = stateManager.getTargetState()
.getFloatingSearchBarRestingMarginBottom(launcher);
if (targetStateMarginBottom < 0) {
// Go ahead and move offscreen.
return targetStateMarginBottom;
}
}
return Math.max(targetStateMarginBottom, currentStateMarginBottom);
}
}