@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
// Dagger injection
((MyApplication)getApplication()).getAppComponent().inject(this);
setStatusBarTranslucent(true);
// create our manager instance after the content view is set
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// set the transparent color of the status bar, 30% darker
tintManager.setTintColor(Color.parseColor("#30000000"));
}
/**
* Make status bar transparent
* @param makeTranslucent
*/
private void setStatusBarTranslucent(boolean makeTranslucent) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (makeTranslucent) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
}
}