最近在做小米屏幕适配,在小米论坛找到miui判断是否存在虚拟按键的办法
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
if(Build.MANUFACTURER.toLowerCase().contains("xiaomi")) {
if (Settings.Global.getInt(NimApplication.getInstance().getContentResolver(), "force_fsg_nav_bar", 0) != 0) {
//开启手势,不显示虚拟键
return false;
}
return true;
}
}
网友评论