Код: Выделить всё
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
getWindow().setStatusBarColor(ContextCompat.getColor(this, android.R.color.black));
getWindow().setNavigationBarColor(ContextCompat.getColor(this, android.R.color.black));
Код: Выделить всё
android.view.Window.setDecorFitsSystemWindows
androidx.core.view.WindowCompat$Api30Impl.setDecorFitsSystemWindows
androidx.core.view.WindowCompat.setDecorFitsSystemWindows
android.view.Window.setNavigationBarColor
android.view.Window.setStatusBarColor
Код: Выделить всё
WindowInsetsController insetsController = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
insetsController = getWindow().getInsetsController();
if (insetsController != null) {
insetsController.setSystemBarsAppearance(WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS);
insetsController.setSystemBarsAppearance(WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS, WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS);
}
} else {
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
getWindow().setStatusBarColor(ContextCompat.getColor(this, android.R.color.black));
getWindow().setNavigationBarColor(ContextCompat.getColor(this, android.R.color.black));
}
Есть предложения?
Подробнее здесь: https://stackoverflow.com/questions/793 ... olor-api30
Мобильная версия