Loading src/com/android/launcher3/ExtendedEditText.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public class ExtendedEditText extends EditText { } public void hideKeyboard() { UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken()); UiThreadHelper.hideKeyboardAsync(Launcher.getLauncher(getContext()), getWindowToken()); } private boolean showSoftInput() { Loading src/com/android/launcher3/util/UiThreadHelper.java +15 −2 Original line number Diff line number Diff line Loading @@ -17,13 +17,18 @@ package com.android.launcher3.util; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.view.WindowInsets; import android.view.inputmethod.InputMethodManager; import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; /** * Utility class for offloading some class from UI thread */ Loading @@ -37,8 +42,16 @@ public class UiThreadHelper { private static final int MSG_SET_ORIENTATION = 2; private static final int MSG_RUN_COMMAND = 3; public static void hideKeyboardAsync(Context context, IBinder token) { Message.obtain(HANDLER.get(context), MSG_HIDE_KEYBOARD, token).sendToTarget(); @SuppressLint("NewApi") public static void hideKeyboardAsync(Launcher launcher, IBinder token) { if (Utilities.ATLEAST_R) { WindowInsets rootInsets = launcher.getRootView().getRootWindowInsets(); boolean isImeShown = rootInsets != null && rootInsets.isVisible( WindowInsets.Type.ime()); if (!isImeShown) return; } Message.obtain(HANDLER.get(launcher), MSG_HIDE_KEYBOARD, token).sendToTarget(); } public static void setOrientationAsync(Activity activity, int orientation) { Loading Loading
src/com/android/launcher3/ExtendedEditText.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public class ExtendedEditText extends EditText { } public void hideKeyboard() { UiThreadHelper.hideKeyboardAsync(getContext(), getWindowToken()); UiThreadHelper.hideKeyboardAsync(Launcher.getLauncher(getContext()), getWindowToken()); } private boolean showSoftInput() { Loading
src/com/android/launcher3/util/UiThreadHelper.java +15 −2 Original line number Diff line number Diff line Loading @@ -17,13 +17,18 @@ package com.android.launcher3.util; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.view.WindowInsets; import android.view.inputmethod.InputMethodManager; import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; /** * Utility class for offloading some class from UI thread */ Loading @@ -37,8 +42,16 @@ public class UiThreadHelper { private static final int MSG_SET_ORIENTATION = 2; private static final int MSG_RUN_COMMAND = 3; public static void hideKeyboardAsync(Context context, IBinder token) { Message.obtain(HANDLER.get(context), MSG_HIDE_KEYBOARD, token).sendToTarget(); @SuppressLint("NewApi") public static void hideKeyboardAsync(Launcher launcher, IBinder token) { if (Utilities.ATLEAST_R) { WindowInsets rootInsets = launcher.getRootView().getRootWindowInsets(); boolean isImeShown = rootInsets != null && rootInsets.isVisible( WindowInsets.Type.ime()); if (!isImeShown) return; } Message.obtain(HANDLER.get(launcher), MSG_HIDE_KEYBOARD, token).sendToTarget(); } public static void setOrientationAsync(Activity activity, int orientation) { Loading