3

I am creating an application with some Activities. I want to change the status bar color and status bar icon colors which should look like the following image.

enter image description here.

Is it possible to change? I am able to change the background color using the following code.

if (android.os.Build.VERSION.SDK_INT >= 21)
{
    Window w = getWindow(); // in Activity's onCreate() for instance
    w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
    w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    w.setStatusBarColor(getResources().getColor(R.color.white_background_text));
}

Above code is working fine. Now I want to change the Wi-Fi icon, network icon, battery and time. Is it possible to do?

Rohit5k2
  • 17,948
  • 8
  • 45
  • 57
Amsheer
  • 7,046
  • 8
  • 47
  • 81
  • Possible duplicate of [How to change the status bar color in android](http://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android) – Dhaval Parmar Jan 11 '16 at 12:08
  • Seems like this would help http://forum.xda-developers.com/showthread.php?t=1245404 – Rohit5k2 Jan 11 '16 at 12:08
  • http://stackoverflow.com/a/27093330/1168654 – Dhaval Parmar Jan 11 '16 at 12:08
  • 1
    Possible duplicate of [Android statusbar icons color](http://stackoverflow.com/questions/30075827/android-statusbar-icons-color) – gio Jan 11 '16 at 12:09
  • 1
    I read all those links. Can anyone please tell me what is the difference between my code and those codes? I want to change the icons. Status bar background already working fine for me. – Amsheer Jan 11 '16 at 12:12

1 Answers1

0

From another answer

Yes it's possible to change it to gray (no custom colors) but this only works from API 23 and above you only need to add this in your values-v23/styles.xml

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

Community
  • 1
  • 1
gio
  • 4,950
  • 3
  • 32
  • 46