0

What theme should I use in my Android app to make my status bar white color like the one in Instagram.

Im using Theme.Appcompat.Light as my theme.

This is my colors.xml:

<!--?xml version="1.0" encoding="UTF-8"?-->
<resources>
    <color name="primaryColor">#ffffff</color>
    <color name="primaryLightColor">#ffffff</color>
    <color name="primaryDarkColor">#cccccc</color>
    <color name="secondaryColor">#3f51b5</color>
    <color name="secondaryLightColor">#757de8</color>
    <color name="secondaryDarkColor">#002984</color>
    <color name="primaryTextColor">#000000</color>
    <color name="secondaryTextColor">#ffffff</color>
</resources>

Instagram style:

Instagram style

My app:

My app

Matt Ke
  • 3,599
  • 12
  • 30
  • 49
saiful
  • 19
  • 4

1 Answers1

0

Actually colorPrimaryDark is responsible for status bar color(but not only).

From 23 SDK you could directly set status bar color.

public void setStatusBarColor(final int color) {
    Window window = getWindow();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(color);
    }
}