Loading java/src/com/android/inputmethod/latin/LatinIME.java +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.inputmethod.latin; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static com.android.inputmethod.latin.common.Constants.ImeOption.FORCE_ASCII; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE_COMPAT; Loading Loading @@ -2008,11 +2009,24 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } private void setNavigationBarVisibility(final boolean visible) { if (BuildCompatUtils.EFFECTIVE_SDK_INT > Build.VERSION_CODES.M) { if (BuildCompatUtils.EFFECTIVE_SDK_INT > Build.VERSION_CODES.R) { // For N and later, IMEs can specify Color.TRANSPARENT to make the navigation bar // transparent. For other colors the system uses the default color. getWindow().getWindow().setNavigationBarColor( visible ? getColor(R.color.keyboard_navigation_bar) : Color.TRANSPARENT); if (visible) { final Configuration configuration = getResources().getConfiguration(); final boolean isNightMode = (configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; if (!isNightMode) { getWindow().getWindow().getInsetsController().setSystemBarsAppearance( APPEARANCE_LIGHT_NAVIGATION_BARS, APPEARANCE_LIGHT_NAVIGATION_BARS); } else { getWindow().getWindow().getInsetsController().setSystemBarsAppearance( 0, APPEARANCE_LIGHT_NAVIGATION_BARS); } } } } } Loading
java/src/com/android/inputmethod/latin/LatinIME.java +15 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.inputmethod.latin; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static com.android.inputmethod.latin.common.Constants.ImeOption.FORCE_ASCII; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE; import static com.android.inputmethod.latin.common.Constants.ImeOption.NO_MICROPHONE_COMPAT; Loading Loading @@ -2008,11 +2009,24 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } private void setNavigationBarVisibility(final boolean visible) { if (BuildCompatUtils.EFFECTIVE_SDK_INT > Build.VERSION_CODES.M) { if (BuildCompatUtils.EFFECTIVE_SDK_INT > Build.VERSION_CODES.R) { // For N and later, IMEs can specify Color.TRANSPARENT to make the navigation bar // transparent. For other colors the system uses the default color. getWindow().getWindow().setNavigationBarColor( visible ? getColor(R.color.keyboard_navigation_bar) : Color.TRANSPARENT); if (visible) { final Configuration configuration = getResources().getConfiguration(); final boolean isNightMode = (configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; if (!isNightMode) { getWindow().getWindow().getInsetsController().setSystemBarsAppearance( APPEARANCE_LIGHT_NAVIGATION_BARS, APPEARANCE_LIGHT_NAVIGATION_BARS); } else { getWindow().getWindow().getInsetsController().setSystemBarsAppearance( 0, APPEARANCE_LIGHT_NAVIGATION_BARS); } } } } }