Dismiss keyboard when leaving AllApps state

Fix: 221024791
Test: Launcher3 dismiss keyboard when leaving AllApps
Test: NexusLauncher can still open keyboard automatically in AllApps
Change-Id: I61b50e3fc4c6ed83bd5234c5daef3b2cb428b520
This commit is contained in:
Alex Chau
2022-04-13 18:48:23 +01:00
parent fed1182660
commit 59120581e4

View File

@@ -44,6 +44,7 @@ import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.statemanager.StateManager.StateHandler;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.UiThreadHelper;
import com.android.launcher3.views.ScrimView;
/**
@@ -151,6 +152,10 @@ public class AllAppsTransitionController
@Override
public void setStateWithAnimation(LauncherState toState,
StateAnimationConfig config, PendingAnimation builder) {
if (NORMAL.equals(toState) && mLauncher.isInState(ALL_APPS)) {
UiThreadHelper.hideKeyboardAsync(mLauncher, mLauncher.getAppsView().getWindowToken());
}
float targetProgress = toState.getVerticalProgress(mLauncher);
if (Float.compare(mProgress, targetProgress) == 0) {
setAlphas(toState, config, builder);