Created
May 29, 2016 13:25
-
-
Save kibotu/589038efe93d7591e051541b86b6de54 to your computer and use it in GitHub Desktop.
Change Status Bar color during runtime on android
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
public static void changeStatusBarColor(final int color) { | |
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) | |
return; | |
final Window window = getActivity().getWindow(); | |
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | |
window.setStatusBarColor(color); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment