Created
June 4, 2015 20:11
-
-
Save dmitriy-chernysh/b12e185858296f9ef4c1 to your computer and use it in GitHub Desktop.
Android statusbar color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set statusbar color for API 21+ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
Window window = getWindow(); | |
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | |
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); | |
window.setStatusBarColor(getResources().getColor(R.color.primary_dark)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment