@momo-kits/native-kits 0.162.2-test.7-debug → 0.162.2-test.8-debug
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.
package/compose/build.gradle.kts
CHANGED
|
@@ -38,16 +38,12 @@ fun NavigationContainer(
|
|
|
38
38
|
val parentContext = ApplicationContext.current
|
|
39
39
|
val mergedContext = MiniAppContext.merge(parentContext, applicationContext)
|
|
40
40
|
|
|
41
|
-
//
|
|
42
|
-
|
|
41
|
+
// Default = the host-seeded fontScaleConfig from the merged context, so the first frame is
|
|
42
|
+
// already scaled (no flash). The observer below overwrites it on later host writes (live rate
|
|
43
|
+
// changes); a null emit (host cleared) falls back to the ambient LocalFontScaleConfig default.
|
|
44
|
+
var observerFontScaleConfig by remember { mutableStateOf(mergedContext?.fontScaleConfig) }
|
|
43
45
|
LaunchedEffect(maxApi) {
|
|
44
46
|
val api = maxApi ?: return@LaunchedEffect
|
|
45
|
-
// getDataObserver = snapshot at mount; observer = subscribe to later host writes.
|
|
46
|
-
runCatching {
|
|
47
|
-
api.getDataObserver(FONT_SCALE_OBSERVER_KEY) { data ->
|
|
48
|
-
parseFontScaleConfig(data)?.let { observerFontScaleConfig = it }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
47
|
runCatching {
|
|
52
48
|
api.observer(FONT_SCALE_OBSERVER_KEY).collect { data ->
|
|
53
49
|
observerFontScaleConfig = parseFontScaleConfig(data)
|
|
@@ -82,7 +78,7 @@ fun NavigationContainer(
|
|
|
82
78
|
ApplicationContext provides mergedContext,
|
|
83
79
|
AppConfig provides config,
|
|
84
80
|
AppLanguage provides language,
|
|
85
|
-
LocalFontScaleConfig provides (observerFontScaleConfig ?:
|
|
81
|
+
LocalFontScaleConfig provides (observerFontScaleConfig ?: LocalFontScaleConfig.current),
|
|
86
82
|
) {
|
|
87
83
|
LaunchedEffect(Unit) {
|
|
88
84
|
setNavigator?.invoke(navigator)
|
package/gradle.properties
CHANGED