0

As you can see on the desing screen shot I have a tabLayout coloured in magenta. But the top notification gtray from the system is still black, where the antenna signal is. enter image description here

Can I make the black notification tray in the same color I made the tabLayout?

Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103

1 Answers1

3

In Android Lollipop have ability to change the color of status bar in your app for a more immersive user experience and in tune with Google's Material Design Guidelines.

window.setStatusBarColor method introduced in API level 21

Programatically

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(Color.BLUE); }

style.xml

<resources>
   <!-- Base application theme. -->
   <style name="AppTheme" parent="Theme.AppCompat.Light">
       <item name="colorPrimary">@color/color_primary</item>
       <item name="colorPrimaryDark">@color/color_secondary</item>
       <item name="colorAccent">@color/color_accent</item>
       <item name="android:statusBarColor">@color/color_primary</item>
   </style>
</resources>

enter image description here

Abhishek Patel
  • 4,280
  • 1
  • 24
  • 38