I have create a simple app with 2 activities. Main (launcher) activity is themed properly where colorPrimaryDark
is applied to status bar.
But when I transition to new activity, everything seems normal except status bar. It somehow colored white. Any idea why this could be happening?
Running this on OnePlus One (Lollipop 5.0.2)
Target api -> 16+
values/styles.xml
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/PrimaryColor</item>
<item name="colorPrimaryDark">@color/PrimaryDarkColor</item>
<item name="colorAccent">@color/accent</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
values-v21/styles.xml
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:windowContentTransitions">true</item>
<item name="android:windowAllowEnterTransitionOverlap">true</item>
<item name="android:windowAllowReturnTransitionOverlap">true</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/slide_bottom</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
layout/activity_settings.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#856"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".SettingsActivity">
<include layout="@layout/toolbar" />
</LinearLayout>
Change
<item name="android:statusBarColor">@android:color/transparent</item>
to
<item name="android:statusBarColor">@color/PrimaryDarkColor</item>
Change the api level to 11+, you can find it. change the Theme to DarkActionBar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With