Skip to main content

Posts

Showing posts from 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 = ...

Customize ActionBar | Android Dev

How to change; Actionbar color? Statusbar color? Statusbar text color? **Set this style for the relevant activity <style name= "ThemeActionBar" parent= "ThemeOverlay.AppCompat.Light" > <!-- title text color --> <item name= "android:textColorPrimary" > @color/colorBlack </item> <!-- subtitle text color --> <item name= "android:textColorSecondary" > @color/colorBlack </item> <!-- action menu item text color --> <item name= "actionMenuTextColor" > @color/colorBlack </item> <!-- action menu item icon color - only applies to appcompat-v7 icons :( --> <item name= "colorControlNormal" > @color/colorBlack </item> <!-- enable actionbar --> <item name= "windowActionBar" > true </item> <item name= "windowNoTitle" > false </item> ...

Android fullscreen view

Hide action bar with style <style name= "AppTheme.NoActionBar" > <item name= "windowActionBar" > false </item> <item name= "windowNoTitle" > true </item> </style> Set this theme in manifest These lines will hide the status bar requestWindowFeature ( Window . FEATURE_NO_TITLE ); getWindow (). setFlags ( WindowManager . LayoutParams . FLAG_FULLSCREEN , WindowManager . LayoutParams . FLAG_FULLSCREEN ); Or View decorView = getWindow().getDecorView() ; int uiOptions = View. SYSTEM_UI_FLAG_FULLSCREEN ; decorView.setSystemUiVisibility(uiOptions) ;