Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

change status bar color android programmatically

 public void statuscolor(){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.parseColor(getPreferences().getString(Constant.SECONDARY_COLOR, Constant.SECONDARY_COLOR)));
        }
    }
Comment

statusbar text color android

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);//  set status text dark

getWindow().setStatusBarColor(ContextCompat.getColor(MainActivity.this,R.color.colorPrimaryDark));// set status background white
Comment

statusbar text color android

getWindow().setStatusBarColor(ContextCompat.getColor(BookReaderActivity.this, R.color.black));
View decorView = getWindow().getDecorView(); //set status background black 
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); //set status text  light
Comment

android status bar color

 <!-- in themes -->
<item name="android:statusBarColor">@color/color</item>
Comment

statusbar text color android

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);//  set status text dark
getWindow().setStatusBarColor(ContextCompat.getColor(BookReaderActivity.this,R.color.white));// set status background white
Comment

change status bar text color android programmatically

WindowInsetsControllerCompat(<window>, <view>).isAppearanceLightStatusBars = Boolean
Window window = Activity.getWindow();
View view = window.getDecorView();

// You need androidx.core for this
Comment

change statusbar color for android

<StatusBar backgroundColor="orange" />
Comment

PREVIOUS NEXT
Code Example
Java :: java convert am pm to 24 hour 
Java :: java 2 decimals 
Java :: declare bufferedreader java 
Java :: current time stamp android java 
Java :: how to compare strings java 
Java :: java_remove last char 
Java :: convert java to python 
Java :: Create class from string variable JAVA 
Java :: Java Looping Through Array Elements 
Java :: work with arrays java 
Java :: import android.support.v7.app.alertdialog androidx 
Java :: Java ArrayList Class of Collections 
Java :: get index of element in array java 
Java :: Java try...catch block 
Java :: line break in android xml dynamically 
Java :: Caused by: java.io.EOFException: SSL peer shut down incorrectly 
Java :: tableau deux dimensions java 
Java :: Syntax of how to create ArrayList in Java 
Java :: method java 
Java :: scala vs java 
Java :: java anonymous class 
Java :: java remove item from list 
Java :: input using stringbuffer 
Java :: remove java ubuntu 20.04 stackoverflow 
Java :: single dex file error android 
Java :: javafx edit list 
Java :: resizing ImageIcon in JButton java 
Java :: Java Creating a Java LinkedList 
Java :: dowload htpasswd file java 
Java :: horizontal recyclerview item width half of screen android 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =