Description:
This is a question that had been made on this site but answers were not helpful for me. I need to make ONLY the status bar transparent and this is what i found:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
I´ve tried it and it works but it makes transparent the bottom action bar too (With bottom baction bar i mean this:)
How can i do to make ONLY the top status bar transparent?
Thanks so much for reading
You can check my answer on this post, as it seems like it is exactly what you are looking for.
Would hate to type it all here again but the answer from @Yunus might not work if all conditions are not met, mainly what the documentation for statusBarColor tells you.
The color for the status bar. If the color is not opaque, consider setting {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_STABLE} and {@link android.view.View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN}. For this to take effect, the window must be drawing the system bar backgrounds with {@link android.R.attr#windowDrawsSystemBarBackgrounds} and the status bar must not have been requested to be translucent with {@link android.R.attr#windowTranslucentStatus}. Corresponds to {@link android.view.Window#setStatusBarColor(int)}.
Refer the answer for setting those required flags and style, also to keep navigation bar simply DO NOT add View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
flag in case you have it in some code.
Good Luck.