@momo-kits/native-kits 0.158.1-test.2-debug → 0.158.1-test.3-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/modifier/AutomationId.kt +12 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +1 -2
- 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.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
|
}
|
|
@@ -5,13 +5,21 @@ 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, label: String? = null): Modifier {
|
|
13
|
-
return
|
|
14
|
-
|
|
12
|
+
fun Modifier.setAutomationId(accessibilityId: String, label: String? = null, 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
|
+
contentDescription = label ?: accessibilityId
|
|
21
|
+
}
|
|
22
|
+
}}
|
|
15
23
|
|
|
16
24
|
/**
|
|
17
25
|
* Alternative for [setAutomationId]
|
|
@@ -67,7 +67,6 @@ import vn.momo.kits.navigation.tracking.ScreenTracker
|
|
|
67
67
|
import vn.momo.kits.navigation.tracking.ScreenTrackingState
|
|
68
68
|
import kotlinx.coroutines.delay
|
|
69
69
|
import vn.momo.kits.application.ApplicationContext
|
|
70
|
-
import vn.momo.kits.platform.getPlatformName
|
|
71
70
|
import kotlin.time.Clock
|
|
72
71
|
import kotlin.time.ExperimentalTime
|
|
73
72
|
|
|
@@ -151,7 +150,7 @@ internal fun StackScreen(
|
|
|
151
150
|
val footerHeightPx = remember { mutableIntStateOf(0) }
|
|
152
151
|
val headerRightWidthPx = remember { mutableIntStateOf(0) }
|
|
153
152
|
|
|
154
|
-
BackHandler(
|
|
153
|
+
BackHandler(true) { navigator.onBackSafe() }
|
|
155
154
|
|
|
156
155
|
CompositionLocalProvider(
|
|
157
156
|
StackScreenScrollableState provides options.scrollData.scrollState,
|
|
@@ -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
|
}
|
package/gradle.properties
CHANGED