0

I'd like to put my notification bar transparent, I have a Samsung A5 2016 and on my home screen I have the notification bar transparent, I don't know if other devices have different notification bar color, but I'd like to get the current one and dynamic change it depending of the device. First of all I've removed the ActionBar doing this.getSupportActionBar().hide();

and it works but the only problem is with notification bar, that it becames to a gray color....

I'm using those styles :

<style name="Theme.AppCompat.Translucent" parent="@style/Theme.AppCompat.Light">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:colorBackgroundCacheHint">@null</item>
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowAnimationStyle">@android:style/Animation</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
StuartDTO
  • 783
  • 7
  • 26
  • 72

1 Answers1

1

This answer helped me with transparent status bar https://stackoverflow.com/a/29311321/6065986 These attributes should do the trick:

<item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item>.

And this works only for Api 19 and above.

  • I use min 15, what about those who use that api? It doesn't look like the normal one but well.. if noone answer on it I'll mark it as a correct – StuartDTO Oct 25 '17 at 15:22
  • 1
    As far as I know the below apis doesnt support this. If you realy need that you can try to hide status bar, get from the system list of notifications and display them in your view. But I dont think this is a good idea) – Ostap Opalinskiy Oct 25 '17 at 15:28