Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public void translucentStatusBar() {
  2.  
  3. if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
  4. getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
  5. WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
  6. } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
  7. getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
  8. getWindow().setStatusBarColor(Color.TRANSPARENT);
  9. }
  10.  
  11. View view = findViewById(R.id.vFakeStatusBar);
  12. view.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
  13. (int) getResources().getDimension(R.dimen.default_status_bar_height)));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement