光环助手V5.0.0-新社区展示功能(0628 产品测试问题1,2) https://git.ghzs.com/pm/halo-app-issues/-/issues/1253

This commit is contained in:
jack
2021-06-28 14:53:49 +08:00
parent a1432452f5
commit 9f2d164c70
5 changed files with 32 additions and 13 deletions

View File

@ -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");