0

I applied 2 themes in my app, For day & night mode. but into night mode status bar background color change but status bar font color not changed.

My status bar color is Black but, font color also black. I want to change my status bar font color.

i want to need white color text like below image.

enter image description here

If Anyone has the best solution for it then please comment your answer.

Thanks in advance.

Praful Korat
  • 351
  • 2
  • 17

1 Answers1

0

//code By Gymkhana Studio

Window w = this.getWindow();
w.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
w.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
w.setStatusBarColor(Color.parseColor("#000000"));
IntelliJ Amiya
  • 70,230
  • 14
  • 154
  • 181
  • not work in my case, i already applyed many solutions – Praful Korat Apr 24 '20 at 10:50
  • this.getWindow().setStatusBarColor(0xFFE0E0E0); – Nathaniel Ajayi Apr 24 '20 at 15:18
  • This should change your status bar colour to light grey, should work for only a specific activity. If you intend to change the entire status bar colour, edit the colorPrimaryDark color in colors.xml in res/values/- folder – Nathaniel Ajayi Apr 24 '20 at 15:19
  • I think I finally understand your question. – Nathaniel Ajayi Apr 24 '20 at 20:42
  • `public static void setLightStatusBar(View view,Activity activity){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { int flags = view.getSystemUiVisibility(); flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; view.setSystemUiVisibility(flags); activity.getWindow().setStatusBarColor(Color.WHITE); } }` – Nathaniel Ajayi Apr 24 '20 at 20:44
  • I applied your solution but its make status bar color change, but I want to change font color, I want to make a black status bar with white font and icon. – Praful Korat Apr 25 '20 at 04:02