Example usage for android.view Window getStatusBarColor

List of usage examples for android.view Window getStatusBarColor

Introduction

In this page you can find the example usage for android.view Window getStatusBarColor.

Prototype

@ColorInt
public abstract int getStatusBarColor();

Source Link

Usage

From source file:com.cyanogenmod.eleven.ui.activities.HomeActivity.java

private void updateStatusBarColor(int color) {
    final Window window = getWindow();
    ObjectAnimator animator = ObjectAnimator.ofInt(window, "statusBarColor", window.getStatusBarColor(), color);
    animator.setEvaluator(new ArgbEvaluator());
    animator.setDuration(300);//from   www  .j  ava  2s .  c om
    animator.start();
}

From source file:com.microntek.music.MusicActivity.java

private void updateStatusBarColor(int color) {
    if (color == Color.TRANSPARENT) {
        color = getResources().getColor(R.color.primary_dark);
    }//from w  w w . j  a v  a  2  s .  co  m
    final Window window = getWindow();
    ObjectAnimator animator = ObjectAnimator.ofInt(window, "statusBarColor", window.getStatusBarColor(), color);
    animator.setEvaluator(new ArgbEvaluator());
    animator.setDuration(300);
    animator.start();
}