Merge "Remove IME visibility check before closing the keyboard" into sc-dev am: 9c25a4dd07
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14974657 Change-Id: Icfb1b96ce764fba751774523fddccf860ac2205b
This commit is contained in:
@@ -25,11 +25,9 @@ import android.os.Handler;
|
|||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowInsets;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.Utilities;
|
|
||||||
import com.android.launcher3.views.ActivityContext;
|
import com.android.launcher3.views.ActivityContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,14 +46,6 @@ public class UiThreadHelper {
|
|||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) {
|
public static void hideKeyboardAsync(ActivityContext activityContext, IBinder token) {
|
||||||
View root = activityContext.getDragLayer();
|
View root = activityContext.getDragLayer();
|
||||||
if (Utilities.ATLEAST_R) {
|
|
||||||
WindowInsets rootInsets = root.getRootWindowInsets();
|
|
||||||
boolean isImeShown = rootInsets != null && rootInsets.isVisible(
|
|
||||||
WindowInsets.Type.ime());
|
|
||||||
if (!isImeShown) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Message.obtain(HANDLER.get(root.getContext()),
|
Message.obtain(HANDLER.get(root.getContext()),
|
||||||
MSG_HIDE_KEYBOARD, token).sendToTarget();
|
MSG_HIDE_KEYBOARD, token).sendToTarget();
|
||||||
|
|||||||
Reference in New Issue
Block a user