Created
April 16, 2015 07:49
-
-
Save JetXing/51313aaf2c4d06f14610 to your computer and use it in GitHub Desktop.
Immersive Mode(沉浸式) ,设置view的padding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected final void initStatusBar(int resId) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
SystemBarTintManager tintManager = new SystemBarTintManager(this); | |
tintManager.setStatusBarTintEnabled(true); | |
tintManager.setTintResource(R.color.your_color); | |
SystemBarTintManager.SystemBarConfig config = tintManager.getConfig(); | |
findViewById(resId).setPadding(0, config.getPixelInsetTop(true), 0, config.getPixelInsetBottom()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment