@momo-kits/native-kits 0.89.31-beta.20 → 0.89.31-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,9 +3,12 @@ package vn.momo.kits.platform
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
4
|
import android.content.res.Resources
|
|
5
5
|
import android.graphics.BlurMaskFilter
|
|
6
|
+
import androidx.compose.foundation.layout.WindowInsets
|
|
7
|
+
import androidx.compose.foundation.layout.navigationBars
|
|
6
8
|
import androidx.compose.runtime.Composable
|
|
7
9
|
import androidx.compose.ui.graphics.NativePaint
|
|
8
10
|
import androidx.compose.ui.platform.LocalConfiguration
|
|
11
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
9
12
|
import androidx.compose.ui.unit.Dp
|
|
10
13
|
import androidx.compose.ui.unit.dp
|
|
11
14
|
|
|
@@ -34,4 +37,11 @@ actual fun getStatusBarHeight(): Dp {
|
|
|
34
37
|
"android"
|
|
35
38
|
)
|
|
36
39
|
return if(resourceId > 0) Resources.getSystem().getDimensionPixelSize(resourceId).dp else 0.dp
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Composable
|
|
43
|
+
actual fun getNavigationBarHeight(): Dp {
|
|
44
|
+
val density = LocalDensity.current
|
|
45
|
+
val navigationBarHeight = WindowInsets.navigationBars.getBottom(density)
|
|
46
|
+
return navigationBarHeight.dp
|
|
37
47
|
}
|
|
@@ -19,4 +19,7 @@ expect fun getScreenDimensions(): ScreenDimension
|
|
|
19
19
|
expect fun NativePaint.setMaskFilter(blurRadius: Float)
|
|
20
20
|
|
|
21
21
|
@Composable
|
|
22
|
-
expect fun getStatusBarHeight(): Dp
|
|
22
|
+
expect fun getStatusBarHeight(): Dp
|
|
23
|
+
|
|
24
|
+
@Composable
|
|
25
|
+
expect fun getNavigationBarHeight(): Dp
|
|
@@ -4,6 +4,7 @@ import androidx.compose.foundation.ExperimentalFoundationApi
|
|
|
4
4
|
import androidx.compose.foundation.gestures.optOutOfCupertinoOverscroll
|
|
5
5
|
import androidx.compose.foundation.layout.WindowInsets
|
|
6
6
|
import androidx.compose.foundation.layout.asPaddingValues
|
|
7
|
+
import androidx.compose.foundation.layout.navigationBars
|
|
7
8
|
import androidx.compose.foundation.layout.systemBars
|
|
8
9
|
import androidx.compose.runtime.Composable
|
|
9
10
|
import androidx.compose.ui.graphics.NativePaint
|
|
@@ -42,4 +43,9 @@ actual fun NativePaint.setMaskFilter(blurRadius: Float) {
|
|
|
42
43
|
@Composable
|
|
43
44
|
actual fun getStatusBarHeight(): Dp {
|
|
44
45
|
return WindowInsets.systemBars.asPaddingValues().calculateTopPadding()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@Composable
|
|
49
|
+
actual fun getNavigationBarHeight(): Dp {
|
|
50
|
+
return WindowInsets.navigationBars.asPaddingValues().calculateTopPadding()
|
|
45
51
|
}
|