|
|
@@ -0,0 +1,23 @@
|
|
|
+package com.adealink.frame.util
|
|
|
+
|
|
|
+import android.app.Activity
|
|
|
+import android.content.Context
|
|
|
+import android.view.Window
|
|
|
+import com.adealink.frame.util.DisplayUtil.getNavMenuHeight
|
|
|
+import com.adealink.frame.util.DisplayUtil.getStatusBarHeight
|
|
|
+
|
|
|
+fun Activity?.statusBarHeight(): Int {
|
|
|
+ return this?.window.statusBarHeight()
|
|
|
+}
|
|
|
+
|
|
|
+fun Window?.statusBarHeight(): Int {
|
|
|
+ return this?.let {
|
|
|
+ getStatusBarHeight(it)
|
|
|
+ } ?: 0
|
|
|
+}
|
|
|
+
|
|
|
+fun Context?.naviBarHeight(): Int {
|
|
|
+ return this?.let {
|
|
|
+ getNavMenuHeight(it)
|
|
|
+ } ?: 0
|
|
|
+}
|