@momo-kits/native-kits 0.157.1-debug → 0.157.1-test.1-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.
- package/compose/build.gradle.kts +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +15 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +9 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +4 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +3 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +4 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +1 -1
- package/gradle.properties +1 -1
- package/local.properties +8 -0
- package/package.json +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
package/compose/build.gradle.kts
CHANGED
|
@@ -78,7 +78,7 @@ fun BadgeRibbon(
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
@Composable
|
|
81
|
-
fun renderRoundContent(label: String, rotate: Float, backgroundColor: Color){
|
|
81
|
+
internal fun renderRoundContent(label: String, rotate: Float, backgroundColor: Color){
|
|
82
82
|
Box(
|
|
83
83
|
modifier = Modifier
|
|
84
84
|
.height(roundHeight)
|
|
@@ -97,7 +97,7 @@ fun renderRoundContent(label: String, rotate: Float, backgroundColor: Color){
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
@Composable
|
|
100
|
-
fun renderSkewContent(label: String, rotate: Float, backgroundColor: Color){
|
|
100
|
+
internal fun renderSkewContent(label: String, rotate: Float, backgroundColor: Color){
|
|
101
101
|
Box(
|
|
102
102
|
modifier = Modifier
|
|
103
103
|
.height(skewBodyHeight)
|
|
@@ -110,7 +110,7 @@ fun renderSkewContent(label: String, rotate: Float, backgroundColor: Color){
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
@Composable
|
|
113
|
-
fun Label(label: String, rotate: Float){
|
|
113
|
+
internal fun Label(label: String, rotate: Float){
|
|
114
114
|
Text(
|
|
115
115
|
text = label,
|
|
116
116
|
color = Colors.black_01,
|
|
@@ -122,7 +122,7 @@ fun Label(label: String, rotate: Float){
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
@Composable
|
|
125
|
-
fun UpTail() {
|
|
125
|
+
internal fun UpTail() {
|
|
126
126
|
Image(
|
|
127
127
|
source = "https://static.momocdn.net/app/img/kits/utils/Head_down_4x.png",
|
|
128
128
|
modifier = Modifier
|
|
@@ -136,7 +136,7 @@ fun UpTail() {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
@Composable
|
|
139
|
-
fun DownTail() {
|
|
139
|
+
internal fun DownTail() {
|
|
140
140
|
Image(
|
|
141
141
|
source = "https://static.momocdn.net/app/img/kits/utils/Head_4x.png",
|
|
142
142
|
modifier = Modifier
|
|
@@ -149,7 +149,7 @@ fun DownTail() {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
@Composable
|
|
152
|
-
fun RightTail() {
|
|
152
|
+
internal fun RightTail() {
|
|
153
153
|
Image(
|
|
154
154
|
source = "https://static.momocdn.net/app/img/kits/utils/Tail_4x.png",
|
|
155
155
|
modifier = Modifier
|
|
@@ -327,14 +327,14 @@ fun RoundedBadgeRibbon(
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
val ribbonHeight: Dp = 20.dp
|
|
331
|
-
val roundHeight: Dp = 16.dp
|
|
332
|
-
val skewBodyHeight: Dp = 16.dp
|
|
333
|
-
val roundRightRadius: Dp = 12.dp
|
|
334
|
-
val roundPaddingEnd: Dp = 6.dp
|
|
335
|
-
val skewTailWidth: Dp = 8.dp
|
|
336
|
-
val skewTailHeight: Dp = 16.dp
|
|
337
|
-
val headTailWidth: Dp = 5.dp
|
|
338
|
-
val headTailHeight: Dp = 20.dp
|
|
330
|
+
internal val ribbonHeight: Dp = 20.dp
|
|
331
|
+
internal val roundHeight: Dp = 16.dp
|
|
332
|
+
internal val skewBodyHeight: Dp = 16.dp
|
|
333
|
+
internal val roundRightRadius: Dp = 12.dp
|
|
334
|
+
internal val roundPaddingEnd: Dp = 6.dp
|
|
335
|
+
internal val skewTailWidth: Dp = 8.dp
|
|
336
|
+
internal val skewTailHeight: Dp = 16.dp
|
|
337
|
+
internal val headTailWidth: Dp = 5.dp
|
|
338
|
+
internal val headTailHeight: Dp = 20.dp
|
|
339
339
|
|
|
340
340
|
enum class RibbonPosition {TopLeft, TopRight, BottomLeft, BottomRight}
|
|
@@ -99,15 +99,15 @@ private val iconSpaceCache = mapOf(
|
|
|
99
99
|
Size.LARGE to Spacing.S
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
-
fun getStyle(size: Size): TextStyle {
|
|
102
|
+
internal fun getStyle(size: Size): TextStyle {
|
|
103
103
|
return styleCache[size] ?: Typography.actionDefaultBold
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
fun getIconSize(size: Size): Dp = iconSizeCache[size] ?: 24.dp
|
|
107
|
-
fun getIconSpace(size: Size): Dp = iconSpaceCache[size] ?: Spacing.S
|
|
106
|
+
internal fun getIconSize(size: Size): Dp = iconSizeCache[size] ?: 24.dp
|
|
107
|
+
internal fun getIconSpace(size: Size): Dp = iconSpaceCache[size] ?: Spacing.S
|
|
108
108
|
|
|
109
109
|
@Composable
|
|
110
|
-
fun getTextColor(loading: Boolean, type: ButtonType): Color {
|
|
110
|
+
internal fun getTextColor(loading: Boolean, type: ButtonType): Color {
|
|
111
111
|
val theme = AppTheme.current
|
|
112
112
|
|
|
113
113
|
return remember(type, theme, loading) {
|
|
@@ -124,7 +124,7 @@ fun getTextColor(loading: Boolean, type: ButtonType): Color {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
@Composable
|
|
127
|
-
fun RenderTitle(size: Size, title: String = "", textColor: Color) {
|
|
127
|
+
internal fun RenderTitle(size: Size, title: String = "", textColor: Color) {
|
|
128
128
|
val style = remember(size) { getStyle(size) }
|
|
129
129
|
Text(
|
|
130
130
|
style = style,
|
|
@@ -136,7 +136,7 @@ fun RenderTitle(size: Size, title: String = "", textColor: Color) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
@Composable
|
|
139
|
-
fun RenderIcon(
|
|
139
|
+
internal fun RenderIcon(
|
|
140
140
|
size: Size,
|
|
141
141
|
isIconLeft: Boolean,
|
|
142
142
|
useTintColor: Boolean = true,
|
|
@@ -186,7 +186,7 @@ private fun shouldLoadingOnLeft(iconLeft: String, iconRight: String): Boolean {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
@Composable
|
|
189
|
-
fun getTypeStyle(
|
|
189
|
+
internal fun getTypeStyle(
|
|
190
190
|
type: ButtonType,
|
|
191
191
|
color: Color? = AppTheme.current.colors.primary,
|
|
192
192
|
size: Size,
|
|
@@ -222,7 +222,7 @@ fun getTypeStyle(
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
@Composable
|
|
225
|
-
fun getButtonBackgroundColor(
|
|
225
|
+
internal fun getButtonBackgroundColor(
|
|
226
226
|
loading: Boolean,
|
|
227
227
|
type: ButtonType
|
|
228
228
|
): Color {
|
|
@@ -241,7 +241,7 @@ fun getButtonBackgroundColor(
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
fun Color.withLoading(loading: Boolean): Color =
|
|
244
|
+
internal fun Color.withLoading(loading: Boolean): Color =
|
|
245
245
|
this.copy(alpha = if (loading) 0.75f else 1f)
|
|
246
246
|
|
|
247
247
|
@Composable
|
|
@@ -56,7 +56,7 @@ private val iconSizeMap = mapOf(
|
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
@Composable
|
|
59
|
-
fun getIconStyle(type: ButtonType, color: Color? = null): Modifier {
|
|
59
|
+
internal fun getIconStyle(type: ButtonType, color: Color? = null): Modifier {
|
|
60
60
|
val theme = AppTheme.current
|
|
61
61
|
|
|
62
62
|
return remember(type, color, theme) {
|
|
@@ -91,7 +91,7 @@ fun getIconStyle(type: ButtonType, color: Color? = null): Modifier {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@Composable
|
|
94
|
-
fun getIconColor(type: ButtonType): Color {
|
|
94
|
+
internal fun getIconColor(type: ButtonType): Color {
|
|
95
95
|
val theme = AppTheme.current
|
|
96
96
|
return remember(type, theme) {
|
|
97
97
|
when (type) {
|
|
@@ -89,7 +89,7 @@ enum class InputFontWeight(val value: FontWeight) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// Consolidated input state for better performance
|
|
92
|
-
data class InputState(
|
|
92
|
+
internal data class InputState(
|
|
93
93
|
val isFocused: Boolean = false,
|
|
94
94
|
val passHidden: Boolean = false,
|
|
95
95
|
val hasBeenBlurred: Boolean = false
|
|
@@ -128,7 +128,7 @@ private class PasswordVisualTransformation(
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
@Composable
|
|
131
|
-
fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color {
|
|
131
|
+
internal fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color {
|
|
132
132
|
val theme = AppTheme.current
|
|
133
133
|
return remember(isFocused, error, disabled, theme) {
|
|
134
134
|
when {
|
|
@@ -141,7 +141,7 @@ fun getBorderColor(isFocused: Boolean, error: String, disabled: Boolean): Color
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
@Composable
|
|
144
|
-
fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
|
144
|
+
internal fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
|
145
145
|
if (loading) {
|
|
146
146
|
Box {
|
|
147
147
|
CircularProgressIndicator(
|
|
@@ -167,7 +167,7 @@ fun RenderRightIcon(loading: Boolean, icon: String, color: Color, onClick: () ->
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
@Composable
|
|
170
|
-
fun ErrorView(errorMessage: String, errorSpacing: Boolean, hintText: String) {
|
|
170
|
+
internal fun ErrorView(errorMessage: String, errorSpacing: Boolean, hintText: String) {
|
|
171
171
|
val theme = AppTheme.current
|
|
172
172
|
val errorColor = remember(theme) { theme.colors.error.primary }
|
|
173
173
|
val hintColor = remember(theme) { theme.colors.text.hint }
|
|
@@ -71,7 +71,7 @@ enum class InputPhoneNumberSize(val values: InputPhoneNumberSizeDetail) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
@Composable
|
|
74
|
-
fun getBorderColor(isFocused: Boolean, error: String): Color {
|
|
74
|
+
private fun getBorderColor(isFocused: Boolean, error: String): Color {
|
|
75
75
|
val theme = AppTheme.current
|
|
76
76
|
return remember(isFocused, error, theme) {
|
|
77
77
|
when {
|
|
@@ -64,7 +64,7 @@ private const val BOX_KEY = "LazyColumnWithBouncing_BOX_KEY"
|
|
|
64
64
|
|
|
65
65
|
@OptIn(ExperimentalMaterialApi::class)
|
|
66
66
|
@Composable
|
|
67
|
-
fun overScrollWithPullToRefresh(
|
|
67
|
+
internal fun overScrollWithPullToRefresh(
|
|
68
68
|
pullRefreshState: PullToRefreshCustomState?,
|
|
69
69
|
): OverscrollEffect {
|
|
70
70
|
val density = LocalDensity.current
|
|
@@ -18,7 +18,7 @@ import vn.momo.kits.const.Spacing
|
|
|
18
18
|
import vn.momo.kits.modifier.conditional
|
|
19
19
|
|
|
20
20
|
@Composable
|
|
21
|
-
fun Dot(active: Boolean = false, activeColor: Color, modifier: Modifier = Modifier) {
|
|
21
|
+
internal fun Dot(active: Boolean = false, activeColor: Color, modifier: Modifier = Modifier) {
|
|
22
22
|
return if (active) {
|
|
23
23
|
Box(
|
|
24
24
|
modifier = modifier.size(width = 12.dp, height = 4.dp).background(
|
|
@@ -28,8 +28,8 @@ import vn.momo.kits.const.Colors
|
|
|
28
28
|
import vn.momo.kits.const.Spacing
|
|
29
29
|
import vn.momo.kits.modifier.conditional
|
|
30
30
|
|
|
31
|
-
val INDICATOR_WIDTH = 24.dp
|
|
32
|
-
val PROGRESS_WIDTH = 72.dp
|
|
31
|
+
internal val INDICATOR_WIDTH = 24.dp
|
|
32
|
+
internal val PROGRESS_WIDTH = 72.dp
|
|
33
33
|
|
|
34
34
|
// Memoized offset calculation to avoid repeated computations during scroll
|
|
35
35
|
private fun calculateOffset(currentPosition: Int, maxBound: Int): Dp {
|
|
@@ -236,7 +236,7 @@ fun PopupNotify(
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
@Composable
|
|
239
|
-
fun BuildAction(
|
|
239
|
+
internal fun BuildAction(
|
|
240
240
|
primary: PopupAction?,
|
|
241
241
|
secondary: PopupAction?,
|
|
242
242
|
buttonDirection: PopupActionDirection = PopupActionDirection.ROW,
|
|
@@ -279,7 +279,7 @@ fun BuildAction(
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
@Composable
|
|
282
|
-
fun renderRow(
|
|
282
|
+
internal fun renderRow(
|
|
283
283
|
secondary: PopupAction?,
|
|
284
284
|
closeAction: MutableState<String>,
|
|
285
285
|
primary: PopupAction?,
|
|
@@ -316,7 +316,7 @@ fun renderRow(
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
@Composable
|
|
319
|
-
fun renderColumn(
|
|
319
|
+
internal fun renderColumn(
|
|
320
320
|
secondary: PopupAction?,
|
|
321
321
|
closeAction: MutableState<String>,
|
|
322
322
|
primary: PopupAction?,
|
|
@@ -26,7 +26,7 @@ import vn.momo.kits.const.Typography
|
|
|
26
26
|
import vn.momo.kits.modifier.conditional
|
|
27
27
|
import vn.momo.kits.modifier.noFeedbackClickable
|
|
28
28
|
|
|
29
|
-
val defaultBanner = TrustBannerData(
|
|
29
|
+
internal val defaultBanner = TrustBannerData(
|
|
30
30
|
content = mapOf(
|
|
31
31
|
"vi" to "An toàn tài sản & Bảo mật thông tin của bạn là ưu tiên hàng đầu của MoMo.",
|
|
32
32
|
"en" to "Ensuring financial security and data privacy is MoMo's highest priority."
|
|
@@ -47,9 +47,9 @@ val defaultBanner = TrustBannerData(
|
|
|
47
47
|
momoImage = "https://static.momocdn.net/app/img/kits/trustBanner/ic_secu.png"
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
-
const val backgroundBlue = 0xFFF2F8FF
|
|
51
|
-
const val contentColor = 0xFF484848
|
|
52
|
-
const val subContentColor = 0xFFEB2F96
|
|
50
|
+
internal const val backgroundBlue = 0xFFF2F8FF
|
|
51
|
+
internal const val contentColor = 0xFF484848
|
|
52
|
+
internal const val subContentColor = 0xFFEB2F96
|
|
53
53
|
|
|
54
54
|
data class TrustBannerData(
|
|
55
55
|
val content: Map<String, String> = mapOf("vi" to "", "en" to ""),
|
package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt
CHANGED
|
@@ -2,7 +2,7 @@ package vn.momo.kits.components.datetimepicker
|
|
|
2
2
|
|
|
3
3
|
import kotlinx.datetime.LocalDateTime
|
|
4
4
|
|
|
5
|
-
data class PickerData(
|
|
5
|
+
internal data class PickerData(
|
|
6
6
|
var day: Int,
|
|
7
7
|
var month: Int,
|
|
8
8
|
var year: Int,
|
|
@@ -23,7 +23,7 @@ data class PickerData(
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
data class DateComponent(
|
|
26
|
+
internal data class DateComponent(
|
|
27
27
|
val name: String,
|
|
28
28
|
val data: List<String>
|
|
29
29
|
)
|
package/gradle.properties
CHANGED
package/local.properties
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Mon Dec 22 10:07:29 ICT 2025
|
|
8
|
+
sdk.dir=/Users/phuc/Library/Android/sdk
|
package/package.json
CHANGED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.components
|
|
2
|
-
|
|
3
|
-
import androidx.compose.foundation.Canvas
|
|
4
|
-
import androidx.compose.foundation.background
|
|
5
|
-
import androidx.compose.foundation.border
|
|
6
|
-
import androidx.compose.foundation.layout.Box
|
|
7
|
-
import androidx.compose.foundation.layout.WindowInsets
|
|
8
|
-
import androidx.compose.foundation.layout.asPaddingValues
|
|
9
|
-
import androidx.compose.foundation.layout.fillMaxHeight
|
|
10
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
11
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
12
|
-
import androidx.compose.foundation.layout.height
|
|
13
|
-
import androidx.compose.foundation.layout.navigationBars
|
|
14
|
-
import androidx.compose.foundation.layout.padding
|
|
15
|
-
import androidx.compose.foundation.layout.width
|
|
16
|
-
import androidx.compose.runtime.Composable
|
|
17
|
-
import androidx.compose.ui.Alignment
|
|
18
|
-
import androidx.compose.ui.Modifier
|
|
19
|
-
import androidx.compose.ui.geometry.Offset
|
|
20
|
-
import androidx.compose.ui.graphics.Color
|
|
21
|
-
import androidx.compose.ui.graphics.PathEffect
|
|
22
|
-
import androidx.compose.ui.graphics.StrokeCap
|
|
23
|
-
import androidx.compose.ui.unit.dp
|
|
24
|
-
import io.ktor.util.Platform
|
|
25
|
-
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
26
|
-
import vn.momo.kits.const.Colors
|
|
27
|
-
import vn.momo.kits.modifier.conditional
|
|
28
|
-
import vn.momo.kits.platform.getPlatformName
|
|
29
|
-
import vn.momo.kits.platform.getStatusBarHeight
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* A debug overlay that draws danger/warning baseline guides on top of the screen.
|
|
33
|
-
*
|
|
34
|
-
* Highlights safe-area boundaries, header regions, and bottom navigation zones
|
|
35
|
-
* using colored solid or dotted lines and semi-transparent red zones.
|
|
36
|
-
*
|
|
37
|
-
* @param enabled When `false` the composable renders nothing. Pass `false` when
|
|
38
|
-
* your QC automation flag is active to suppress the overlay.
|
|
39
|
-
*/
|
|
40
|
-
@Composable
|
|
41
|
-
fun BaselineView(enabled: Boolean = true) {
|
|
42
|
-
if (!enabled) return
|
|
43
|
-
|
|
44
|
-
val bottomInsetHeight = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()
|
|
45
|
-
val topInset = if (getPlatformName() == "Android") getStatusBarHeight() - 14.dp else getStatusBarHeight()
|
|
46
|
-
val bottomInset = if (getPlatformName() == "iOS") minOf(bottomInsetHeight, 21.dp) else bottomInsetHeight
|
|
47
|
-
|
|
48
|
-
Box(modifier = Modifier.fillMaxSize()) {
|
|
49
|
-
// Danger zones
|
|
50
|
-
Box(
|
|
51
|
-
modifier = Modifier
|
|
52
|
-
.fillMaxWidth()
|
|
53
|
-
.height(topInset)
|
|
54
|
-
.background(Color.Red.copy(alpha = 0.15f))
|
|
55
|
-
)
|
|
56
|
-
Box(
|
|
57
|
-
modifier = Modifier
|
|
58
|
-
.width(12.dp)
|
|
59
|
-
.fillMaxHeight()
|
|
60
|
-
.padding(top = topInset, bottom = bottomInset)
|
|
61
|
-
.background(Color.Red.copy(alpha = 0.15f))
|
|
62
|
-
)
|
|
63
|
-
Box(
|
|
64
|
-
modifier = Modifier
|
|
65
|
-
.width(12.dp)
|
|
66
|
-
.fillMaxHeight()
|
|
67
|
-
.padding(top = topInset, bottom = bottomInset)
|
|
68
|
-
.background(Color.Red.copy(alpha = 0.15f))
|
|
69
|
-
.align(Alignment.TopEnd)
|
|
70
|
-
)
|
|
71
|
-
Box(
|
|
72
|
-
modifier = Modifier
|
|
73
|
-
.fillMaxWidth()
|
|
74
|
-
.height(bottomInset)
|
|
75
|
-
.background(Color.Red.copy(alpha = 0.15f))
|
|
76
|
-
.align(Alignment.BottomCenter)
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
// Danger lines
|
|
80
|
-
BaselineDottedLine(
|
|
81
|
-
Modifier
|
|
82
|
-
.padding(top = topInset)
|
|
83
|
-
.fillMaxWidth(),
|
|
84
|
-
isDotted = false,
|
|
85
|
-
color = Color(0xFFE400FF)
|
|
86
|
-
)
|
|
87
|
-
BaselineDottedLine(
|
|
88
|
-
Modifier
|
|
89
|
-
.padding(top = topInset + 52.dp)
|
|
90
|
-
.fillMaxWidth(),
|
|
91
|
-
color = Color(0xFFE400FF)
|
|
92
|
-
)
|
|
93
|
-
BaselineDottedLine(
|
|
94
|
-
Modifier
|
|
95
|
-
.padding(top = topInset + 104.dp)
|
|
96
|
-
.fillMaxWidth(),
|
|
97
|
-
color = Color(0xFFE400FF)
|
|
98
|
-
)
|
|
99
|
-
BaselineDottedLine(
|
|
100
|
-
Modifier
|
|
101
|
-
.padding(bottom = bottomInset + 64.dp)
|
|
102
|
-
.fillMaxWidth()
|
|
103
|
-
.align(Alignment.BottomCenter),
|
|
104
|
-
color = Color(0xFFE400FF)
|
|
105
|
-
)
|
|
106
|
-
BaselineDottedLine(
|
|
107
|
-
Modifier
|
|
108
|
-
.padding(bottom = bottomInset)
|
|
109
|
-
.fillMaxWidth()
|
|
110
|
-
.align(Alignment.BottomCenter),
|
|
111
|
-
isDotted = false,
|
|
112
|
-
color = Color(0xFFE400FF)
|
|
113
|
-
)
|
|
114
|
-
BaselineDottedLine(
|
|
115
|
-
Modifier
|
|
116
|
-
.padding(start = 12.dp)
|
|
117
|
-
.fillMaxHeight(),
|
|
118
|
-
orientation = BaselineOrientation.Vertical,
|
|
119
|
-
isDotted = false,
|
|
120
|
-
color = Color(0xFFE400FF)
|
|
121
|
-
)
|
|
122
|
-
BaselineDottedLine(
|
|
123
|
-
Modifier
|
|
124
|
-
.padding(end = 12.dp)
|
|
125
|
-
.fillMaxHeight()
|
|
126
|
-
.align(Alignment.BottomEnd),
|
|
127
|
-
orientation = BaselineOrientation.Vertical,
|
|
128
|
-
isDotted = false,
|
|
129
|
-
color = Color(0xFFE400FF)
|
|
130
|
-
)
|
|
131
|
-
|
|
132
|
-
// Warning lines
|
|
133
|
-
BaselineDottedLine(
|
|
134
|
-
Modifier
|
|
135
|
-
.padding(top = topInset + 26.dp)
|
|
136
|
-
.fillMaxWidth(),
|
|
137
|
-
color = Color(0xFFFF7A00)
|
|
138
|
-
)
|
|
139
|
-
BaselineDottedLine(
|
|
140
|
-
Modifier
|
|
141
|
-
.padding(bottom = bottomInset + 56.dp)
|
|
142
|
-
.fillMaxWidth()
|
|
143
|
-
.align(Alignment.BottomCenter),
|
|
144
|
-
color = Color(0xFFFFCC00)
|
|
145
|
-
)
|
|
146
|
-
BaselineDottedLine(
|
|
147
|
-
Modifier
|
|
148
|
-
.padding(bottom = bottomInset + 8.dp)
|
|
149
|
-
.fillMaxWidth()
|
|
150
|
-
.align(Alignment.BottomCenter),
|
|
151
|
-
color = Color(0xFFFFCC00)
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
// Header background warning lines
|
|
155
|
-
BaselineDottedLine(
|
|
156
|
-
Modifier
|
|
157
|
-
.padding(start = 40.dp, top = topInset)
|
|
158
|
-
.height(52.dp),
|
|
159
|
-
color = Color(0xFF00C520),
|
|
160
|
-
orientation = BaselineOrientation.Vertical
|
|
161
|
-
)
|
|
162
|
-
BaselineDottedLine(
|
|
163
|
-
Modifier
|
|
164
|
-
.padding(start = 48.dp, top = topInset)
|
|
165
|
-
.height(52.dp),
|
|
166
|
-
color = Color(0xFF00C520),
|
|
167
|
-
orientation = BaselineOrientation.Vertical
|
|
168
|
-
)
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
enum class BaselineOrientation { Horizontal, Vertical }
|
|
173
|
-
|
|
174
|
-
@Composable
|
|
175
|
-
fun BaselineDottedLine(
|
|
176
|
-
modifier: Modifier = Modifier,
|
|
177
|
-
color: Color = Color.Red,
|
|
178
|
-
orientation: BaselineOrientation = BaselineOrientation.Horizontal,
|
|
179
|
-
isDotted: Boolean = true
|
|
180
|
-
) {
|
|
181
|
-
Canvas(modifier = modifier) {
|
|
182
|
-
val pathEffect = if (isDotted) PathEffect.dashPathEffect(floatArrayOf(8f, 8f)) else null
|
|
183
|
-
drawLine(
|
|
184
|
-
color = color,
|
|
185
|
-
start = if (orientation == BaselineOrientation.Horizontal) Offset(
|
|
186
|
-
0f,
|
|
187
|
-
size.height / 2
|
|
188
|
-
) else Offset(size.width / 2, 0f),
|
|
189
|
-
end = if (orientation == BaselineOrientation.Horizontal) Offset(
|
|
190
|
-
size.width,
|
|
191
|
-
size.height / 2
|
|
192
|
-
) else Offset(size.width / 2, size.height),
|
|
193
|
-
strokeWidth = 1.dp.toPx(),
|
|
194
|
-
pathEffect = pathEffect,
|
|
195
|
-
cap = StrokeCap.Round,
|
|
196
|
-
)
|
|
197
|
-
}
|
|
198
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.components
|
|
2
|
-
|
|
3
|
-
import androidx.compose.runtime.Composable
|
|
4
|
-
import androidx.compose.runtime.CompositionLocalProvider
|
|
5
|
-
import vn.momo.kits.application.ScaleSizeMaxRate
|
|
6
|
-
|
|
7
|
-
@Composable
|
|
8
|
-
fun ScaleSizeScope(
|
|
9
|
-
scaleSizeMaxRate: Float? = null,
|
|
10
|
-
content: @Composable () -> Unit
|
|
11
|
-
) {
|
|
12
|
-
CompositionLocalProvider(
|
|
13
|
-
ScaleSizeMaxRate provides scaleSizeMaxRate,
|
|
14
|
-
) {
|
|
15
|
-
content()
|
|
16
|
-
}
|
|
17
|
-
}
|