Created
May 29, 2018 09:09
-
-
Save nguyenlinhnttu/ff3d44c832622e5e388adb996a6f2b1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public static void makeFullTranspatentStatusBar(Activity activity) { | |
| if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) { | |
| setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true); | |
| } | |
| if (Build.VERSION.SDK_INT >= 19) { | |
| activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); | |
| } | |
| if (Build.VERSION.SDK_INT >= 21) { | |
| setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, false); | |
| activity.getWindow().setStatusBarColor(ContextCompat.getColor(activity, R.color.color_tran_opacity)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment