Answers for "how to change status bar color in android programmatically"

0

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)));
        }
    }
Posted by: Guest on November-17-2020
1

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
Posted by: Guest on June-07-2021
0

change status bar color in android studio

if (Build.VERSION.SDK_INT >= 21) {
            Window window = this.getWindow();
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            window.setStatusBarColor(this.getResources().getColor(R.color.colorPrimaryDark));
        }
Posted by: Guest on August-04-2021

Code answers related to "how to change status bar color in android programmatically"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language