change statusbar text color android code example
Example 1: change status bar text color android programmatically
WindowInsetsControllerCompat(<window>, <view>).isAppearanceLightStatusBars = Boolean
Window window = Activity.getWindow();
View view = window.getDecorView();
Example 2: change status bar color android
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowBackground">#000000</item>
<item name="android:colorBackground">#000000</item>
<item name="android:statusBarColor">#000000</item>
</style>
</resources>
Example 3: statusbar text color android
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
getWindow().setStatusBarColor(ContextCompat.getColor(BookReaderActivity.this,R.color.white));
Example 4: statusbar text color android
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
getWindow().setStatusBarColor(ContextCompat.getColor(MainActivity.this,R.color.colorPrimaryDark));