0

I want to make the status bar like in the image below.

how to change colors of my status bar according to this pic

I tried a few things but none of them worked. Can some one point me to the right direction.

wasif
  • 317
  • 2
  • 9
  • **Welcome to Stack Overflow**, well your question shows lack of research here, and **`FYI`** StackOverflow is neither a forum, tutorial site nor web search replacement. We can **[help with certain problems](https://stackoverflow.com/help/on-topic)**, but it's your job to **[put some efforts](https://meta.stackoverflow.com/q/261592/7666442)** in the first place, including elementary **[(re)search](https://www.google.co.in/)**. Read **[how to ask perfect question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/)** – AskNilesh Feb 20 '19 at 07:00
  • Agreed with @NileshRathod.Though check this link https://stackoverflow.com/questions/30075827/android-statusbar-icons-color – Vir Rajpurohit Feb 20 '19 at 07:05
  • Possible duplicate of [Android statusbar icons color](https://stackoverflow.com/questions/30075827/android-statusbar-icons-color) – Rohit5k2 Feb 20 '19 at 07:07
  • i tried some of the answers from the link but none of them worked – wasif Feb 20 '19 at 07:10
  • – wasif Feb 20 '19 at 07:13

1 Answers1

1
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(getResources().getColor(R.color.colorPrimary));
    }
    super.onCreate(savedInstanceState);

and add this line to theme

<item name="android:windowLightStatusBar" tools:targetApi="23">true</item>
mmfarzaneh
  • 381
  • 1
  • 11