@momo-kits/native-kits 0.157.8-debug → 0.157.9-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 +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +4 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +3 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +11 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +1 -5
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -10
- package/gradle/libs.versions.toml +9 -9
- package/gradle.properties +1 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
|
@@ -108,10 +108,4 @@ actual fun LottieAnimation(
|
|
|
108
108
|
|
|
109
109
|
actual fun NativePaint.setColor(color: Color){
|
|
110
110
|
this.color = color.toArgb()
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
actual fun Modifier.semantics(accessibilityId: String): Modifier {
|
|
114
|
-
return semantics {
|
|
115
|
-
contentDescription = accessibilityId
|
|
116
|
-
}
|
|
117
111
|
}
|
|
@@ -28,6 +28,7 @@ data class MiniAppContext(
|
|
|
28
28
|
val providerId: String = "",
|
|
29
29
|
val permissions: List<Map<String, Any>>? = emptyList(),
|
|
30
30
|
val features: FeatureFlags? = null,
|
|
31
|
+
val scaleSizeMaxRate: Float? = null,
|
|
31
32
|
) {
|
|
32
33
|
companion object {
|
|
33
34
|
|
|
@@ -58,7 +59,8 @@ data class MiniAppContext(
|
|
|
58
59
|
toolkitConfig = mergeMaps(parent.toolkitConfig, child.toolkitConfig),
|
|
59
60
|
providerId = parent.providerId.ifBlank { child.providerId },
|
|
60
61
|
permissions = if (!parent.permissions.isNullOrEmpty()) parent.permissions else child.permissions,
|
|
61
|
-
features = mergeFeatureFlags(parent.features, child.features)
|
|
62
|
+
features = mergeFeatureFlags(parent.features, child.features),
|
|
63
|
+
scaleSizeMaxRate = parent.scaleSizeMaxRate ?: child.scaleSizeMaxRate,
|
|
62
64
|
)
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -104,4 +106,4 @@ val LocalComponentInformation = staticCompositionLocalOf<ComponentInformation?>
|
|
|
104
106
|
null
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
val ScaleSizeMaxRate = staticCompositionLocalOf<Float?> { null }
|
|
@@ -305,7 +305,7 @@ fun Input(
|
|
|
305
305
|
visualTransformation = visualTransformation,
|
|
306
306
|
keyboardOptions = keyboardOptionsConfig,
|
|
307
307
|
modifier = inputModifier
|
|
308
|
-
.height(scaleSize(size.values.height.value
|
|
308
|
+
.height(scaleSize(size.values.height.value).dp)
|
|
309
309
|
.onFocusChanged { focusState ->
|
|
310
310
|
val wasFocused = inputState.isFocused
|
|
311
311
|
inputState = inputState.copy(
|
|
@@ -445,4 +445,4 @@ fun Input(
|
|
|
445
445
|
// Error/hint display
|
|
446
446
|
ErrorView(error, errorSpacing, hintText)
|
|
447
447
|
}
|
|
448
|
-
}
|
|
448
|
+
}
|
|
@@ -128,7 +128,7 @@ fun InputPhoneNumber(
|
|
|
128
128
|
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = KeyboardType.Number),
|
|
129
129
|
cursorBrush = SolidColor(AppTheme.current.colors.primary),
|
|
130
130
|
modifier = inputModifier
|
|
131
|
-
.height(scaleSize(size.values.height.value
|
|
131
|
+
.height(scaleSize(size.values.height.value).dp)
|
|
132
132
|
.onFocusChanged { focusState ->
|
|
133
133
|
val wasFocused = inputState.isFocused
|
|
134
134
|
inputState = inputState.copy(
|
|
@@ -230,4 +230,4 @@ fun InputPhoneNumber(
|
|
|
230
230
|
// Error/hint display
|
|
231
231
|
ErrorView(error, errorSpacing, hintText)
|
|
232
232
|
}
|
|
233
|
-
}
|
|
233
|
+
}
|
|
@@ -37,8 +37,8 @@ const val MAX_FONT_SCALE = 1.5f
|
|
|
37
37
|
const val MAX_DEVICE_SCALE = 5
|
|
38
38
|
|
|
39
39
|
@Composable
|
|
40
|
-
fun scaleSize(size: Float
|
|
41
|
-
val scaleSizeMaxRate: Float =
|
|
40
|
+
fun scaleSize(size: Float): Float {
|
|
41
|
+
val scaleSizeMaxRate: Float = ScaleSizeMaxRate.current ?: MAX_FONT_SCALE
|
|
42
42
|
val deviceWidth = getScreenDimensions().width
|
|
43
43
|
val deviceScale = deviceWidth / DEFAULT_SCREEN_SIZE
|
|
44
44
|
|
|
@@ -77,7 +77,7 @@ fun scaleSize(size: TextUnit): TextUnit {
|
|
|
77
77
|
|
|
78
78
|
@Composable
|
|
79
79
|
fun scaleSize(size: Dp): Dp {
|
|
80
|
-
return scaleSize(size.value).
|
|
80
|
+
return scaleSize(size.value).dp
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
@Composable
|
|
@@ -5,13 +5,20 @@ import androidx.compose.ui.node.ModifierNodeElement
|
|
|
5
5
|
import androidx.compose.ui.node.SemanticsModifierNode
|
|
6
6
|
import androidx.compose.ui.semantics.SemanticsPropertyReceiver
|
|
7
7
|
import androidx.compose.ui.semantics.contentDescription
|
|
8
|
+
import androidx.compose.ui.semantics.semantics
|
|
8
9
|
import androidx.compose.ui.semantics.testTag
|
|
9
10
|
import vn.momo.kits.platform.getPlatformName
|
|
10
|
-
import vn.momo.kits.platform.semantics
|
|
11
11
|
|
|
12
|
-
fun Modifier.setAutomationId(accessibilityId: String,
|
|
13
|
-
return
|
|
14
|
-
|
|
12
|
+
fun Modifier.setAutomationId(accessibilityId: String, mergeDescendants: Boolean = false): Modifier {
|
|
13
|
+
return if (getPlatformName() == "Android") {
|
|
14
|
+
semantics {
|
|
15
|
+
contentDescription = accessibilityId
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
semantics(mergeDescendants = mergeDescendants) {
|
|
19
|
+
testTag = accessibilityId
|
|
20
|
+
}
|
|
21
|
+
}}
|
|
15
22
|
|
|
16
23
|
/**
|
|
17
24
|
* Alternative for [setAutomationId]
|
|
@@ -27,6 +27,7 @@ import vn.momo.kits.application.AppLanguage
|
|
|
27
27
|
import vn.momo.kits.application.ApplicationContext
|
|
28
28
|
import vn.momo.kits.application.KitConfig
|
|
29
29
|
import vn.momo.kits.application.MiniAppContext
|
|
30
|
+
import vn.momo.kits.application.ScaleSizeMaxRate
|
|
30
31
|
import vn.momo.kits.const.AppNavigationBar
|
|
31
32
|
import vn.momo.kits.const.AppStatusBar
|
|
32
33
|
import vn.momo.kits.const.AppTheme
|
|
@@ -85,6 +86,7 @@ fun NavigationContainer(
|
|
|
85
86
|
ApplicationContext provides mergedContext,
|
|
86
87
|
AppConfig provides config,
|
|
87
88
|
AppLanguage provides language,
|
|
89
|
+
ScaleSizeMaxRate provides mergedContext?.scaleSizeMaxRate,
|
|
88
90
|
) {
|
|
89
91
|
LaunchedEffect(Unit) {
|
|
90
92
|
setNavigator?.invoke(navigator)
|
|
@@ -148,14 +148,4 @@ fun Color.toUIColor(): UIColor {
|
|
|
148
148
|
|
|
149
149
|
actual fun NativePaint.setColor(color: Color){
|
|
150
150
|
this.color = color.toArgb()
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
private val TestAutomationId = SemanticsPropertyKey<String>(
|
|
154
|
-
name = "TestAutomationId"
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
actual fun Modifier.semantics(accessibilityId: String): Modifier {
|
|
158
|
-
return this.semantics(mergeDescendants = false) {
|
|
159
|
-
this[TestAutomationId] = accessibilityId
|
|
160
|
-
}
|
|
161
151
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
[versions]
|
|
2
|
-
android-compileSdk = "
|
|
2
|
+
android-compileSdk = "36"
|
|
3
3
|
android-minSdk = "24"
|
|
4
|
-
android-targetSdk = "
|
|
4
|
+
android-targetSdk = "36"
|
|
5
5
|
ktor-version = "3.0.0-rc-1"
|
|
6
|
-
coroutines = "1.
|
|
7
|
-
kotlin = "2.
|
|
6
|
+
coroutines = "1.9.0"
|
|
7
|
+
kotlin = "2.3.10"
|
|
8
8
|
kSerialize = "1.7.1"
|
|
9
|
-
compose = "1.
|
|
10
|
-
navigation-multiplatform = "2.9.
|
|
9
|
+
compose = "1.10.3"
|
|
10
|
+
navigation-multiplatform = "2.9.2"
|
|
11
11
|
coil3-multiplatform = "3.0.0-alpha10"
|
|
12
|
-
androidGradlePlugin = "8.
|
|
12
|
+
androidGradlePlugin = "8.13.2"
|
|
13
13
|
r8 = "8.9.35"
|
|
14
14
|
kotlinx-datetime = "0.7.1"
|
|
15
15
|
airbnb-lottie = "5.2.0"
|
|
16
16
|
androidx-activity = "1.9.1"
|
|
17
|
-
androidx-appcompat = "1.7.
|
|
17
|
+
androidx-appcompat = "1.7.0"
|
|
18
18
|
material = "1.10.0"
|
|
19
19
|
maxapi = "0.1.1"
|
|
20
20
|
vanniktechMavenPublish = "0.34.0"
|
|
21
|
-
kits = "0.1.
|
|
21
|
+
kits = "0.158.1-beta.1"
|
|
22
22
|
nativemaxapi = "0.0.6"
|
|
23
23
|
|
|
24
24
|
[libraries]
|
package/gradle.properties
CHANGED