Loading src/com/android/launcher3/Launcher.java +7 −6 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ import com.android.launcher3.allapps.AllAppsRecyclerView; import com.android.launcher3.allapps.AllAppsStore; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.BaseAllAppsContainerView; import com.android.launcher3.allapps.BaseSearchConfig; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.compat.AccessibilityManagerCompat; Loading Loading @@ -395,6 +396,7 @@ public class Launcher extends StatefulActivity<LauncherState> private LauncherState mPrevLauncherState; private StringCache mStringCache; private BaseSearchConfig mBaseSearchConfig; @Override @TargetApi(Build.VERSION_CODES.S) Loading Loading @@ -545,6 +547,9 @@ public class Launcher extends StatefulActivity<LauncherState> getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_NOTHING); } setTitle(R.string.home_screen); // TODO: move the SearchConfig to SearchState when new LauncherState is created. mBaseSearchConfig = new BaseSearchConfig(); } protected LauncherOverlayManager getDefaultOverlay() { Loading Loading @@ -1592,12 +1597,8 @@ public class Launcher extends StatefulActivity<LauncherState> return mOldConfig.orientation; } /** * Whether keyboard sync is enabled for transitions between Home and All Apps. * TODO(b/251387263): move this method inside an All Apps specific config class. */ public boolean isKeyboardSyncEnabled() { return false; public BaseSearchConfig getSearchConfig() { return mBaseSearchConfig; } @Override Loading src/com/android/launcher3/allapps/AllAppsTransitionController.java +1 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ public class AllAppsTransitionController StateAnimationConfig config, PendingAnimation builder) { if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) { // For atomic animations, we close the keyboard immediately. if (!config.userControlled && !mLauncher.isKeyboardSyncEnabled()) { if (!config.userControlled && !mLauncher.getSearchConfig().isKeyboardSyncEnabled()) { mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); } Loading src/com/android/launcher3/allapps/BaseSearchConfig.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.allapps; /** Base config values for search. */ public class BaseSearchConfig { public BaseSearchConfig() {} /** * Returns whether to enable the synchronized keyboard transition between Home and All Apps. */ public boolean isKeyboardSyncEnabled() { return false; } } Loading
src/com/android/launcher3/Launcher.java +7 −6 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ import com.android.launcher3.allapps.AllAppsRecyclerView; import com.android.launcher3.allapps.AllAppsStore; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.BaseAllAppsContainerView; import com.android.launcher3.allapps.BaseSearchConfig; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.compat.AccessibilityManagerCompat; Loading Loading @@ -395,6 +396,7 @@ public class Launcher extends StatefulActivity<LauncherState> private LauncherState mPrevLauncherState; private StringCache mStringCache; private BaseSearchConfig mBaseSearchConfig; @Override @TargetApi(Build.VERSION_CODES.S) Loading Loading @@ -545,6 +547,9 @@ public class Launcher extends StatefulActivity<LauncherState> getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_ADJUST_NOTHING); } setTitle(R.string.home_screen); // TODO: move the SearchConfig to SearchState when new LauncherState is created. mBaseSearchConfig = new BaseSearchConfig(); } protected LauncherOverlayManager getDefaultOverlay() { Loading Loading @@ -1592,12 +1597,8 @@ public class Launcher extends StatefulActivity<LauncherState> return mOldConfig.orientation; } /** * Whether keyboard sync is enabled for transitions between Home and All Apps. * TODO(b/251387263): move this method inside an All Apps specific config class. */ public boolean isKeyboardSyncEnabled() { return false; public BaseSearchConfig getSearchConfig() { return mBaseSearchConfig; } @Override Loading
src/com/android/launcher3/allapps/AllAppsTransitionController.java +1 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,7 @@ public class AllAppsTransitionController StateAnimationConfig config, PendingAnimation builder) { if (mLauncher.isInState(ALL_APPS) && !ALL_APPS.equals(toState)) { // For atomic animations, we close the keyboard immediately. if (!config.userControlled && !mLauncher.isKeyboardSyncEnabled()) { if (!config.userControlled && !mLauncher.getSearchConfig().isKeyboardSyncEnabled()) { mLauncher.getAppsView().getSearchUiManager().getEditText().hideKeyboard(); } Loading
src/com/android/launcher3/allapps/BaseSearchConfig.java 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.allapps; /** Base config values for search. */ public class BaseSearchConfig { public BaseSearchConfig() {} /** * Returns whether to enable the synchronized keyboard transition between Home and All Apps. */ public boolean isKeyboardSyncEnabled() { return false; } }