@momo-kits/native-kits 0.89.17 → 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/android/android.iml +11 -0
- package/android/build.gradle +1 -1
- package/compose/build.gradle.kts +2 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +9 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +4 -3
- 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/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +2 -3
- package/gradle.properties +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="JAVA_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
4
|
+
<exclude-output />
|
|
5
|
+
<content url="file://$MODULE_DIR$">
|
|
6
|
+
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
package/android/build.gradle
CHANGED
package/compose/build.gradle.kts
CHANGED
|
@@ -6,7 +6,7 @@ plugins {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
val libGroup = "vn.momo.kits"
|
|
9
|
-
val libVersion = "0.0.
|
|
9
|
+
val libVersion = "0.0.1"
|
|
10
10
|
|
|
11
11
|
kotlin {
|
|
12
12
|
androidTarget {
|
|
@@ -37,6 +37,7 @@ kotlin {
|
|
|
37
37
|
implementation(libs.ktor.client.core)
|
|
38
38
|
implementation("com.github.skydoves:landscapist-coil3:2.3.2")
|
|
39
39
|
implementation(compose.components.resources)
|
|
40
|
+
implementation("org.jetbrains.androidx.navigation:navigation-compose:2.7.0-alpha07")
|
|
40
41
|
|
|
41
42
|
implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion")
|
|
42
43
|
implementation("cafe.adriel.voyager:voyager-screenmodel:$voyagerVersion")
|
|
@@ -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
|
}
|
|
@@ -241,9 +241,10 @@ fun Button(
|
|
|
241
241
|
isRipple: Boolean = true,
|
|
242
242
|
useTintColor: Boolean = true,
|
|
243
243
|
isFull: Boolean = true,
|
|
244
|
+
modifier: Modifier = Modifier,
|
|
244
245
|
) {
|
|
245
246
|
val customModifier = if (isFull) {
|
|
246
|
-
|
|
247
|
+
modifier
|
|
247
248
|
.fillMaxWidth()
|
|
248
249
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
249
250
|
interactionSource = remember { MutableInteractionSource() },
|
|
@@ -253,7 +254,7 @@ fun Button(
|
|
|
253
254
|
)
|
|
254
255
|
|
|
255
256
|
} else {
|
|
256
|
-
|
|
257
|
+
modifier
|
|
257
258
|
.clip(RoundedCornerShape(size.value.radius)).clickable(
|
|
258
259
|
interactionSource = remember { MutableInteractionSource() },
|
|
259
260
|
indication = if (isRipple) rememberRipple() else null,
|
|
@@ -286,4 +287,4 @@ fun Button(
|
|
|
286
287
|
iconRight = iconRight
|
|
287
288
|
)
|
|
288
289
|
}
|
|
289
|
-
}
|
|
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
|
+
}
|
|
@@ -7,7 +7,6 @@ import androidx.compose.ui.text.font.FontFamily
|
|
|
7
7
|
import androidx.compose.ui.text.font.FontStyle
|
|
8
8
|
import androidx.compose.ui.text.font.FontWeight
|
|
9
9
|
import androidx.compose.ui.unit.sp
|
|
10
|
-
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
11
10
|
import org.jetbrains.compose.resources.Font
|
|
12
11
|
import org.jetbrains.compose.resources.FontResource
|
|
13
12
|
import org.jetbrains.compose.resources.InternalResourceApi
|
|
@@ -26,12 +25,12 @@ fun scaleSize(size: Float): Float {
|
|
|
26
25
|
return size
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
@OptIn(InternalResourceApi::class
|
|
28
|
+
@OptIn(InternalResourceApi::class)
|
|
30
29
|
@Composable
|
|
31
30
|
fun getFont(font: String): FontFamily {
|
|
32
31
|
val fontResource = FontResource(
|
|
33
32
|
"font:${font}",
|
|
34
|
-
setOf(ResourceItem(setOf(), "font/${font}.ttf"))
|
|
33
|
+
setOf(ResourceItem(setOf(), "font/${font}.ttf", -1, -1))
|
|
35
34
|
)
|
|
36
35
|
return FontFamily(Font(fontResource))
|
|
37
36
|
}
|
|
@@ -2,15 +2,14 @@ package vn.momo.kits.utils
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.runtime.Composable
|
|
4
4
|
import org.jetbrains.compose.resources.DrawableResource
|
|
5
|
-
import org.jetbrains.compose.resources.ExperimentalResourceApi
|
|
6
5
|
import org.jetbrains.compose.resources.InternalResourceApi
|
|
7
6
|
import org.jetbrains.compose.resources.ResourceItem
|
|
8
7
|
|
|
9
|
-
@OptIn(InternalResourceApi::class
|
|
8
|
+
@OptIn(InternalResourceApi::class)
|
|
10
9
|
@Composable
|
|
11
10
|
fun getResource(name: String): DrawableResource {
|
|
12
11
|
return DrawableResource(
|
|
13
12
|
"drawable:$name",
|
|
14
|
-
setOf(ResourceItem(setOf(), "drawable/$name"))
|
|
13
|
+
setOf(ResourceItem(setOf(), "drawable/$name", -1, -1))
|
|
15
14
|
)
|
|
16
15
|
}
|
package/gradle.properties
CHANGED
|
@@ -12,8 +12,8 @@ android.compileSdk=34
|
|
|
12
12
|
android.targetSdk=34
|
|
13
13
|
android.minSdk=24
|
|
14
14
|
#Versions
|
|
15
|
-
kotlin.version=1.9.
|
|
15
|
+
kotlin.version=1.9.24
|
|
16
16
|
agp.version=8.1.1
|
|
17
|
-
compose.version=1.6.
|
|
18
|
-
composeCompilerVersion = 1.5.
|
|
17
|
+
compose.version=1.6.11
|
|
18
|
+
composeCompilerVersion = 1.5.14
|
|
19
19
|
maven-publish.version=0.25.3
|