Example usage for android.support.v4.app SystemBarTintManager setStatusBarTintColor

List of usage examples for android.support.v4.app SystemBarTintManager setStatusBarTintColor

Introduction

In this page you can find the example usage for android.support.v4.app SystemBarTintManager setStatusBarTintColor.

Prototype

public void setStatusBarTintColor(int color) 

Source Link

Document

Apply the specified color tint to the system status bar.

Usage

From source file:drawnzer.anurag.kollosal.KollosalPlayer.java

private void init_system_ui() {
    // TODO Auto-generated method stub
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
        return;//from w w w .  ja  va2 s  . c om

    SystemBarTintManager tinter = new SystemBarTintManager(KollosalPlayer.this);
    SystemBarTintManager.SystemBarConfig conf = tinter.getConfig();
    boolean isNavBar = conf.hasNavigtionBar();
    if (isNavBar) {
        tinter.setNavigationBarTintEnabled(true);
        tinter.setNavigationBarTintColor(currentColor);
    }
    tinter.setStatusBarTintEnabled(true);
    tinter.setStatusBarTintColor(currentColor);
    LinearLayout ls = (LinearLayout) findViewById(R.id.lists_layout);
    LinearLayout frame = (LinearLayout) findViewById(R.id.frame_container);
    frame.setPadding(0, getStatusBarHeight(), 0, isNavBar ? getNavigationBarHeight() : 0);
    ls.setPadding(0, getStatusBarHeight(), 0, isNavBar ? getNavigationBarHeight() : 0);
}