mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Merge "Use config_imeDrawsImeNavBar in Launcher"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b70131e1dd
@@ -176,7 +176,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
||||
|
||||
boolean isThreeButtonNav = mContext.isThreeButtonNav();
|
||||
mIsImeRenderingNavButtons =
|
||||
InputMethodService.canImeRenderGesturalNavButtons() && mContext.isGestureNav();
|
||||
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
|
||||
if (!mIsImeRenderingNavButtons) {
|
||||
// IME switcher
|
||||
View imeSwitcherButton = addButton(R.drawable.ic_ime_switcher, BUTTON_IME_SWITCH,
|
||||
|
||||
@@ -115,6 +115,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
private int mLastRequestedNonFullscreenHeight;
|
||||
|
||||
private final SysUINavigationMode.Mode mNavMode;
|
||||
private final boolean mImeDrawsImeNavBar;
|
||||
private final ViewCache mViewCache = new ViewCache();
|
||||
|
||||
private final boolean mIsSafeModeEnabled;
|
||||
@@ -133,6 +134,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
mDeviceProfile = dp;
|
||||
|
||||
mNavMode = SysUINavigationMode.getMode(windowContext);
|
||||
mImeDrawsImeNavBar = SysUINavigationMode.getImeDrawsImeNavBar(windowContext);
|
||||
mIsSafeModeEnabled = TraceHelper.allowIpcs("isSafeMode",
|
||||
() -> getPackageManager().isSafeMode());
|
||||
mIsUserSetupComplete = SettingsCache.INSTANCE.get(this).getValue(
|
||||
@@ -270,6 +272,10 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
return mNavMode == Mode.NO_BUTTON;
|
||||
}
|
||||
|
||||
public boolean imeDrawsImeNavBar() {
|
||||
return mImeDrawsImeNavBar;
|
||||
}
|
||||
|
||||
public int getLeftCornerRadius() {
|
||||
return mLeftCorner == null ? 0 : mLeftCorner.getRadius();
|
||||
}
|
||||
@@ -726,6 +732,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
|
||||
pw.println(String.format(
|
||||
"%s\tmNavMode=%s", prefix, mNavMode));
|
||||
pw.println(String.format(
|
||||
"%s\tmImeDrawsImeNavBar=%b", prefix, mImeDrawsImeNavBar));
|
||||
pw.println(String.format(
|
||||
"%s\tmIsUserSetupComplete=%b", prefix, mIsUserSetupComplete));
|
||||
pw.println(String.format(
|
||||
|
||||
@@ -60,17 +60,22 @@ public class SysUINavigationMode {
|
||||
return INSTANCE.get(context).getMode();
|
||||
}
|
||||
|
||||
public static boolean getImeDrawsImeNavBar(Context context) {
|
||||
return INSTANCE.get(context).getImeDrawsImeNavBar();
|
||||
}
|
||||
|
||||
public static final MainThreadInitializedObject<SysUINavigationMode> INSTANCE =
|
||||
new MainThreadInitializedObject<>(SysUINavigationMode::new);
|
||||
|
||||
private static final String TAG = "SysUINavigationMode";
|
||||
private static final String ACTION_OVERLAY_CHANGED = "android.intent.action.OVERLAY_CHANGED";
|
||||
private static final String NAV_BAR_INTERACTION_MODE_RES_NAME =
|
||||
"config_navBarInteractionMode";
|
||||
private static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode";
|
||||
private static final String IME_DRAWS_IME_NAV_BAR_RES_NAME = "config_imeDrawsImeNavBar";
|
||||
private static final String TARGET_OVERLAY_PACKAGE = "android";
|
||||
|
||||
private final Context mContext;
|
||||
private Mode mMode;
|
||||
private boolean mImeDrawsImeNavBar;
|
||||
|
||||
private int mNavBarGesturalHeight;
|
||||
private int mNavBarLargerGesturalHeight;
|
||||
@@ -135,6 +140,8 @@ public class SysUINavigationMode {
|
||||
mNavBarLargerGesturalHeight = ResourceUtils.getDimenByName(
|
||||
ResourceUtils.NAVBAR_BOTTOM_GESTURE_LARGER_SIZE, mContext.getResources(),
|
||||
mNavBarGesturalHeight);
|
||||
mImeDrawsImeNavBar = ResourceUtils.getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME,
|
||||
mContext.getResources(), false);
|
||||
|
||||
if (modeInt == INVALID_RESOURCE_HANDLE) {
|
||||
Log.e(TAG, "Failed to get system resource ID. Incompatible framework version?");
|
||||
@@ -167,9 +174,14 @@ public class SysUINavigationMode {
|
||||
return mMode;
|
||||
}
|
||||
|
||||
public boolean getImeDrawsImeNavBar() {
|
||||
return mImeDrawsImeNavBar;
|
||||
}
|
||||
|
||||
public void dump(PrintWriter pw) {
|
||||
pw.println("SysUINavigationMode:");
|
||||
pw.println(" mode=" + mMode.name());
|
||||
pw.println(" mImeDrawsImeNavBar=:" + mImeDrawsImeNavBar);
|
||||
pw.println(" mNavBarGesturalHeight=:" + mNavBarGesturalHeight);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user