Guest User

Untitled

a guest
Jan 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public static void colorStatusBar(Window window, Context context, boolean transparent) {
  2. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  3. window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
  4. window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
  5. if(transparent){
  6. window.setStatusBarColor(context.getResources().getColor(android.R.color.transparent));
  7. }else{
  8. window.setStatusBarColor(context.getResources().getColor(R.color.timeline_unselected));
  9. }
  10. }
  11. }
  12.  
  13. <item name="android:windowLightStatusBar">true</item>
Add Comment
Please, Sign In to add comment