Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change between dark and light notification status bar icons

Tags:

android

How do i change the status bar icon of my notification between dark and light depending on the status bar.

In some apps, the status bar is dark, in which case the icon should be light, and in others the status bar is light, in which case the icon should be dark.

So how do i get a Status bar icon that displays gray in apps with light theme, and displays white in dark theme apps?

Thank you in advance.

EDIT: What i need to know, is how to change my apps notifications status bar ICON color to light / dark, I DO NOT want to change the status bar color.

Example: YouTube application notification icons in status bar are usually bright, but change to dark icons when the status bar is light.

like image 360
Skosh Avatar asked Sep 15 '25 00:09

Skosh


1 Answers

Unfortunately, you can't use dark icons in status bar below 23 API level. You can have a separate themes for 23+ and below API levels and then use this attributes in your theme to have a light status bar and a dark icons:

<item name="android:windowLightStatusBar">true</item>

UPDATE: Actually you can't change a color of an icon itself. The system processes it independently. It always draw white icons on the dark status bar. If you want to have a dark icons on a light status bar - you should tell the system, that you're using a light status bar via that attribute, that I've mentioned above. But it can be achieved only in 23+ API level.

like image 53
Yurii Kyrylchuk Avatar answered Sep 16 '25 15:09

Yurii Kyrylchuk