@momo-kits/native-kits 0.89.18 → 0.89.19
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/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +9 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +6 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +4 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +23 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +8 -2
- package/package.json +1 -1
- package/compose/src/commonMain/composeResources/drawable/test.jpg +0 -0
|
@@ -25,6 +25,9 @@ import androidx.compose.ui.Alignment
|
|
|
25
25
|
import androidx.compose.ui.Modifier
|
|
26
26
|
import androidx.compose.ui.graphics.Color
|
|
27
27
|
import androidx.compose.ui.layout.ContentScale
|
|
28
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
29
|
+
import androidx.compose.ui.semantics.semantics
|
|
30
|
+
import androidx.compose.ui.semantics.testTag
|
|
28
31
|
import androidx.compose.ui.text.style.TextAlign
|
|
29
32
|
import androidx.compose.ui.unit.dp
|
|
30
33
|
import androidx.compose.ui.zIndex
|
|
@@ -145,7 +148,8 @@ fun Header(
|
|
|
145
148
|
indication = rememberRipple(),
|
|
146
149
|
onClick = goBack
|
|
147
150
|
)
|
|
148
|
-
.padding(Spacing.XS)
|
|
151
|
+
.padding(Spacing.XS)
|
|
152
|
+
.semantics { contentDescription = "btn_navigation_back"; testTag = "btn_navigation_back" },
|
|
149
153
|
contentAlignment = Alignment.Center
|
|
150
154
|
) {
|
|
151
155
|
Icon(
|
|
@@ -175,6 +179,10 @@ fun Header(
|
|
|
175
179
|
HeaderTitle(
|
|
176
180
|
title = title,
|
|
177
181
|
color = tintIconColor,
|
|
182
|
+
modifier = Modifier.semantics {
|
|
183
|
+
contentDescription = "title_navigation_header"
|
|
184
|
+
testTag = "title_navigation_header"
|
|
185
|
+
}
|
|
178
186
|
)
|
|
179
187
|
}
|
|
180
188
|
if (isBack) {
|
|
@@ -200,5 +208,4 @@ fun HeaderTitle(
|
|
|
200
208
|
color = color,
|
|
201
209
|
maxLines = 1
|
|
202
210
|
)
|
|
203
|
-
|
|
204
211
|
}
|
|
@@ -22,6 +22,7 @@ import androidx.compose.ui.Modifier
|
|
|
22
22
|
import androidx.compose.ui.draw.clip
|
|
23
23
|
import androidx.compose.ui.graphics.Color
|
|
24
24
|
import androidx.compose.ui.text.TextStyle
|
|
25
|
+
import androidx.compose.ui.text.style.TextOverflow
|
|
25
26
|
import androidx.compose.ui.unit.Dp
|
|
26
27
|
import androidx.compose.ui.unit.dp
|
|
27
28
|
import vn.momo.kits.const.AppTheme
|
|
@@ -116,7 +117,7 @@ fun getTextColor(type: ButtonType): Color {
|
|
|
116
117
|
fun RenderTitle(size: Size, title: String = "", type: ButtonType) {
|
|
117
118
|
val style = getStyle(size)
|
|
118
119
|
val color = getTextColor(type)
|
|
119
|
-
Text(style = style, text = title, color = color)
|
|
120
|
+
Text(style = style, text = title, color = color, overflow = TextOverflow.Ellipsis, maxLines = 1)
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
@Composable
|
|
@@ -240,9 +241,10 @@ fun Button(
|
|
|
240
241
|
isRipple: Boolean = true,
|
|
241
242
|
useTintColor: Boolean = true,
|
|
242
243
|
isFull: Boolean = true,
|
|
244
|
+
modifier: Modifier = Modifier,
|
|
243
245
|
) {
|
|
244
246
|
val customModifier = if (isFull) {
|
|
245
|
-
|
|
247
|
+
modifier
|
|
246
248
|
.fillMaxWidth()
|
|
247
249
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
248
250
|
interactionSource = remember { MutableInteractionSource() },
|
|
@@ -252,7 +254,7 @@ fun Button(
|
|
|
252
254
|
)
|
|
253
255
|
|
|
254
256
|
} else {
|
|
255
|
-
|
|
257
|
+
modifier
|
|
256
258
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
257
259
|
interactionSource = remember { MutableInteractionSource() },
|
|
258
260
|
indication = if (isRipple) rememberRipple() else null,
|
|
@@ -285,4 +287,4 @@ fun Button(
|
|
|
285
287
|
iconRight = iconRight
|
|
286
288
|
)
|
|
287
289
|
}
|
|
288
|
-
}
|
|
290
|
+
}
|
|
@@ -7,6 +7,9 @@ import androidx.compose.ui.graphics.ColorFilter
|
|
|
7
7
|
import androidx.compose.ui.graphics.DefaultAlpha
|
|
8
8
|
import androidx.compose.ui.graphics.painter.Painter
|
|
9
9
|
import androidx.compose.ui.layout.ContentScale
|
|
10
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
11
|
+
import androidx.compose.ui.semantics.semantics
|
|
12
|
+
import androidx.compose.ui.semantics.testTag
|
|
10
13
|
import com.skydoves.landscapist.ImageOptions
|
|
11
14
|
import com.skydoves.landscapist.coil3.CoilImage
|
|
12
15
|
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
@@ -27,6 +30,7 @@ fun Image(
|
|
|
27
30
|
options: Options? = null,
|
|
28
31
|
loading: Boolean = true,
|
|
29
32
|
) {
|
|
33
|
+
modifier.semantics {contentDescription = "img|$source"; testTag = "img|$source"}
|
|
30
34
|
var imageOptions = ImageOptions()
|
|
31
35
|
options?.let {
|
|
32
36
|
imageOptions = ImageOptions(
|
|
@@ -27,6 +27,9 @@ import androidx.compose.runtime.setValue
|
|
|
27
27
|
import androidx.compose.ui.Alignment
|
|
28
28
|
import androidx.compose.ui.Modifier
|
|
29
29
|
import androidx.compose.ui.draw.clip
|
|
30
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
31
|
+
import androidx.compose.ui.semantics.semantics
|
|
32
|
+
import androidx.compose.ui.semantics.testTag
|
|
30
33
|
import androidx.compose.ui.text.TextLayoutResult
|
|
31
34
|
import androidx.compose.ui.unit.dp
|
|
32
35
|
import vn.momo.kits.application.AppNavigator
|
|
@@ -96,7 +99,9 @@ fun PopupNotify(
|
|
|
96
99
|
callback?.invoke()
|
|
97
100
|
}
|
|
98
101
|
|
|
99
|
-
Box(
|
|
102
|
+
Box(Modifier.semantics {
|
|
103
|
+
contentDescription = "popup_notify"; testTag = "popup_notify"
|
|
104
|
+
}, contentAlignment = Alignment.TopEnd) {
|
|
100
105
|
Column(
|
|
101
106
|
modifier = Modifier
|
|
102
107
|
.fillMaxWidth()
|
|
@@ -163,6 +168,9 @@ fun PopupNotify(
|
|
|
163
168
|
source = "navigation_close",
|
|
164
169
|
color = AppTheme.current.colors.background.surface,
|
|
165
170
|
size = 14.dp,
|
|
171
|
+
modifier = Modifier.semantics {
|
|
172
|
+
contentDescription = "ic_popup_close"; testTag = "ic_popup_close"
|
|
173
|
+
}
|
|
166
174
|
)
|
|
167
175
|
}
|
|
168
176
|
}
|
|
@@ -229,6 +237,9 @@ fun renderRow(
|
|
|
229
237
|
},
|
|
230
238
|
title = it.title,
|
|
231
239
|
type = ButtonType.TEXT,
|
|
240
|
+
modifier = Modifier.semantics {
|
|
241
|
+
contentDescription = "btn_popup_cancel"; testTag = "btn_popup_cancel"
|
|
242
|
+
}
|
|
232
243
|
)
|
|
233
244
|
}
|
|
234
245
|
Spacer(modifier = Modifier.width(Spacing.S))
|
|
@@ -241,6 +252,9 @@ fun renderRow(
|
|
|
241
252
|
onAction(primary?.onPress)
|
|
242
253
|
},
|
|
243
254
|
title = primary?.title ?: "",
|
|
255
|
+
modifier = Modifier.semantics {
|
|
256
|
+
contentDescription = "btn_popup_allow"; testTag = "btn_popup_allow"
|
|
257
|
+
}
|
|
244
258
|
)
|
|
245
259
|
}
|
|
246
260
|
}
|
|
@@ -260,7 +274,10 @@ fun renderColumn(
|
|
|
260
274
|
closeAction.value = "button_action"
|
|
261
275
|
onAction(primary?.onPress)
|
|
262
276
|
},
|
|
263
|
-
title = primary?.title ?: ""
|
|
277
|
+
title = primary?.title ?: "",
|
|
278
|
+
modifier = Modifier.semantics {
|
|
279
|
+
contentDescription = "btn_popup_allow"; testTag = "btn_popup_allow"
|
|
280
|
+
}
|
|
264
281
|
)
|
|
265
282
|
secondary?.let {
|
|
266
283
|
Spacer(modifier = Modifier.height(Spacing.S))
|
|
@@ -272,7 +289,10 @@ fun renderColumn(
|
|
|
272
289
|
onAction(it.onPress)
|
|
273
290
|
},
|
|
274
291
|
title = it.title,
|
|
275
|
-
type = ButtonType.TEXT
|
|
292
|
+
type = ButtonType.TEXT,
|
|
293
|
+
modifier = Modifier.semantics {
|
|
294
|
+
contentDescription = "btn_popup_cancel"; testTag = "btn_popup_cancel"
|
|
295
|
+
}
|
|
276
296
|
)
|
|
277
297
|
}
|
|
278
298
|
}
|
|
@@ -17,6 +17,9 @@ import androidx.compose.runtime.remember
|
|
|
17
17
|
import androidx.compose.ui.Alignment
|
|
18
18
|
import androidx.compose.ui.Modifier
|
|
19
19
|
import androidx.compose.ui.draw.clip
|
|
20
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
21
|
+
import androidx.compose.ui.semantics.semantics
|
|
22
|
+
import androidx.compose.ui.semantics.testTag
|
|
20
23
|
import androidx.compose.ui.unit.dp
|
|
21
24
|
import vn.momo.kits.const.AppTheme
|
|
22
25
|
import vn.momo.kits.const.Radius
|
|
@@ -27,7 +30,7 @@ fun PromotionPopup(
|
|
|
27
30
|
source: String = "",
|
|
28
31
|
onClose: (() -> Unit) = {},
|
|
29
32
|
) {
|
|
30
|
-
Column {
|
|
33
|
+
Column(Modifier.semantics { contentDescription = "popup_notify"; testTag = "popup_notify" }) {
|
|
31
34
|
if (source.isNotEmpty()) {
|
|
32
35
|
Image(
|
|
33
36
|
source = source,
|
|
@@ -65,8 +68,11 @@ fun PromotionPopup(
|
|
|
65
68
|
source = "navigation_close",
|
|
66
69
|
color = AppTheme.current.colors.background.surface,
|
|
67
70
|
size = 14.dp,
|
|
71
|
+
modifier = Modifier.semantics {
|
|
72
|
+
contentDescription = "ic_popup_close"; testTag = "ic_popup_close"
|
|
73
|
+
}
|
|
68
74
|
)
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
77
|
}
|
|
72
|
-
}
|
|
78
|
+
}
|
package/package.json
CHANGED
|
Binary file
|