Merge "Fix IME sync flicker with 3-button navigation." into tm-qpr-dev am: 3d69d9bd98

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20175703

Change-Id: I5679849bbf272da9fa66060ac09773cabd55d8d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Luca Zuccarini authored and Automerger Merge Worker committed 2022-11-09 10:52:56 +00:00
commit de9d08fc64
2 files changed
+13 -7

No files matched your search

+3 -4
View File
@@ -482,6 +482,9 @@ public class Launcher extends StatefulActivity<LauncherState>
mOnboardingPrefs = createOnboardingPrefs(mSharedPrefs); mOnboardingPrefs = createOnboardingPrefs(mSharedPrefs);
// TODO: move the SearchConfig to SearchState when new LauncherState is created.
mBaseSearchConfig = new BaseSearchConfig();
mAppWidgetManager = new WidgetManagerHelper(this); mAppWidgetManager = new WidgetManagerHelper(this);
mAppWidgetHolder = createAppWidgetHolder(); mAppWidgetHolder = createAppWidgetHolder();
mAppWidgetHolder.startListening(); mAppWidgetHolder.startListening();
@@ -548,9 +551,6 @@ public class Launcher extends StatefulActivity<LauncherState>
getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_NOTHING); getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
} }
setTitle(R.string.home_screen); setTitle(R.string.home_screen);
// TODO: move the SearchConfig to SearchState when new LauncherState is created.
mBaseSearchConfig = new BaseSearchConfig();
} }
protected LauncherOverlayManager getDefaultOverlay() { protected LauncherOverlayManager getDefaultOverlay() {
@@ -1598,7 +1598,6 @@ public class Launcher extends StatefulActivity<LauncherState>
&& AbstractFloatingView.getTopOpenView(this) == null; && AbstractFloatingView.getTopOpenView(this) == null;
boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction()); boolean isActionMain = Intent.ACTION_MAIN.equals(intent.getAction());
boolean internalStateHandled = ACTIVITY_TRACKER.handleNewIntent(this); boolean internalStateHandled = ACTIVITY_TRACKER.handleNewIntent(this);
hideKeyboard();
if (isActionMain) { if (isActionMain) {
if (!internalStateHandled) { if (!internalStateHandled) {
@@ -141,6 +141,9 @@ public class AllAppsTransitionController
private final Launcher mLauncher; private final Launcher mLauncher;
private boolean mIsVerticalLayout; private boolean mIsVerticalLayout;
// Whether this class should take care of closing the keyboard.
private boolean mShouldControlKeyboard;
// Animation in this class is controlled by a single variable {@link mProgress}. // Animation in this class is controlled by a single variable {@link mProgress}.
// Visually, it represents top y coordinate of the all apps container if multiplied with // Visually, it represents top y coordinate of the all apps container if multiplied with
// {@link mShiftRange}. // {@link mShiftRange}.
@@ -238,7 +241,7 @@ public class AllAppsTransitionController
StateAnimationConfig config, PendingAnimation builder) { StateAnimationConfig config, PendingAnimation builder) {
if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) { if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) {
// For atomic animations, we close the keyboard immediately. // For atomic animations, we close the keyboard immediately.
if (!config.userControlled && !mLauncher.getSearchConfig().isKeyboardSyncEnabled()) { if (!config.userControlled && mShouldControlKeyboard) {
mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
} }
@@ -252,7 +255,7 @@ public class AllAppsTransitionController
// the keyboard open and then changes their mind and swipes back up, we want the // the keyboard open and then changes their mind and swipes back up, we want the
// keyboard to remain open. However an onCancel signal is sent to the listeners // keyboard to remain open. However an onCancel signal is sent to the listeners
// (success = false), so we need to check for that. // (success = false), so we need to check for that.
if (config.userControlled && success) { if (config.userControlled && success && mShouldControlKeyboard) {
mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
} }
}); });
@@ -317,6 +320,8 @@ public class AllAppsTransitionController
mAppsViewAlpha.setUpdateVisibility(true); mAppsViewAlpha.setUpdateVisibility(true);
mAppsViewTranslationY = new MultiPropertyFactory<>( mAppsViewTranslationY = new MultiPropertyFactory<>(
mAppsView, VIEW_TRANSLATE_Y, APPS_VIEW_INDEX_COUNT, Float::sum); mAppsView, VIEW_TRANSLATE_Y, APPS_VIEW_INDEX_COUNT, Float::sum);
mShouldControlKeyboard = !mLauncher.getSearchConfig().isKeyboardSyncEnabled();
} }
/** /**
@@ -333,7 +338,9 @@ public class AllAppsTransitionController
private void onProgressAnimationEnd() { private void onProgressAnimationEnd() {
if (Float.compare(mProgress, 1f) == 0) { if (Float.compare(mProgress, 1f) == 0) {
mAppsView.reset(false /* animate */); mAppsView.reset(false /* animate */);
mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); if (mShouldControlKeyboard) {
mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard();
}
} }
} }
} }