@momo-kits/native-kits 0.89.32-nav.16 → 0.89.32-nav.3
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 +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Components.kt +28 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +1 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +8 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +6 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +1 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1 -0
- package/local.properties +2 -2
- package/package.json +1 -1
- package/publish.sh +1 -1
package/compose/build.gradle.kts
CHANGED
|
@@ -32,6 +32,7 @@ import androidx.compose.ui.graphics.Color
|
|
|
32
32
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
33
33
|
import androidx.compose.ui.layout.ContentScale
|
|
34
34
|
import androidx.compose.ui.platform.LocalDensity
|
|
35
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
35
36
|
import androidx.compose.ui.semantics.semantics
|
|
36
37
|
import androidx.compose.ui.semantics.testTag
|
|
37
38
|
import androidx.compose.ui.text.style.TextAlign
|
|
@@ -89,11 +90,12 @@ fun HeaderBackground(
|
|
|
89
90
|
modifier = Modifier
|
|
90
91
|
.height(height)
|
|
91
92
|
.fillMaxWidth()
|
|
93
|
+
.alpha(opacityAni)
|
|
92
94
|
.background(
|
|
93
95
|
Brush.linearGradient(
|
|
94
96
|
colors = listOf(
|
|
95
|
-
Color(
|
|
96
|
-
Color(
|
|
97
|
+
Color(0xFFFDCADE),
|
|
98
|
+
Color(0x00FDCADE)
|
|
97
99
|
),
|
|
98
100
|
start = Offset(0f, 0f),
|
|
99
101
|
end = Offset(0f, with(LocalDensity.current) { 154.dp.toPx() })
|
|
@@ -120,8 +122,8 @@ fun HeaderBackground(
|
|
|
120
122
|
.background(
|
|
121
123
|
Brush.linearGradient(
|
|
122
124
|
colors = listOf(
|
|
123
|
-
Color(
|
|
124
|
-
Color(
|
|
125
|
+
Color(0xFFFDCADE),
|
|
126
|
+
Color(0x00FDCADE)
|
|
125
127
|
),
|
|
126
128
|
start = Offset(0f, 0f),
|
|
127
129
|
end = Offset(0f, with(LocalDensity.current) { 154.dp.toPx() })
|
|
@@ -138,23 +140,22 @@ fun HeaderBackground(
|
|
|
138
140
|
)
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
Box(
|
|
142
|
-
modifier = Modifier.fillMaxWidth().height(statusBarHeight + 52.dp)
|
|
143
|
-
.alpha(1 - opacityAni)
|
|
144
|
-
.background(Colors.black_01)
|
|
145
|
-
.then(
|
|
146
|
-
if (useShadow == true) Modifier.shadow() else Modifier.bottomBorder(
|
|
147
|
-
1.dp,
|
|
148
|
-
Colors.black_04
|
|
149
|
-
)
|
|
150
|
-
)
|
|
151
|
-
)
|
|
152
143
|
}
|
|
153
|
-
|
|
154
144
|
else -> {
|
|
155
145
|
Box(modifier = Modifier.fillMaxWidth())
|
|
156
146
|
}
|
|
157
147
|
}
|
|
148
|
+
Box(
|
|
149
|
+
modifier = Modifier.fillMaxWidth().height(statusBarHeight + 52.dp)
|
|
150
|
+
.alpha(1 - opacityAni)
|
|
151
|
+
.background(Colors.black_01)
|
|
152
|
+
.then(
|
|
153
|
+
if (useShadow == true) Modifier.shadow() else Modifier.bottomBorder(
|
|
154
|
+
1.dp,
|
|
155
|
+
Colors.black_04
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
)
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
@Composable
|
|
@@ -162,8 +163,9 @@ fun Header(
|
|
|
162
163
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
163
164
|
titlePosition: TitlePosition,
|
|
164
165
|
title: String,
|
|
166
|
+
isBack: Boolean,
|
|
165
167
|
headerRight: @Composable (() -> Unit)? = null,
|
|
166
|
-
goBack: (() -> Unit)
|
|
168
|
+
goBack: (() -> Unit) = { },
|
|
167
169
|
opacity: Float? = null,
|
|
168
170
|
animatedHeader: AnimatedHeader? = null,
|
|
169
171
|
useSearchInput: Boolean? = false,
|
|
@@ -172,7 +174,7 @@ fun Header(
|
|
|
172
174
|
) {
|
|
173
175
|
val statusBarHeight = AppStatusBar.current ?: getStatusBarHeight()
|
|
174
176
|
val tintIconColor = AppTheme.current.colors.text.default
|
|
175
|
-
val backgroundButton = Colors.black_01.copy(alpha = 0.
|
|
177
|
+
val backgroundButton = Colors.black_01.copy(alpha = 0.6f)
|
|
176
178
|
|
|
177
179
|
var colorFraction by remember { mutableStateOf(0f) }
|
|
178
180
|
|
|
@@ -183,14 +185,6 @@ fun Header(
|
|
|
183
185
|
.collect { fraction -> colorFraction = fraction }
|
|
184
186
|
}
|
|
185
187
|
|
|
186
|
-
val tintIconColorAnim by animateColorAsState(
|
|
187
|
-
targetValue = animateColor(
|
|
188
|
-
Colors.black_01,
|
|
189
|
-
AppTheme.current.colors.text.default,
|
|
190
|
-
colorFraction
|
|
191
|
-
)
|
|
192
|
-
)
|
|
193
|
-
|
|
194
188
|
val backgroundSearch by animateColorAsState(
|
|
195
189
|
targetValue = animateColor(
|
|
196
190
|
Colors.black_01,
|
|
@@ -214,14 +208,14 @@ fun Header(
|
|
|
214
208
|
horizontalArrangement = Arrangement.SpaceBetween
|
|
215
209
|
) {
|
|
216
210
|
Box {
|
|
217
|
-
if (
|
|
211
|
+
if (isBack) {
|
|
218
212
|
Box(
|
|
219
213
|
modifier = Modifier
|
|
220
214
|
.size(28.dp)
|
|
221
215
|
.then(
|
|
222
216
|
Modifier.border(
|
|
223
|
-
0.
|
|
224
|
-
Colors.black_20.copy(alpha = 0.
|
|
217
|
+
0.2.dp,
|
|
218
|
+
Colors.black_20.copy(alpha = 0.2f),
|
|
225
219
|
RoundedCornerShape(100)
|
|
226
220
|
)
|
|
227
221
|
)
|
|
@@ -239,8 +233,8 @@ fun Header(
|
|
|
239
233
|
contentAlignment = Alignment.Center
|
|
240
234
|
) {
|
|
241
235
|
Icon(
|
|
242
|
-
source = "
|
|
243
|
-
color =
|
|
236
|
+
source = "arrow-back",
|
|
237
|
+
color = Colors.black_20,
|
|
244
238
|
size = 20.dp,
|
|
245
239
|
)
|
|
246
240
|
}
|
|
@@ -262,7 +256,7 @@ fun Header(
|
|
|
262
256
|
.padding(horizontal = Spacing.M),
|
|
263
257
|
verticalAlignment = Alignment.CenterVertically,
|
|
264
258
|
) {
|
|
265
|
-
if (
|
|
259
|
+
if (isBack) {
|
|
266
260
|
Spacer(Modifier.width(40.dp))
|
|
267
261
|
}
|
|
268
262
|
if (useSearchInput == true && inputSearchProps != null) {
|
|
@@ -277,8 +271,9 @@ fun Header(
|
|
|
277
271
|
) {
|
|
278
272
|
HeaderTitle(
|
|
279
273
|
title = title,
|
|
280
|
-
color =
|
|
274
|
+
color = tintIconColor,
|
|
281
275
|
modifier = Modifier.semantics {
|
|
276
|
+
contentDescription = title
|
|
282
277
|
testTag = "title_navigation_header"
|
|
283
278
|
}
|
|
284
279
|
)
|
|
@@ -18,6 +18,9 @@ import androidx.compose.ui.Alignment
|
|
|
18
18
|
import androidx.compose.ui.Modifier
|
|
19
19
|
import androidx.compose.ui.draw.clip
|
|
20
20
|
import androidx.compose.ui.graphics.Color
|
|
21
|
+
import androidx.compose.ui.semantics.contentDescription
|
|
22
|
+
import androidx.compose.ui.semantics.semantics
|
|
23
|
+
import androidx.compose.ui.semantics.testTag
|
|
21
24
|
import androidx.compose.ui.text.TextStyle
|
|
22
25
|
import androidx.compose.ui.text.style.TextOverflow
|
|
23
26
|
import androidx.compose.ui.unit.Dp
|
|
@@ -233,6 +236,7 @@ fun Button(
|
|
|
233
236
|
isFull: Boolean = true,
|
|
234
237
|
modifier: Modifier = Modifier,
|
|
235
238
|
) {
|
|
239
|
+
val testId = "btn_${type.toString().lowercase()}_$title"
|
|
236
240
|
val customModifier = if (isFull) {
|
|
237
241
|
modifier
|
|
238
242
|
.fillMaxWidth()
|
|
@@ -254,7 +258,10 @@ fun Button(
|
|
|
254
258
|
.padding(horizontal = size.value.padding)
|
|
255
259
|
.defaultMinSize(
|
|
256
260
|
minWidth = size.value.width
|
|
257
|
-
).height(size.value.height)
|
|
261
|
+
).height(size.value.height)
|
|
262
|
+
.semantics {
|
|
263
|
+
contentDescription = title; testTag = testId
|
|
264
|
+
},
|
|
258
265
|
horizontalArrangement = Arrangement.Center,
|
|
259
266
|
verticalAlignment = Alignment.CenterVertically,
|
|
260
267
|
) {
|
|
@@ -14,6 +14,7 @@ import androidx.compose.ui.graphics.painter.Painter
|
|
|
14
14
|
import androidx.compose.ui.layout.ContentScale
|
|
15
15
|
import androidx.compose.ui.semantics.contentDescription
|
|
16
16
|
import androidx.compose.ui.semantics.semantics
|
|
17
|
+
import androidx.compose.ui.semantics.testTag
|
|
17
18
|
import coil3.compose.AsyncImage
|
|
18
19
|
import vn.momo.kits.const.AppTheme
|
|
19
20
|
|
|
@@ -47,9 +48,9 @@ fun Image(
|
|
|
47
48
|
)
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
Box(modifier = modifier
|
|
51
|
+
Box(modifier = modifier) {
|
|
51
52
|
AsyncImage(
|
|
52
|
-
modifier = Modifier.matchParentSize(),
|
|
53
|
+
modifier = Modifier.matchParentSize().semantics {contentDescription = "img|$source"; testTag = "img|$source"},
|
|
53
54
|
model = source,
|
|
54
55
|
contentDescription = null,
|
|
55
56
|
contentScale = imageOptions.contentScale,
|
|
@@ -27,6 +27,7 @@ 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
|
|
30
31
|
import androidx.compose.ui.semantics.semantics
|
|
31
32
|
import androidx.compose.ui.semantics.testTag
|
|
32
33
|
import androidx.compose.ui.text.TextLayoutResult
|
|
@@ -96,7 +97,7 @@ fun PopupNotify(
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
Box(Modifier.semantics {
|
|
99
|
-
testTag = "popup_notify"
|
|
100
|
+
contentDescription = title; testTag = "popup_notify"
|
|
100
101
|
}, contentAlignment = Alignment.TopEnd) {
|
|
101
102
|
Column(
|
|
102
103
|
modifier = Modifier
|
|
@@ -234,7 +235,7 @@ fun renderRow(
|
|
|
234
235
|
title = it.title,
|
|
235
236
|
type = ButtonType.TEXT,
|
|
236
237
|
modifier = Modifier.semantics {
|
|
237
|
-
testTag = "btn_popup_cancel"
|
|
238
|
+
contentDescription = it.title; testTag = "btn_popup_cancel"
|
|
238
239
|
}
|
|
239
240
|
)
|
|
240
241
|
}
|
|
@@ -249,7 +250,7 @@ fun renderRow(
|
|
|
249
250
|
},
|
|
250
251
|
title = primary?.title ?: "",
|
|
251
252
|
modifier = Modifier.semantics {
|
|
252
|
-
testTag = "btn_popup_allow"
|
|
253
|
+
contentDescription = primary?.title ?: ""; testTag = "btn_popup_allow"
|
|
253
254
|
}
|
|
254
255
|
)
|
|
255
256
|
}
|
|
@@ -272,7 +273,7 @@ fun renderColumn(
|
|
|
272
273
|
},
|
|
273
274
|
title = primary?.title ?: "",
|
|
274
275
|
modifier = Modifier.semantics {
|
|
275
|
-
testTag = "btn_popup_allow"
|
|
276
|
+
contentDescription = primary?.title ?: ""; testTag = "btn_popup_allow"
|
|
276
277
|
}
|
|
277
278
|
)
|
|
278
279
|
secondary?.let {
|
|
@@ -287,7 +288,7 @@ fun renderColumn(
|
|
|
287
288
|
title = it.title,
|
|
288
289
|
type = ButtonType.TEXT,
|
|
289
290
|
modifier = Modifier.semantics {
|
|
290
|
-
testTag = "btn_popup_cancel"
|
|
291
|
+
contentDescription = it.title; testTag = "btn_popup_cancel"
|
|
291
292
|
}
|
|
292
293
|
)
|
|
293
294
|
}
|
|
@@ -3,8 +3,6 @@ package vn.momo.kits.components
|
|
|
3
3
|
import androidx.compose.runtime.Composable
|
|
4
4
|
import androidx.compose.ui.Modifier
|
|
5
5
|
import androidx.compose.ui.graphics.Color
|
|
6
|
-
import androidx.compose.ui.semantics.contentDescription
|
|
7
|
-
import androidx.compose.ui.semantics.semantics
|
|
8
6
|
import androidx.compose.ui.text.TextLayoutResult
|
|
9
7
|
import androidx.compose.ui.text.TextStyle
|
|
10
8
|
import androidx.compose.ui.text.style.TextAlign
|
|
@@ -33,7 +31,7 @@ fun Text(
|
|
|
33
31
|
val font = getFontFamily(fontFamily, style.fontWeight)
|
|
34
32
|
|
|
35
33
|
androidx.compose.material3.Text(
|
|
36
|
-
modifier = modifier
|
|
34
|
+
modifier = modifier,
|
|
37
35
|
text = text,
|
|
38
36
|
color = color ?: AppTheme.current.colors.text.default,
|
|
39
37
|
style = style,
|
|
@@ -4,6 +4,7 @@ val Icons = mapOf(
|
|
|
4
4
|
"01.MoMo Copy" to "https://img.mservice.com.vn/app/img/kits/01.MoMo%20Copy.png",
|
|
5
5
|
"01.MoMo" to "https://img.mservice.com.vn/app/img/kits/01.MoMo.png",
|
|
6
6
|
"Phonebook" to "https://img.mservice.com.vn/app/img/kits/Phonebook.png",
|
|
7
|
+
"arrow-back" to "https://static.momocdn.net/app/img/kits/arrow-back.png",
|
|
7
8
|
"arrow_arrow-back" to "https://img.mservice.com.vn/app/img/kits/arrow_arrow-back.png",
|
|
8
9
|
"arrow_arrow-down" to "https://img.mservice.com.vn/app/img/kits/arrow_arrow-down.png",
|
|
9
10
|
"arrow_arrow-next" to "https://img.mservice.com.vn/app/img/kits/arrow_arrow-next.png",
|
package/local.properties
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
# Location of the SDK. This is only used by Gradle.
|
|
5
5
|
# For customization when using a Version Control System, please read the
|
|
6
6
|
# header note.
|
|
7
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Tue Apr 23 16:40:15 ICT 2024
|
|
8
|
+
sdk.dir=/Users/hung.dao1/Library/Android/sdk
|
package/package.json
CHANGED