0

I am creating OnBoarding activity after splash activity and before MainActivity. I want to change status bar color for only OnBoarding activity. But its changes the color but its keep hiding status bar itself. I want to show status bar(battery icon, notification icons, network icon etc)

I already followed so many links but none did not work. example Status bar color of main activity changes but other activities status bar color remains same

Some code i tried but none of theme worked. Added theme attribute in Manifest file for that activity and extended main theme which i used for complete app.

My Main activity style is

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

and my different style which i want to use for a single activity is

<style name="Theme.Onboarding" parent="AppTheme">
        <item name="colorPrimaryDark">@color/white</item>
    </style>

or

<style name="Theme.Onboarding" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimaryDark">@color/white</item>
    </style>

or

<style name="Theme.Onboarding" parent="android:Theme.Material">
        <item name="android:colorPrimary">@color/white</item>
        <item name="android:colorPrimaryDark">@color/white</item>
        <item name="android:statusBarColor">@color/white</item>
    </style>

or

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      val window = window
       window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
       window.statusBarColor = Color.WHITE
  }

All above theme either hiding status bar or not changing color. But i want to show the status bar and change color of that in individual activity

0 Answers0