private void setupViews() { if (AndroidUtils.isKitKatOrHigher()) { // fix padding with translucent status bar // warning: status bar not always translucent (e.g. Nexus 10) // (using fitsSystemWindows would not work correctly with multiple views) mSystemBarTintManager = new SystemBarTintManager(this); int insetTop = mSystemBarTintManager.getConfig().getPixelInsetTop(false); ViewGroup actionBarToolbar = (ViewGroup) findViewById(R.id.sgToolbar); ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) actionBarToolbar.getLayoutParams(); layoutParams.setMargins( layoutParams.leftMargin, layoutParams.topMargin + insetTop, layoutParams.rightMargin, layoutParams.bottomMargin); } }