光环助手V5.0.0-新社区展示功能(0628 产品测试问题1,2) https://git.ghzs.com/pm/halo-app-issues/-/issues/1253
This commit is contained in:
@ -240,6 +240,18 @@ public class DisplayUtils {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static void hideNavigationBar(Activity activity) {
|
||||
Window window = activity.getWindow();
|
||||
View decorView = window.getDecorView();
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN && Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { // lower api
|
||||
decorView.setSystemUiVisibility(View.GONE);
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
}
|
||||
|
||||
public static int retrieveNavigationHeight(Context context) {
|
||||
Resources resources = context.getResources();
|
||||
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
|
||||
|
||||
Reference in New Issue
Block a user