@momo-kits/native-kits 0.89.33-beta.38 → 0.89.33-beta.40
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.
|
@@ -19,7 +19,11 @@ import androidx.compose.foundation.layout.systemBars
|
|
|
19
19
|
import androidx.compose.foundation.rememberScrollState
|
|
20
20
|
import androidx.compose.foundation.verticalScroll
|
|
21
21
|
import androidx.compose.runtime.Composable
|
|
22
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
22
23
|
import androidx.compose.runtime.getValue
|
|
24
|
+
import androidx.compose.runtime.mutableStateOf
|
|
25
|
+
import androidx.compose.runtime.remember
|
|
26
|
+
import androidx.compose.runtime.setValue
|
|
23
27
|
import androidx.compose.ui.Alignment
|
|
24
28
|
import androidx.compose.ui.Modifier
|
|
25
29
|
import androidx.compose.ui.graphics.Color
|
|
@@ -32,8 +36,8 @@ import androidx.compose.ui.unit.Dp
|
|
|
32
36
|
import androidx.compose.ui.unit.dp
|
|
33
37
|
import androidx.compose.ui.unit.min
|
|
34
38
|
import androidx.compose.ui.zIndex
|
|
35
|
-
import kotlinx.serialization.Serializable
|
|
36
39
|
import kotlinx.serialization.json.Json
|
|
40
|
+
import kotlinx.serialization.json.jsonObject
|
|
37
41
|
import vn.momo.kits.components.InputSearchProps
|
|
38
42
|
import vn.momo.kits.const.AppStatusBar
|
|
39
43
|
import vn.momo.kits.const.AppTheme
|
|
@@ -49,9 +53,6 @@ enum class HeaderType {
|
|
|
49
53
|
NONE
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
@Serializable
|
|
53
|
-
data class ConfigData(val headerBanner: String? = null)
|
|
54
|
-
|
|
55
56
|
@Composable
|
|
56
57
|
fun Screen(
|
|
57
58
|
backgroundColor: Color? = null,
|
|
@@ -85,9 +86,15 @@ fun Screen(
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
val platformApi = PlatformApi.current
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
var headerBanner by remember { mutableStateOf("") }
|
|
90
|
+
|
|
91
|
+
LaunchedEffect(Unit) {
|
|
92
|
+
platformApi?.request("getConfig", "DESIGN_SYSTEM") {
|
|
93
|
+
val json = Json { ignoreUnknownKeys = true }
|
|
94
|
+
val response = json.parseToJsonElement(it).jsonObject.toMap()
|
|
95
|
+
headerBanner = response["response"]?.jsonObject?.toMap()?.get("headerBar").toString()
|
|
96
|
+
}
|
|
97
|
+
}
|
|
91
98
|
|
|
92
99
|
val indicator = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
93
100
|
val bottomPadding = min(indicator, 21.dp)
|