public static void setSystemBar(Activity context, Toolbar mToolbar, int color) { SystemBarTintManager tintManager = new SystemBarTintManager(context); tintManager.setStatusBarTintEnabled(true); mToolbar.setBackgroundColor(color); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { tintManager.setStatusBarTintColor(color); } }
public void setupStatusBar() { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) headerText1.getLayoutParams(); layoutParams.topMargin += getStatusBarHeight(getApplicationContext()); headerText1.setLayoutParams(layoutParams); SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable status bar tint tintManager.setStatusBarTintEnabled(true); // enable navigation bar tint tintManager.setNavigationBarTintEnabled(true); tintManager.setStatusBarAlpha(0.2f); tintManager.setNavigationBarAlpha(0.2f); tintManager.setTintAlpha(0.2f); tintManager.setTintColor(Color.parseColor("#0069FF")); }