@momo-kits/native-kits 0.89.30-beta.7 → 0.89.30-rc.10
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 +60 -82
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +36 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +6 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PromotionPopup.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +4 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +10 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1 -3
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Box
|
|
|
9
9
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
10
10
|
import androidx.compose.foundation.layout.Row
|
|
11
11
|
import androidx.compose.foundation.layout.Spacer
|
|
12
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
12
13
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
13
14
|
import androidx.compose.foundation.layout.height
|
|
14
15
|
import androidx.compose.foundation.layout.padding
|
|
@@ -24,12 +25,9 @@ import androidx.compose.runtime.setValue
|
|
|
24
25
|
import androidx.compose.runtime.snapshotFlow
|
|
25
26
|
import androidx.compose.ui.Alignment
|
|
26
27
|
import androidx.compose.ui.Modifier
|
|
27
|
-
import androidx.compose.ui.geometry.Offset
|
|
28
|
-
import androidx.compose.ui.graphics.Brush
|
|
29
28
|
import androidx.compose.ui.graphics.Color
|
|
30
29
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
31
30
|
import androidx.compose.ui.layout.ContentScale
|
|
32
|
-
import androidx.compose.ui.platform.LocalDensity
|
|
33
31
|
import androidx.compose.ui.semantics.contentDescription
|
|
34
32
|
import androidx.compose.ui.semantics.semantics
|
|
35
33
|
import androidx.compose.ui.semantics.testTag
|
|
@@ -61,76 +59,45 @@ data class AnimatedHeader(
|
|
|
61
59
|
)
|
|
62
60
|
|
|
63
61
|
@Composable
|
|
64
|
-
fun
|
|
65
|
-
headerType: HeaderType = HeaderType.DEFAULT
|
|
62
|
+
fun HeaderImage(
|
|
63
|
+
headerType: HeaderType = HeaderType.DEFAULT,
|
|
64
|
+
headerBackground: String?,
|
|
66
65
|
) {
|
|
67
66
|
val statusBarHeight = AppStatusBar.current ?: getStatusBarHeight()
|
|
68
67
|
when (headerType) {
|
|
69
68
|
HeaderType.DEFAULT -> {
|
|
70
69
|
val height = statusBarHeight + 52.dp
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
) {
|
|
78
|
-
Box(
|
|
79
|
-
modifier = Modifier
|
|
80
|
-
.height(height)
|
|
81
|
-
.fillMaxWidth()
|
|
82
|
-
.background(
|
|
83
|
-
Brush.linearGradient(
|
|
84
|
-
colors = listOf(
|
|
85
|
-
Color(0xFFFDCACE),
|
|
86
|
-
Color(0x00FDCACE)
|
|
87
|
-
),
|
|
88
|
-
start = Offset(0f, 0f),
|
|
89
|
-
end = Offset(0f, with(LocalDensity.current) { 154.dp.toPx() })
|
|
90
|
-
)
|
|
91
|
-
)
|
|
70
|
+
Image(
|
|
71
|
+
source = headerBackground ?: "",
|
|
72
|
+
loading = false,
|
|
73
|
+
modifier = Modifier.fillMaxWidth().height(height),
|
|
74
|
+
options = Options(
|
|
75
|
+
contentScale = ContentScale.FillWidth
|
|
92
76
|
)
|
|
93
|
-
|
|
94
|
-
Image(
|
|
95
|
-
source = AppTheme.current.assets.headerBackground!!,
|
|
96
|
-
modifier = Modifier.fillMaxWidth().height(height),
|
|
97
|
-
options = Options(
|
|
98
|
-
contentScale = ContentScale.FillWidth
|
|
99
|
-
)
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
77
|
+
)
|
|
104
78
|
}
|
|
105
79
|
|
|
106
80
|
HeaderType.EXTENDED -> {
|
|
81
|
+
Image(
|
|
82
|
+
source = headerBackground ?: "",
|
|
83
|
+
loading = false,
|
|
84
|
+
modifier = Modifier.fillMaxSize(),
|
|
85
|
+
options = Options(
|
|
86
|
+
contentScale = ContentScale.FillWidth
|
|
87
|
+
)
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
HeaderType.SURFACE -> {
|
|
92
|
+
val height = statusBarHeight + 52.dp
|
|
107
93
|
Box(
|
|
108
|
-
modifier = Modifier.fillMaxWidth().height(
|
|
109
|
-
.background(
|
|
110
|
-
Brush.linearGradient(
|
|
111
|
-
colors = listOf(
|
|
112
|
-
Color(0xFFFDCACE),
|
|
113
|
-
Color(0x00FDCACE)
|
|
114
|
-
),
|
|
115
|
-
start = Offset(0f, 0f),
|
|
116
|
-
end = Offset(0f, with(LocalDensity.current) { 154.dp.toPx() })
|
|
117
|
-
)
|
|
118
|
-
)
|
|
94
|
+
modifier = Modifier.fillMaxWidth().height(height)
|
|
95
|
+
.background(AppTheme.current.colors.background.surface)
|
|
119
96
|
.bottomBorder(
|
|
120
|
-
strokeWidth =
|
|
97
|
+
strokeWidth = 2.dp,
|
|
121
98
|
color = AppTheme.current.colors.border.default
|
|
122
99
|
)
|
|
123
|
-
)
|
|
124
|
-
if (AppTheme.current.assets.headerBackground != null) {
|
|
125
|
-
Image(
|
|
126
|
-
source = AppTheme.current.assets.headerBackground!!,
|
|
127
|
-
modifier = Modifier.fillMaxWidth().height(154.dp),
|
|
128
|
-
options = Options(
|
|
129
|
-
contentScale = ContentScale.FillWidth
|
|
130
|
-
)
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
}
|
|
100
|
+
)
|
|
134
101
|
}
|
|
135
102
|
|
|
136
103
|
else -> {
|
|
@@ -144,22 +111,30 @@ fun Header(
|
|
|
144
111
|
headerType: HeaderType = HeaderType.DEFAULT,
|
|
145
112
|
titlePosition: TitlePosition,
|
|
146
113
|
title: String,
|
|
114
|
+
isBack: Boolean,
|
|
147
115
|
headerRight: @Composable (() -> Unit)? = null,
|
|
148
|
-
goBack: (() -> Unit)
|
|
116
|
+
goBack: (() -> Unit) = { },
|
|
149
117
|
opacity: Float? = null,
|
|
150
118
|
animatedHeader: AnimatedHeader? = null,
|
|
151
119
|
scrollState: Int = 0
|
|
152
120
|
) {
|
|
153
121
|
val statusBarHeight = AppStatusBar.current ?: getStatusBarHeight()
|
|
154
|
-
|
|
122
|
+
var tintIconColor = Colors.black_01
|
|
123
|
+
var backgroundButton = Colors.black_20.copy(alpha = 0.4f)
|
|
124
|
+
if (headerType == HeaderType.SURFACE) {
|
|
125
|
+
tintIconColor = AppTheme.current.colors.text.default
|
|
126
|
+
backgroundButton = Color.Transparent
|
|
127
|
+
}
|
|
155
128
|
|
|
156
129
|
var colorFraction by remember { mutableStateOf(0f) }
|
|
157
130
|
|
|
158
131
|
LaunchedEffect(scrollState) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
132
|
+
if (headerType == HeaderType.SURFACE) {
|
|
133
|
+
snapshotFlow { scrollState }
|
|
134
|
+
.map { (it / 50f).coerceIn(0f, 1f) }
|
|
135
|
+
.distinctUntilChanged()
|
|
136
|
+
.collect { fraction -> colorFraction = fraction }
|
|
137
|
+
}
|
|
163
138
|
}
|
|
164
139
|
|
|
165
140
|
val tintIconColorAnim by animateColorAsState(
|
|
@@ -170,7 +145,7 @@ fun Header(
|
|
|
170
145
|
)
|
|
171
146
|
)
|
|
172
147
|
|
|
173
|
-
if (headerType != HeaderType.NONE
|
|
148
|
+
if (headerType != HeaderType.NONE) {
|
|
174
149
|
BoxWithConstraints(
|
|
175
150
|
Modifier.height(statusBarHeight + 52.dp)
|
|
176
151
|
.fillMaxWidth()
|
|
@@ -185,19 +160,23 @@ fun Header(
|
|
|
185
160
|
horizontalArrangement = Arrangement.SpaceBetween
|
|
186
161
|
) {
|
|
187
162
|
Box {
|
|
188
|
-
if (
|
|
163
|
+
if (isBack) {
|
|
189
164
|
Box(
|
|
190
165
|
modifier = Modifier
|
|
191
166
|
.size(28.dp)
|
|
192
167
|
.then(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
168
|
+
if (headerType == HeaderType.SURFACE) {
|
|
169
|
+
Modifier.border(
|
|
170
|
+
0.5.dp,
|
|
171
|
+
Colors.black_20.copy(alpha = 0.4f),
|
|
172
|
+
RoundedCornerShape(100)
|
|
173
|
+
)
|
|
174
|
+
} else {
|
|
175
|
+
Modifier
|
|
176
|
+
}
|
|
198
177
|
)
|
|
199
178
|
.background(
|
|
200
|
-
|
|
179
|
+
backgroundButton,
|
|
201
180
|
RoundedCornerShape(100)
|
|
202
181
|
)
|
|
203
182
|
.clickable(
|
|
@@ -205,14 +184,13 @@ fun Header(
|
|
|
205
184
|
)
|
|
206
185
|
.padding(Spacing.XS)
|
|
207
186
|
.semantics {
|
|
208
|
-
|
|
209
|
-
"btn_navigation_back"
|
|
187
|
+
testTag = "btn_navigation_back"
|
|
210
188
|
},
|
|
211
189
|
contentAlignment = Alignment.Center
|
|
212
190
|
) {
|
|
213
191
|
Icon(
|
|
214
|
-
source = "
|
|
215
|
-
color = if (animatedHeader !== null) tintIconColorAnim else tintIconColor,
|
|
192
|
+
source = "ic_back_ios",
|
|
193
|
+
color = if (headerType == HeaderType.SURFACE && animatedHeader !== null) tintIconColorAnim else tintIconColor,
|
|
216
194
|
size = 20.dp,
|
|
217
195
|
)
|
|
218
196
|
}
|
|
@@ -232,7 +210,7 @@ fun Header(
|
|
|
232
210
|
.padding(horizontal = Spacing.M),
|
|
233
211
|
verticalAlignment = Alignment.CenterVertically,
|
|
234
212
|
) {
|
|
235
|
-
if (
|
|
213
|
+
if (isBack) {
|
|
236
214
|
Spacer(Modifier.width(40.dp))
|
|
237
215
|
}
|
|
238
216
|
Box(
|
|
@@ -243,14 +221,14 @@ fun Header(
|
|
|
243
221
|
) {
|
|
244
222
|
HeaderTitle(
|
|
245
223
|
title = title,
|
|
246
|
-
color = if (animatedHeader !== null) tintIconColorAnim else tintIconColor,
|
|
224
|
+
color = if (headerType == HeaderType.SURFACE && animatedHeader !== null) tintIconColorAnim else tintIconColor,
|
|
247
225
|
modifier = Modifier.semantics {
|
|
248
|
-
contentDescription =
|
|
226
|
+
contentDescription = title
|
|
249
227
|
testTag = "title_navigation_header"
|
|
250
228
|
}
|
|
251
229
|
)
|
|
252
230
|
}
|
|
253
|
-
if (
|
|
231
|
+
if (isBack) {
|
|
254
232
|
Spacer(Modifier.width(40.dp))
|
|
255
233
|
}
|
|
256
234
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package vn.momo.kits.application
|
|
2
2
|
|
|
3
3
|
import androidx.compose.animation.core.animateFloatAsState
|
|
4
|
+
import androidx.compose.foundation.ScrollState
|
|
4
5
|
import androidx.compose.foundation.background
|
|
5
6
|
import androidx.compose.foundation.gestures.detectTapGestures
|
|
6
7
|
import androidx.compose.foundation.layout.Arrangement
|
|
@@ -24,6 +25,8 @@ import androidx.compose.ui.Modifier
|
|
|
24
25
|
import androidx.compose.ui.graphics.Color
|
|
25
26
|
import androidx.compose.ui.graphics.graphicsLayer
|
|
26
27
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
28
|
+
import androidx.compose.ui.layout.LayoutCoordinates
|
|
29
|
+
import androidx.compose.ui.layout.onGloballyPositioned
|
|
27
30
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
28
31
|
import androidx.compose.ui.unit.Dp
|
|
29
32
|
import androidx.compose.ui.unit.dp
|
|
@@ -33,11 +36,13 @@ import vn.momo.kits.const.AppStatusBar
|
|
|
33
36
|
import vn.momo.kits.const.AppTheme
|
|
34
37
|
import vn.momo.kits.const.Colors
|
|
35
38
|
import vn.momo.kits.const.Spacing
|
|
39
|
+
import vn.momo.kits.modifier.conditional
|
|
36
40
|
import vn.momo.kits.modifier.shadow
|
|
37
41
|
import vn.momo.kits.platform.getStatusBarHeight
|
|
38
42
|
|
|
39
43
|
enum class HeaderType {
|
|
40
44
|
DEFAULT,
|
|
45
|
+
SURFACE,
|
|
41
46
|
EXTENDED,
|
|
42
47
|
NONE
|
|
43
48
|
}
|
|
@@ -45,13 +50,17 @@ enum class HeaderType {
|
|
|
45
50
|
@Composable
|
|
46
51
|
fun Screen(
|
|
47
52
|
backgroundColor: Color? = null,
|
|
48
|
-
|
|
53
|
+
headerBackground: String? = null,
|
|
54
|
+
isBack: Boolean = true,
|
|
55
|
+
headerType: HeaderType = HeaderType.DEFAULT,
|
|
49
56
|
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
|
|
50
57
|
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
|
|
51
58
|
title: String = "Stack",
|
|
52
59
|
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
53
|
-
goBack: (() -> Unit)
|
|
60
|
+
goBack: (() -> Unit) = { },
|
|
54
61
|
scrollable: Boolean = true,
|
|
62
|
+
scrollState: ScrollState = rememberScrollState(),
|
|
63
|
+
onContentLayout: ((LayoutCoordinates) -> Unit)? = null,
|
|
55
64
|
useAvoidKeyboard: Boolean = true,
|
|
56
65
|
footer: @Composable (() -> Unit)? = null,
|
|
57
66
|
headerRight: @Composable (() -> Unit)? = null,
|
|
@@ -72,7 +81,6 @@ fun Screen(
|
|
|
72
81
|
|
|
73
82
|
val indicator = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
74
83
|
val bottomPadding = min(indicator, 21.dp)
|
|
75
|
-
val scrollState = rememberScrollState()
|
|
76
84
|
|
|
77
85
|
val opacity by animateFloatAsState(
|
|
78
86
|
targetValue = ((scrollState.value / 114f)).coerceIn(0f, 1f)
|
|
@@ -87,14 +95,18 @@ fun Screen(
|
|
|
87
95
|
) {
|
|
88
96
|
|
|
89
97
|
if (animatedHeader === null) {
|
|
90
|
-
|
|
98
|
+
HeaderImage(
|
|
99
|
+
headerType,
|
|
100
|
+
headerBackground ?: AppTheme.current.assets.headerBackground
|
|
101
|
+
)
|
|
91
102
|
} else {
|
|
92
103
|
Box(
|
|
93
|
-
Modifier.zIndex(5f)
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
Modifier.zIndex(5f).background(Color.White.copy(alpha = opacity))
|
|
105
|
+
.graphicsLayer { alpha = opacity }) {
|
|
106
|
+
HeaderImage(
|
|
107
|
+
headerType,
|
|
108
|
+
headerBackground ?: AppTheme.current.assets.headerBackground
|
|
109
|
+
)
|
|
98
110
|
}
|
|
99
111
|
}
|
|
100
112
|
|
|
@@ -103,6 +115,7 @@ fun Screen(
|
|
|
103
115
|
title = title,
|
|
104
116
|
titlePosition = titlePosition,
|
|
105
117
|
headerRight = headerRight,
|
|
118
|
+
isBack = isBack,
|
|
106
119
|
goBack = goBack,
|
|
107
120
|
opacity = opacity,
|
|
108
121
|
animatedHeader = animatedHeader,
|
|
@@ -121,7 +134,13 @@ fun Screen(
|
|
|
121
134
|
) {
|
|
122
135
|
|
|
123
136
|
Column(
|
|
124
|
-
modifier =
|
|
137
|
+
modifier = Modifier
|
|
138
|
+
.conditional(scrollable) { weight(1f) }
|
|
139
|
+
.padding(bottom = keyboardSize)
|
|
140
|
+
.conditional(onContentLayout != null) {
|
|
141
|
+
onGloballyPositioned(onContentLayout ?: {})
|
|
142
|
+
}
|
|
143
|
+
.conditional(scrollable) { verticalScroll(scrollState) },
|
|
125
144
|
verticalArrangement = verticalArrangement,
|
|
126
145
|
horizontalAlignment = horizontalAlignment
|
|
127
146
|
) {
|
|
@@ -146,7 +165,8 @@ fun Screen(
|
|
|
146
165
|
scrollPosition = fabProps.scrollState?.value ?: scrollState.value,
|
|
147
166
|
onClick = fabProps.onClick,
|
|
148
167
|
containerColor = AppTheme.current.colors.primary,
|
|
149
|
-
bottom = fabProps.bottom
|
|
168
|
+
bottom = fabProps.bottom
|
|
169
|
+
?: if (footer != null) bottomPadding + 76.dp else bottomPadding + 12.dp,
|
|
150
170
|
icon = fabProps.icon,
|
|
151
171
|
iconColor = fabProps.iconColor,
|
|
152
172
|
text = fabProps.label,
|
|
@@ -175,8 +195,11 @@ fun Footer(footer: @Composable (() -> Unit)? = null, keyboardSize: Dp = 0.dp, bo
|
|
|
175
195
|
.background(AppTheme.current.colors.background.surface)
|
|
176
196
|
) {
|
|
177
197
|
Box(
|
|
178
|
-
Modifier
|
|
179
|
-
|
|
198
|
+
Modifier
|
|
199
|
+
.fillMaxWidth()
|
|
200
|
+
.padding(vertical = Spacing.S, horizontal = Spacing.M)
|
|
201
|
+
)
|
|
202
|
+
{
|
|
180
203
|
footer?.invoke()
|
|
181
204
|
}
|
|
182
205
|
}
|
|
@@ -260,7 +260,7 @@ fun Button(
|
|
|
260
260
|
minWidth = size.value.width
|
|
261
261
|
).height(size.value.height)
|
|
262
262
|
.semantics {
|
|
263
|
-
contentDescription =
|
|
263
|
+
contentDescription = title; testTag = testId
|
|
264
264
|
},
|
|
265
265
|
horizontalArrangement = Arrangement.Center,
|
|
266
266
|
verticalAlignment = Alignment.CenterVertically,
|
|
@@ -204,7 +204,7 @@ fun Input(
|
|
|
204
204
|
val testId = if (disabled) "input_${floatingValue}_disabled" else "input_$floatingValue"
|
|
205
205
|
|
|
206
206
|
Column(modifier = Modifier.semantics {
|
|
207
|
-
contentDescription =
|
|
207
|
+
contentDescription = floatingValue; testTag = testId
|
|
208
208
|
}) {
|
|
209
209
|
BasicTextField(
|
|
210
210
|
enabled = !disabled,
|
|
@@ -17,7 +17,6 @@ import androidx.compose.runtime.MutableState
|
|
|
17
17
|
import androidx.compose.runtime.getValue
|
|
18
18
|
import androidx.compose.runtime.mutableStateOf
|
|
19
19
|
import androidx.compose.runtime.remember
|
|
20
|
-
import androidx.compose.runtime.setValue
|
|
21
20
|
import androidx.compose.ui.Alignment
|
|
22
21
|
import androidx.compose.ui.Modifier
|
|
23
22
|
import androidx.compose.ui.graphics.Color
|
|
@@ -78,7 +77,7 @@ fun InputDropDown(
|
|
|
78
77
|
val testId = if (disabled) "input_${floatingValue}_disabled" else "input_$floatingValue"
|
|
79
78
|
|
|
80
79
|
Column(modifier = Modifier.clickable(enabled = !disabled, onClick = onPress).semantics {
|
|
81
|
-
contentDescription =
|
|
80
|
+
contentDescription = floatingValue; testTag = testId
|
|
82
81
|
}) {
|
|
83
82
|
Box {
|
|
84
83
|
if (floatingValue.isNotEmpty() || floatingIcon.isNotEmpty()) {
|
|
@@ -110,7 +110,7 @@ fun InputMoney(
|
|
|
110
110
|
val testId = if (disabled) "input_${floatingValue}_disabled" else "input_$floatingValue"
|
|
111
111
|
|
|
112
112
|
Column(modifier = Modifier.semantics {
|
|
113
|
-
contentDescription =
|
|
113
|
+
contentDescription = floatingValue; testTag = testId
|
|
114
114
|
}) {
|
|
115
115
|
BasicTextField(
|
|
116
116
|
enabled = !disabled,
|
|
@@ -97,7 +97,7 @@ fun PopupNotify(
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
Box(Modifier.semantics {
|
|
100
|
-
contentDescription =
|
|
100
|
+
contentDescription = title; testTag = "popup_notify"
|
|
101
101
|
}, contentAlignment = Alignment.TopEnd) {
|
|
102
102
|
Column(
|
|
103
103
|
modifier = Modifier
|
|
@@ -166,7 +166,7 @@ fun PopupNotify(
|
|
|
166
166
|
color = AppTheme.current.colors.background.surface,
|
|
167
167
|
size = 14.dp,
|
|
168
168
|
modifier = Modifier.semantics {
|
|
169
|
-
|
|
169
|
+
testTag = "ic_popup_close"
|
|
170
170
|
}
|
|
171
171
|
)
|
|
172
172
|
}
|
|
@@ -235,7 +235,7 @@ fun renderRow(
|
|
|
235
235
|
title = it.title,
|
|
236
236
|
type = ButtonType.TEXT,
|
|
237
237
|
modifier = Modifier.semantics {
|
|
238
|
-
contentDescription =
|
|
238
|
+
contentDescription = it.title; testTag = "btn_popup_cancel"
|
|
239
239
|
}
|
|
240
240
|
)
|
|
241
241
|
}
|
|
@@ -250,7 +250,7 @@ fun renderRow(
|
|
|
250
250
|
},
|
|
251
251
|
title = primary?.title ?: "",
|
|
252
252
|
modifier = Modifier.semantics {
|
|
253
|
-
contentDescription = "
|
|
253
|
+
contentDescription = primary?.title ?: ""; testTag = "btn_popup_allow"
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
}
|
|
@@ -273,7 +273,7 @@ fun renderColumn(
|
|
|
273
273
|
},
|
|
274
274
|
title = primary?.title ?: "",
|
|
275
275
|
modifier = Modifier.semantics {
|
|
276
|
-
contentDescription = "
|
|
276
|
+
contentDescription = primary?.title ?: ""; testTag = "btn_popup_allow"
|
|
277
277
|
}
|
|
278
278
|
)
|
|
279
279
|
secondary?.let {
|
|
@@ -288,7 +288,7 @@ fun renderColumn(
|
|
|
288
288
|
title = it.title,
|
|
289
289
|
type = ButtonType.TEXT,
|
|
290
290
|
modifier = Modifier.semantics {
|
|
291
|
-
contentDescription =
|
|
291
|
+
contentDescription = it.title; testTag = "btn_popup_cancel"
|
|
292
292
|
}
|
|
293
293
|
)
|
|
294
294
|
}
|
|
@@ -17,7 +17,6 @@ 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
20
|
import androidx.compose.ui.semantics.semantics
|
|
22
21
|
import androidx.compose.ui.semantics.testTag
|
|
23
22
|
import androidx.compose.ui.unit.dp
|
|
@@ -30,7 +29,7 @@ fun PromotionPopup(
|
|
|
30
29
|
source: String = "",
|
|
31
30
|
onClose: (() -> Unit) = {},
|
|
32
31
|
) {
|
|
33
|
-
Column(Modifier.semantics {
|
|
32
|
+
Column(Modifier.semantics { testTag = "popup_notify" }) {
|
|
34
33
|
if (source.isNotEmpty()) {
|
|
35
34
|
Image(
|
|
36
35
|
source = source,
|
|
@@ -69,7 +68,7 @@ fun PromotionPopup(
|
|
|
69
68
|
color = AppTheme.current.colors.background.surface,
|
|
70
69
|
size = 14.dp,
|
|
71
70
|
modifier = Modifier.semantics {
|
|
72
|
-
|
|
71
|
+
testTag = "ic_popup_close"
|
|
73
72
|
}
|
|
74
73
|
)
|
|
75
74
|
}
|
|
@@ -106,7 +106,7 @@ val defaultTheme = Theme(
|
|
|
106
106
|
),
|
|
107
107
|
font = "SFProText",
|
|
108
108
|
assets = ThemeAssets(
|
|
109
|
-
headerBackground =
|
|
109
|
+
headerBackground = "https://static.momocdn.net/app/img/app/img/header-background.png"
|
|
110
110
|
)
|
|
111
111
|
)
|
|
112
112
|
|
|
@@ -168,5 +168,6 @@ val darkTheme = Theme(
|
|
|
168
168
|
|
|
169
169
|
|
|
170
170
|
val AppTheme = staticCompositionLocalOf { defaultTheme }
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
val AppStatusBar = staticCompositionLocalOf<Dp?> {
|
|
172
|
+
null
|
|
173
|
+
}
|
|
@@ -58,6 +58,16 @@ fun getFontFamily(fontFamily: String, fontWeight: FontWeight? = FontWeight.Norma
|
|
|
58
58
|
"MoMoSignature-700" to "momosignature.otf",
|
|
59
59
|
"MoMoSignature-800" to "momosignature.otf",
|
|
60
60
|
"MoMoSignature-900" to "momosignature.otf",
|
|
61
|
+
|
|
62
|
+
"MoMoTrustDisplay-100" to "momotrustdisplay.otf",
|
|
63
|
+
"MoMoTrustDisplay-200" to "momotrustdisplay.otf",
|
|
64
|
+
"MoMoTrustDisplay-300" to "momotrustdisplay.otf",
|
|
65
|
+
"MoMoTrustDisplay-400" to "momotrustdisplay.otf",
|
|
66
|
+
"MoMoTrustDisplay-500" to "momotrustdisplay.otf",
|
|
67
|
+
"MoMoTrustDisplay-600" to "momotrustdisplay.otf",
|
|
68
|
+
"MoMoTrustDisplay-700" to "momotrustdisplay.otf",
|
|
69
|
+
"MoMoTrustDisplay-800" to "momotrustdisplay.otf",
|
|
70
|
+
"MoMoTrustDisplay-900" to "momotrustdisplay.otf",
|
|
61
71
|
)
|
|
62
72
|
val font = fontMap[key] ?: "sfprotext_regular.ttf"
|
|
63
73
|
return getFont(font)
|
|
@@ -1317,7 +1317,5 @@ val Icons = mapOf(
|
|
|
1317
1317
|
"ic_checked" to "https://img.mservice.com.vn/app/img/kits/checked_ic.png",
|
|
1318
1318
|
"ic_minus" to "https://img.mservice.com.vn/app/img/kits/minus.png",
|
|
1319
1319
|
"ic_navigation" to "https://static.momocdn.net/app/img/kits/ic_navigation.png",
|
|
1320
|
-
"ic_money_bag" to "https://static.momocdn.net/app/img/kits/ic_money_bag.png"
|
|
1321
|
-
"help_center" to "https://static.momocdn.net/app/img/kits/ic_money_bag_2.png",
|
|
1322
|
-
"arrow_back" to "https://static.momocdn.net/app/img/kits/arrow-back.png",
|
|
1320
|
+
"ic_money_bag" to "https://static.momocdn.net/app/img/kits/ic_money_bag.png"
|
|
1323
1321
|
)
|