瀏覽代碼

feat: 状态栏dp高度

DoggyZhang 2 月之前
父節點
當前提交
1be64e157b
共有 3 個文件被更改,包括 14 次插入13 次删除
  1. 1 1
      frame/bom/build.gradle
  2. 1 1
      frame/util/build.gradle
  3. 12 11
      frame/util/src/main/java/com/adealink/frame/util/DisplayUtil.kt

+ 1 - 1
frame/bom/build.gradle

@@ -6,7 +6,7 @@ plugins {
 ext {
     GROUP_ID = 'com.wenext.android'
     ARTIFACT_ID = 'frame-bom'
-    VERSION = '6.2.6'
+    VERSION = '6.2.7'
 }
 
 dependencies {

+ 1 - 1
frame/util/build.gradle

@@ -7,7 +7,7 @@ plugins {
 ext {
     GROUP_ID = 'com.wenext.android'
     ARTIFACT_ID = 'frame-util'
-    VERSION = '6.0.6'
+    VERSION = '6.0.7'
 }
 
 if (project.FRAME_DEBUG != "true") {

+ 12 - 11
frame/util/src/main/java/com/adealink/frame/util/DisplayUtil.kt

@@ -224,9 +224,9 @@ object DisplayUtil {
      * @return
      */
     fun getNavMenuHeight(context: Context): Int {
-        if (!isNavMenuExist(context)) {
-            return 0
-        }
+//        if (!isNavMenuExist(context)) {
+//            return 0
+//        }
 
         if (sNaviBarHeight != -1) {
             return sNaviBarHeight
@@ -245,14 +245,15 @@ object DisplayUtil {
         }
     }
 
-    fun isNavMenuExist(context: Context): Boolean {
-        //通过判断设备是否有返回键、菜单键(不是虚拟键,是手机屏幕外的按键)来确定是否有navigation bar
-        val hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey()
-        val hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK)
-
-        // 做任何你需要做的,这个设备有一个导航栏
-        return !hasMenuKey && !hasBackKey
-    }
+    //TODO: 判断不准!!!
+//    fun isNavMenuExist(context: Context): Boolean {
+//        //通过判断设备是否有返回键、菜单键(不是虚拟键,是手机屏幕外的按键)来确定是否有navigation bar
+//        val hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey()
+//        val hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK)
+//
+//        // 做任何你需要做的,这个设备有一个导航栏
+//        return !hasMenuKey && !hasBackKey
+//    }
 
     private fun getResourceNavHeight(context: Context): Int {
         // 小米4没有nav bar, 而 navigation_bar_height 有值