-2

Currently font colour of Wifi, clock and battery in statusbar(top) of android phone is white. We have a requirement to change its colour to black. It is a worklight project. Using API 19. Any idea?

sweta
  • 11
  • 1
  • 4
  • Please show what you've tried so far. Changing the color of the status bar is probably a duplicate question – OneCricketeer Aug 19 '16 at 11:17
  • I think this will display based on the themes... – Rajendhiran Easu Aug 19 '16 at 11:22
  • http://stackoverflow.com/questions/30464234/android-lollipop-set-status-bar-text-color/33509124#33509124 Hope this helps.. – Nikhil Borad Aug 19 '16 at 11:31
  • Where to add these lines. I do not find any styles.xml file in my workspace. There is AndroidManifest.xml and config.xml – sweta Aug 19 '16 at 11:56

1 Answers1

1

It is possible only from API 23 and above use following style in you app

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

You can also change the flag at runtime by setting it to any View:

    View yourView = findViewById(R.id.your_view);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
         if (yourView != null) { 
               yourView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
         }
    }
Ayaanp
  • 327
  • 1
  • 12
  • I am using API 19. I do not find styles.xml to add this line. – sweta Aug 19 '16 at 12:02
  • The above mentioned solution will only work from API level 23 and above.. You can find styles.xml or create one in res->values->styles.xml – Ayaanp Aug 19 '16 at 12:06