@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.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.158.1-test.2-debug"
43
+ version = "0.158.1-test.3-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -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 this.semantics(accessibilityId)
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(getPlatformName() == "Android") { navigator.onBackSafe() }
153
+ BackHandler(true) { navigator.onBackSafe() }
155
154
 
156
155
  CompositionLocalProvider(
157
156
  StackScreenScrollableState provides options.scrollData.scrollState,
@@ -39,8 +39,4 @@ expect fun LottieAnimation(
39
39
 
40
40
  expect fun NativePaint.setColor(
41
41
  color: Color = Color.Black
42
- )
43
-
44
- expect fun Modifier.semantics(
45
- accessibilityId: String
46
- ) : Modifier
42
+ )
@@ -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
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.158.1-test.2
21
+ version=0.158.1-test.3
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.158.1-test.2-debug",
3
+ "version": "0.158.1-test.3-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},