Merge pull request #14935 from keymanapp/fix/android/style-status-bar-white

fix(android): Set the main app background white
This commit is contained in:
Darcy Wong 2025-10-20 15:25:49 +07:00 committed by GitHub
commit cfddda8d1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -619,11 +619,14 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene
getTheme().resolveAttribute(android.R.attr.actionBarSize, outValue, true);
int actionBarHeight = getResources().getDimensionPixelSize(outValue.resourceId);
// *** TO DO: Try to check if status bar is visible, set statusBarHeight to 0 if it is not visible ***
// Status bar height only used for portrait orientation
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
if (lastOrientation == Configuration.ORIENTATION_PORTRAIT) {
// *** TO DO: Try to check if status bar is visible, set statusBarHeight to 0 if it is not visible ***
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
}
int navigationBarHeight = KMManager.getNavigationBarHeight(context, KeyboardType.KEYBOARD_TYPE_INAPP);

View file

@ -8,7 +8,7 @@
android:fitsSystemWindows="true"
android:layout_above="@+id/KMKeyboard"
android:orientation="vertical"
android:background="@color/yellow_background"
android:background="@android:color/white"
tools:context=".MainActivity">
<include layout="@layout/titlebar"