Skip to main content

Posts

Showing posts from October, 2017

Customize StatusBar | Android Dev

Hide status bar // Hide Status Bar if ( Build . VERSION . SDK_INT < 16 ) { getWindow (). setFlags ( WindowManager . LayoutParams . FLAG_FULLSCREEN , WindowManager . LayoutParams . FLAG_FULLSCREEN ); } else { View decorView = getWindow (). getDecorView (); // Hide Status Bar. int uiOptions = View . SYSTEM_UI_FLAG_FULLSCREEN ; decorView . setSystemUiVisibility ( uiOptions ); } or // Hide status bar getWindow (). addFlags ( WindowManager . LayoutParams . FLAG_FULLSCREEN ); // Show status bar getWindow (). clearFlags ( WindowManager . LayoutParams . FLAG_FULLSCREEN ); Change status bar color programmatically if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . LOLLIPOP ) { Window window = getWindow (); window . addFlags ( WindowManager . LayoutParams . FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS ); window . setStatusBarColor ( Color . BLUE ); } or can set on value-21 <item name = ...