@momo-kits/native-kits 0.162.2-test.2-debug → 0.162.2-test.21-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/.claude/settings.local.json +14 -0
- package/CLAUDE.md +78 -0
- package/compose/build.gradle.kts +12 -8
- package/compose/build.gradle.kts.backup +15 -11
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +2 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +6 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +4 -19
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +1 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +6 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +6 -101
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +5 -19
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +8 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +22 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +27 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +3 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +30 -31
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +3 -18
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +69 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +84 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +13 -71
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +10 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +4 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +16 -75
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +5 -26
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +3 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +16 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +2 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +4 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -28
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +8 -47
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +4 -25
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +2 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +1 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +1 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +50 -111
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +4 -96
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +5 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +2 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +9 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +9 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +8 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +7 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +94 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +3 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +12 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +33 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +48 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +91 -63
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +9 -14
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +13 -31
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +6 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +11 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +2 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +9 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +3 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +3 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +1 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +2 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +3 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +2 -3
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -2
- package/gradle/libs.versions.toml +2 -0
- package/gradle.properties +1 -1
- package/ios/Application/Components.swift +1 -0
- package/ios/Application/FloatingButton.swift +1 -0
- package/ios/Badge/Badge.swift +1 -0
- package/ios/Badge/BadgeRibbon.swift +2 -0
- package/ios/Button/Button.swift +1 -1
- package/ios/Checkbox/Checkbox.swift +1 -0
- package/ios/Information/Information.swift +151 -0
- package/ios/Input/Input.swift +1 -0
- package/ios/Input/InputPhoneNumber.swift +1 -0
- package/ios/Input/InputSearch.swift +3 -0
- package/ios/Input/InputTextArea.swift +1 -0
- package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +6 -0
- package/ios/Popup/PopupInput.swift +2 -0
- package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
- package/ios/Typography/Text.swift +1 -0
- package/ios/Typography/Typography.swift +14 -5
- package/local.properties +2 -2
- package/package.json +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FontScaleStore.kt +0 -77
- package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +0 -32
- package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +0 -16
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -60
|
@@ -4,25 +4,11 @@ import androidx.compose.foundation.background
|
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.clickable
|
|
6
6
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
7
|
-
import androidx.compose.foundation.layout
|
|
8
|
-
import androidx.compose.foundation.layout.Column
|
|
9
|
-
import androidx.compose.foundation.layout.Row
|
|
10
|
-
import androidx.compose.foundation.layout.Spacer
|
|
11
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
12
|
-
import androidx.compose.foundation.layout.height
|
|
13
|
-
import androidx.compose.foundation.layout.offset
|
|
14
|
-
import androidx.compose.foundation.layout.padding
|
|
15
|
-
import androidx.compose.foundation.layout.width
|
|
16
|
-
import androidx.compose.foundation.layout.wrapContentSize
|
|
7
|
+
import androidx.compose.foundation.layout.*
|
|
17
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
18
9
|
import androidx.compose.foundation.text.BasicTextField
|
|
19
10
|
import androidx.compose.foundation.text.KeyboardOptions
|
|
20
|
-
import androidx.compose.runtime
|
|
21
|
-
import androidx.compose.runtime.MutableState
|
|
22
|
-
import androidx.compose.runtime.getValue
|
|
23
|
-
import androidx.compose.runtime.mutableStateOf
|
|
24
|
-
import androidx.compose.runtime.remember
|
|
25
|
-
import androidx.compose.runtime.setValue
|
|
11
|
+
import androidx.compose.runtime.*
|
|
26
12
|
import androidx.compose.ui.Alignment
|
|
27
13
|
import androidx.compose.ui.Modifier
|
|
28
14
|
import androidx.compose.ui.focus.onFocusChanged
|
|
@@ -33,16 +19,14 @@ import androidx.compose.ui.unit.Dp
|
|
|
33
19
|
import androidx.compose.ui.unit.dp
|
|
34
20
|
import androidx.compose.ui.unit.sp
|
|
35
21
|
import androidx.compose.ui.zIndex
|
|
36
|
-
import vn.momo.kits.const.AppTheme
|
|
37
|
-
import vn.momo.kits.const.Spacing
|
|
38
22
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
39
|
-
import vn.momo.kits.const
|
|
40
|
-
import vn.momo.kits.
|
|
41
|
-
import vn.momo.kits.const.scaleSize
|
|
23
|
+
import vn.momo.kits.const.*
|
|
24
|
+
import vn.momo.kits.modifier.InternalApi
|
|
42
25
|
import vn.momo.kits.modifier.conditional
|
|
43
26
|
|
|
27
|
+
@InternalApi
|
|
44
28
|
const val MAX_LENGTH = 300
|
|
45
|
-
val DEFAULT_HEIGHT = 104.dp
|
|
29
|
+
internal val DEFAULT_HEIGHT = 104.dp
|
|
46
30
|
|
|
47
31
|
@Composable
|
|
48
32
|
fun InputTextArea(
|
|
@@ -71,24 +55,8 @@ fun InputTextArea(
|
|
|
71
55
|
) {
|
|
72
56
|
var isFocused by remember { mutableStateOf(false) }
|
|
73
57
|
var isBlurred = false
|
|
74
|
-
val
|
|
75
|
-
|
|
76
|
-
var placeholderColor = AppTheme.current.colors.text.hint
|
|
77
|
-
var iconTintColor = iconColor
|
|
78
|
-
val floatingTitleColor = when {
|
|
79
|
-
disabled -> AppTheme.current.colors.text.disable
|
|
80
|
-
else -> floatingValueColor
|
|
81
|
-
}
|
|
82
|
-
val floatingIconTintColor = when {
|
|
83
|
-
disabled -> AppTheme.current.colors.text.disable
|
|
84
|
-
else -> floatingIconColor
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (disabled) {
|
|
88
|
-
textColor = disabledColor
|
|
89
|
-
placeholderColor = disabledColor
|
|
90
|
-
iconTintColor = disabledColor
|
|
91
|
-
}
|
|
58
|
+
val (textColor, placeholderColor, iconTintColor, floatingTitleColor, floatingIconTintColor) =
|
|
59
|
+
getInputColors(disabled, iconColor, floatingValueColor, floatingIconColor)
|
|
92
60
|
|
|
93
61
|
val fontSize = 16.sp
|
|
94
62
|
val lineHeight = 24.sp
|
|
@@ -125,41 +93,14 @@ fun InputTextArea(
|
|
|
125
93
|
},
|
|
126
94
|
decorationBox = { innerTextField ->
|
|
127
95
|
// Floating Icon
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
modifier = Modifier
|
|
137
|
-
.padding(horizontal = Spacing.S),
|
|
138
|
-
verticalAlignment = Alignment.CenterVertically
|
|
139
|
-
) {
|
|
140
|
-
Text(
|
|
141
|
-
floatingValue,
|
|
142
|
-
style = Typography.labelSMedium,
|
|
143
|
-
color = floatingTitleColor
|
|
144
|
-
)
|
|
145
|
-
if (required) {
|
|
146
|
-
Text(
|
|
147
|
-
"*",
|
|
148
|
-
style = Typography.labelSMedium,
|
|
149
|
-
color = AppTheme.current.colors.error.primary,
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
if (floatingIcon.isNotEmpty()) {
|
|
153
|
-
Icon(
|
|
154
|
-
source = floatingIcon,
|
|
155
|
-
modifier = Modifier.padding(start = Spacing.XS),
|
|
156
|
-
size = 16.dp,
|
|
157
|
-
color = floatingIconTintColor
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
96
|
+
FloatingLabel(
|
|
97
|
+
floatingValue = floatingValue,
|
|
98
|
+
floatingIcon = floatingIcon,
|
|
99
|
+
titleColor = floatingTitleColor,
|
|
100
|
+
iconColor = floatingIconTintColor,
|
|
101
|
+
offsetY = -scaleHeight / 2,
|
|
102
|
+
required = required,
|
|
103
|
+
)
|
|
163
104
|
//input box wrapper
|
|
164
105
|
Box(
|
|
165
106
|
modifier = Modifier.fillMaxWidth()
|
|
@@ -1,39 +1,18 @@
|
|
|
1
1
|
package vn.momo.kits.components
|
|
2
2
|
|
|
3
|
-
import androidx.compose.animation.core
|
|
4
|
-
import androidx.compose.animation.core.RepeatMode
|
|
5
|
-
import androidx.compose.animation.core.animateFloat
|
|
6
|
-
import androidx.compose.animation.core.infiniteRepeatable
|
|
7
|
-
import androidx.compose.animation.core.rememberInfiniteTransition
|
|
8
|
-
import androidx.compose.animation.core.tween
|
|
3
|
+
import androidx.compose.animation.core.*
|
|
9
4
|
import androidx.compose.foundation.Canvas
|
|
10
5
|
import androidx.compose.foundation.OverscrollEffect
|
|
11
6
|
import androidx.compose.foundation.background
|
|
12
7
|
import androidx.compose.foundation.gestures.FlingBehavior
|
|
13
8
|
import androidx.compose.foundation.gestures.ScrollableDefaults
|
|
14
|
-
import androidx.compose.foundation.layout
|
|
15
|
-
import androidx.compose.foundation.
|
|
16
|
-
import androidx.compose.foundation.layout.PaddingValues
|
|
17
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
18
|
-
import androidx.compose.foundation.layout.padding
|
|
19
|
-
import androidx.compose.foundation.layout.size
|
|
20
|
-
import androidx.compose.foundation.lazy.LazyColumn
|
|
21
|
-
import androidx.compose.foundation.lazy.LazyListLayoutInfo
|
|
22
|
-
import androidx.compose.foundation.lazy.LazyListScope
|
|
23
|
-
import androidx.compose.foundation.lazy.LazyListState
|
|
24
|
-
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
9
|
+
import androidx.compose.foundation.layout.*
|
|
10
|
+
import androidx.compose.foundation.lazy.*
|
|
25
11
|
import androidx.compose.material.ExperimentalMaterialApi
|
|
26
12
|
import androidx.compose.material.pullrefresh.PullRefreshIndicator
|
|
27
13
|
import androidx.compose.material.pullrefresh.pullRefresh
|
|
28
14
|
import androidx.compose.material.pullrefresh.rememberPullRefreshState
|
|
29
|
-
import androidx.compose.runtime
|
|
30
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
31
|
-
import androidx.compose.runtime.MutableState
|
|
32
|
-
import androidx.compose.runtime.State
|
|
33
|
-
import androidx.compose.runtime.mutableIntStateOf
|
|
34
|
-
import androidx.compose.runtime.mutableStateOf
|
|
35
|
-
import androidx.compose.runtime.remember
|
|
36
|
-
import androidx.compose.runtime.snapshotFlow
|
|
15
|
+
import androidx.compose.runtime.*
|
|
37
16
|
import androidx.compose.ui.Alignment
|
|
38
17
|
import androidx.compose.ui.Modifier
|
|
39
18
|
import androidx.compose.ui.composed
|
|
@@ -64,7 +43,7 @@ private const val BOX_KEY = "LazyColumnWithBouncing_BOX_KEY"
|
|
|
64
43
|
|
|
65
44
|
@OptIn(ExperimentalMaterialApi::class)
|
|
66
45
|
@Composable
|
|
67
|
-
fun overScrollWithPullToRefresh(
|
|
46
|
+
internal fun overScrollWithPullToRefresh(
|
|
68
47
|
pullRefreshState: PullToRefreshCustomState?,
|
|
69
48
|
): OverscrollEffect {
|
|
70
49
|
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(
|
|
@@ -3,14 +3,7 @@ package vn.momo.kits.components
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.horizontalScroll
|
|
6
|
-
import androidx.compose.foundation.layout
|
|
7
|
-
import androidx.compose.foundation.layout.Column
|
|
8
|
-
import androidx.compose.foundation.layout.Row
|
|
9
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
10
|
-
import androidx.compose.foundation.layout.height
|
|
11
|
-
import androidx.compose.foundation.layout.offset
|
|
12
|
-
import androidx.compose.foundation.layout.padding
|
|
13
|
-
import androidx.compose.foundation.layout.width
|
|
6
|
+
import androidx.compose.foundation.layout.*
|
|
14
7
|
import androidx.compose.foundation.rememberScrollState
|
|
15
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
9
|
import androidx.compose.runtime.Composable
|
|
@@ -28,10 +21,9 @@ import vn.momo.kits.const.Colors
|
|
|
28
21
|
import vn.momo.kits.const.Spacing
|
|
29
22
|
import vn.momo.kits.modifier.conditional
|
|
30
23
|
|
|
31
|
-
val INDICATOR_WIDTH = 24.dp
|
|
32
|
-
val PROGRESS_WIDTH = 72.dp
|
|
24
|
+
private val INDICATOR_WIDTH = 24.dp
|
|
25
|
+
private val PROGRESS_WIDTH = 72.dp
|
|
33
26
|
|
|
34
|
-
// Memoized offset calculation to avoid repeated computations during scroll
|
|
35
27
|
private fun calculateOffset(currentPosition: Int, maxBound: Int): Dp {
|
|
36
28
|
return if (maxBound == 0) 0.dp else {
|
|
37
29
|
(PROGRESS_WIDTH - INDICATOR_WIDTH) * (currentPosition / maxBound.toFloat())
|
|
@@ -4,42 +4,22 @@ import androidx.compose.foundation.background
|
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.clickable
|
|
6
6
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
7
|
-
import androidx.compose.foundation.layout
|
|
8
|
-
import androidx.compose.foundation.layout.Box
|
|
9
|
-
import androidx.compose.foundation.layout.Column
|
|
10
|
-
import androidx.compose.foundation.layout.Row
|
|
11
|
-
import androidx.compose.foundation.layout.Spacer
|
|
12
|
-
import androidx.compose.foundation.layout.aspectRatio
|
|
13
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
14
|
-
import androidx.compose.foundation.layout.height
|
|
15
|
-
import androidx.compose.foundation.layout.offset
|
|
16
|
-
import androidx.compose.foundation.layout.padding
|
|
17
|
-
import androidx.compose.foundation.layout.width
|
|
7
|
+
import androidx.compose.foundation.layout.*
|
|
18
8
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
19
9
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
20
|
-
import androidx.compose.runtime
|
|
21
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
22
|
-
import androidx.compose.runtime.MutableState
|
|
23
|
-
import androidx.compose.runtime.getValue
|
|
24
|
-
import androidx.compose.runtime.mutableStateOf
|
|
25
|
-
import androidx.compose.runtime.remember
|
|
26
|
-
import androidx.compose.runtime.setValue
|
|
10
|
+
import androidx.compose.runtime.*
|
|
27
11
|
import androidx.compose.ui.Alignment
|
|
28
12
|
import androidx.compose.ui.Modifier
|
|
29
13
|
import androidx.compose.ui.draw.clip
|
|
14
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
30
15
|
import androidx.compose.ui.text.TextLayoutResult
|
|
16
|
+
import androidx.compose.ui.unit.Dp
|
|
31
17
|
import androidx.compose.ui.unit.dp
|
|
32
|
-
import vn.momo.kits.const.AppTheme
|
|
33
|
-
import vn.momo.kits.const.Radius
|
|
34
|
-
import vn.momo.kits.const.Spacing
|
|
35
18
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
36
|
-
import vn.momo.kits.
|
|
37
|
-
import vn.momo.kits.const
|
|
19
|
+
import vn.momo.kits.application.LocalLocalize
|
|
20
|
+
import vn.momo.kits.const.*
|
|
38
21
|
import vn.momo.kits.modifier.conditional
|
|
39
22
|
import vn.momo.kits.modifier.setAutomationId
|
|
40
|
-
import androidx.compose.ui.platform.LocalDensity
|
|
41
|
-
import androidx.compose.ui.unit.Dp
|
|
42
|
-
import vn.momo.kits.application.AppLanguage
|
|
43
23
|
import kotlin.math.min
|
|
44
24
|
|
|
45
25
|
data class PopupAction(
|
|
@@ -55,9 +35,8 @@ enum class PopupActionDirection {
|
|
|
55
35
|
|
|
56
36
|
private fun heightForLines(
|
|
57
37
|
layout: TextLayoutResult,
|
|
58
|
-
targetLines: Float
|
|
59
38
|
): Float {
|
|
60
|
-
val clampedLines =
|
|
39
|
+
val clampedLines = (8.5f).coerceAtLeast(1f)
|
|
61
40
|
val wholeLines = kotlin.math.floor(clampedLines).toInt()
|
|
62
41
|
val fractionalPart = clampedLines - wholeLines
|
|
63
42
|
|
|
@@ -104,14 +83,11 @@ fun PopupNotify(
|
|
|
104
83
|
}
|
|
105
84
|
}
|
|
106
85
|
|
|
107
|
-
val language = AppLanguage.current ?: "vi"
|
|
108
|
-
val errorCode: Map<String, String> = mapOf("vi" to "Mã lỗi: ", "en" to "Error code: ")
|
|
109
|
-
|
|
110
86
|
LaunchedEffect(layoutResult.value) {
|
|
111
87
|
layoutResult.value?.let { v ->
|
|
112
88
|
// cap visible height at ~8.5 lines
|
|
113
89
|
val textPx = v.size.height.toFloat()
|
|
114
|
-
val capPx = heightForLines(v
|
|
90
|
+
val capPx = heightForLines(v)
|
|
115
91
|
|
|
116
92
|
isScroll = textPx >= capPx
|
|
117
93
|
scrollHeight = with(density) { min(textPx, capPx).toDp() }
|
|
@@ -182,7 +158,7 @@ fun PopupNotify(
|
|
|
182
158
|
content(Modifier.padding(top = Spacing.S))
|
|
183
159
|
if (props.error.isNotEmpty()) {
|
|
184
160
|
Text(
|
|
185
|
-
text = errorCode
|
|
161
|
+
text = LocalLocalize.current.translate("errorCode") + props.error,
|
|
186
162
|
style = Typography.descriptionXsRegular,
|
|
187
163
|
color = AppTheme.current.colors.text.hint,
|
|
188
164
|
maxLines = 1,
|
|
@@ -236,7 +212,7 @@ fun PopupNotify(
|
|
|
236
212
|
}
|
|
237
213
|
|
|
238
214
|
@Composable
|
|
239
|
-
fun BuildAction(
|
|
215
|
+
internal fun BuildAction(
|
|
240
216
|
primary: PopupAction?,
|
|
241
217
|
secondary: PopupAction?,
|
|
242
218
|
buttonDirection: PopupActionDirection = PopupActionDirection.ROW,
|
|
@@ -246,14 +222,14 @@ fun BuildAction(
|
|
|
246
222
|
when (buttonDirection) {
|
|
247
223
|
PopupActionDirection.AUTO -> {
|
|
248
224
|
if (secondary != null && (secondary.title.length > 12 || primary?.title?.length!! > 12)) {
|
|
249
|
-
|
|
225
|
+
RenderColumn(
|
|
250
226
|
secondary = secondary,
|
|
251
227
|
onAction = onAction,
|
|
252
228
|
closeAction = closeAction,
|
|
253
229
|
primary = primary
|
|
254
230
|
)
|
|
255
231
|
} else {
|
|
256
|
-
|
|
232
|
+
RenderRow(
|
|
257
233
|
secondary = secondary,
|
|
258
234
|
onAction = onAction,
|
|
259
235
|
closeAction = closeAction,
|
|
@@ -262,14 +238,14 @@ fun BuildAction(
|
|
|
262
238
|
}
|
|
263
239
|
}
|
|
264
240
|
|
|
265
|
-
PopupActionDirection.ROW ->
|
|
241
|
+
PopupActionDirection.ROW -> RenderRow(
|
|
266
242
|
secondary = secondary,
|
|
267
243
|
onAction = onAction,
|
|
268
244
|
closeAction = closeAction,
|
|
269
245
|
primary = primary
|
|
270
246
|
)
|
|
271
247
|
|
|
272
|
-
else ->
|
|
248
|
+
else -> RenderColumn(
|
|
273
249
|
secondary = secondary,
|
|
274
250
|
onAction = onAction,
|
|
275
251
|
closeAction = closeAction,
|
|
@@ -279,7 +255,7 @@ fun BuildAction(
|
|
|
279
255
|
}
|
|
280
256
|
|
|
281
257
|
@Composable
|
|
282
|
-
fun
|
|
258
|
+
internal fun RenderRow(
|
|
283
259
|
secondary: PopupAction?,
|
|
284
260
|
closeAction: MutableState<String>,
|
|
285
261
|
primary: PopupAction?,
|
|
@@ -316,7 +292,7 @@ fun renderRow(
|
|
|
316
292
|
}
|
|
317
293
|
|
|
318
294
|
@Composable
|
|
319
|
-
fun
|
|
295
|
+
internal fun RenderColumn(
|
|
320
296
|
secondary: PopupAction?,
|
|
321
297
|
closeAction: MutableState<String>,
|
|
322
298
|
primary: PopupAction?,
|
|
@@ -4,13 +4,7 @@ import androidx.compose.foundation.background
|
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
5
|
import androidx.compose.foundation.clickable
|
|
6
6
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
7
|
-
import androidx.compose.foundation.layout
|
|
8
|
-
import androidx.compose.foundation.layout.Column
|
|
9
|
-
import androidx.compose.foundation.layout.aspectRatio
|
|
10
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
11
|
-
import androidx.compose.foundation.layout.height
|
|
12
|
-
import androidx.compose.foundation.layout.padding
|
|
13
|
-
import androidx.compose.foundation.layout.width
|
|
7
|
+
import androidx.compose.foundation.layout.*
|
|
14
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
15
9
|
import androidx.compose.runtime.Composable
|
|
16
10
|
import androidx.compose.runtime.remember
|
|
@@ -19,10 +13,10 @@ import androidx.compose.ui.Modifier
|
|
|
19
13
|
import androidx.compose.ui.draw.clip
|
|
20
14
|
import androidx.compose.ui.layout.ContentScale
|
|
21
15
|
import androidx.compose.ui.unit.dp
|
|
22
|
-
import vn.momo.kits.const.AppTheme
|
|
23
|
-
import vn.momo.kits.const.Radius
|
|
24
16
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
17
|
+
import vn.momo.kits.const.AppTheme
|
|
25
18
|
import vn.momo.kits.const.Colors
|
|
19
|
+
import vn.momo.kits.const.Radius
|
|
26
20
|
import vn.momo.kits.const.Spacing
|
|
27
21
|
import vn.momo.kits.modifier.conditional
|
|
28
22
|
import vn.momo.kits.modifier.setAutomationId
|
|
@@ -18,8 +18,6 @@ import vn.momo.kits.application.IsShowBaseLineDebug
|
|
|
18
18
|
import vn.momo.kits.const.*
|
|
19
19
|
import vn.momo.kits.modifier.conditional
|
|
20
20
|
|
|
21
|
-
// ─── Data model ───────────────────────────────────────────────────────────────
|
|
22
|
-
|
|
23
21
|
data class ProgressInfoItem(
|
|
24
22
|
val title: String,
|
|
25
23
|
val description: String? = null,
|
|
@@ -29,25 +27,6 @@ enum class ProgressInfoSize { Small, Large }
|
|
|
29
27
|
|
|
30
28
|
enum class ProgressInfoAlign { Left, Right, Center, Stretch }
|
|
31
29
|
|
|
32
|
-
// ─── Public entry-point ───────────────────────────────────────────────────────
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Display-only step progress indicator migrated from the React Native ProgressInfo component.
|
|
36
|
-
*
|
|
37
|
-
* @param steps Ordered list of steps; each has a [ProgressInfoItem.title] and an
|
|
38
|
-
* optional [ProgressInfoItem.description].
|
|
39
|
-
* @param horizontal When `true` renders steps in a horizontal row with connector lines;
|
|
40
|
-
* when `false` (default) renders a vertical column.
|
|
41
|
-
* @param size Icon diameter: [ProgressInfoSize.Small] = 16 dp,
|
|
42
|
-
* [ProgressInfoSize.Large] = 24 dp (default).
|
|
43
|
-
* @param useNumber Show the 1-based step index inside the icon instead of the default dot.
|
|
44
|
-
* @param align Alignment of icon + text for the horizontal variant.
|
|
45
|
-
* @param showTitle Whether step titles are rendered (default `true`).
|
|
46
|
-
* @param showDescription Whether step descriptions are rendered (default `true`).
|
|
47
|
-
* @param customIcon Icon source key rendered inside each step circle (overrides the dot;
|
|
48
|
-
* itself overridden by [useNumber]).
|
|
49
|
-
* @param modifier Modifier applied to the root layout.
|
|
50
|
-
*/
|
|
51
30
|
@Composable
|
|
52
31
|
fun ProgressInfo(
|
|
53
32
|
steps: List<ProgressInfoItem>,
|
|
@@ -84,8 +63,6 @@ fun ProgressInfo(
|
|
|
84
63
|
}
|
|
85
64
|
}
|
|
86
65
|
|
|
87
|
-
// ─── Horizontal variant ───────────────────────────────────────────────────────
|
|
88
|
-
|
|
89
66
|
@Composable
|
|
90
67
|
private fun ProgressInfoHorizontal(
|
|
91
68
|
steps: List<ProgressInfoItem>,
|
|
@@ -190,7 +167,6 @@ private fun ProgressInfoHorizontal(
|
|
|
190
167
|
}
|
|
191
168
|
}
|
|
192
169
|
|
|
193
|
-
// ─── Vertical variant ─────────────────────────────────────────────────────────
|
|
194
170
|
|
|
195
171
|
@Composable
|
|
196
172
|
private fun ProgressInfoVertical(
|
|
@@ -275,8 +251,6 @@ private fun ProgressInfoVertical(
|
|
|
275
251
|
}
|
|
276
252
|
}
|
|
277
253
|
|
|
278
|
-
// ─── Step icon ────────────────────────────────────────────────────────────────
|
|
279
|
-
|
|
280
254
|
@Composable
|
|
281
255
|
private fun ProgressInfoStepIcon(
|
|
282
256
|
index: Int,
|
|
@@ -326,8 +300,6 @@ private fun ProgressInfoStepIcon(
|
|
|
326
300
|
}
|
|
327
301
|
}
|
|
328
302
|
|
|
329
|
-
// ─── Horizontal connector line ────────────────────────────────────────────────
|
|
330
|
-
|
|
331
303
|
@Composable
|
|
332
304
|
private fun ProgressInfoHorizontalLine(modifier: Modifier = Modifier) {
|
|
333
305
|
Box(
|
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
package vn.momo.kits.components
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.border
|
|
4
|
-
import androidx.compose.foundation.
|
|
5
|
-
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
6
|
-
import androidx.compose.foundation.layout.Arrangement
|
|
7
|
-
import androidx.compose.foundation.layout.Box
|
|
8
|
-
import androidx.compose.foundation.layout.Row
|
|
9
|
-
import androidx.compose.foundation.layout.padding
|
|
10
|
-
import androidx.compose.foundation.layout.size
|
|
4
|
+
import androidx.compose.foundation.layout.*
|
|
11
5
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
12
6
|
import androidx.compose.runtime.Composable
|
|
13
|
-
import androidx.compose.runtime.remember
|
|
14
7
|
import androidx.compose.ui.Alignment
|
|
15
8
|
import androidx.compose.ui.Modifier
|
|
16
9
|
import androidx.compose.ui.draw.clip
|
|
17
10
|
import androidx.compose.ui.unit.dp
|
|
18
11
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
19
|
-
import vn.momo.kits.const
|
|
20
|
-
import vn.momo.kits.const.Colors
|
|
21
|
-
import vn.momo.kits.const.Radius
|
|
22
|
-
import vn.momo.kits.const.Spacing
|
|
23
|
-
import vn.momo.kits.const.Typography
|
|
12
|
+
import vn.momo.kits.const.*
|
|
24
13
|
import vn.momo.kits.modifier.activeOpacityClickable
|
|
25
14
|
import vn.momo.kits.modifier.conditional
|
|
26
15
|
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
package vn.momo.kits.components
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import androidx.compose.animation.core
|
|
6
|
-
import androidx.compose.animation.core.infiniteRepeatable
|
|
7
|
-
import androidx.compose.animation.core.rememberInfiniteTransition
|
|
8
|
-
import androidx.compose.animation.core.tween
|
|
3
|
+
import vn.momo.kits.modifier.InternalApi
|
|
4
|
+
|
|
5
|
+
import androidx.compose.animation.core.*
|
|
9
6
|
import androidx.compose.foundation.background
|
|
10
7
|
import androidx.compose.foundation.border
|
|
11
8
|
import androidx.compose.foundation.layout.Box
|
|
@@ -22,21 +19,17 @@ import vn.momo.kits.application.IsShowBaseLineDebug
|
|
|
22
19
|
import vn.momo.kits.const.Colors
|
|
23
20
|
import vn.momo.kits.modifier.conditional
|
|
24
21
|
|
|
25
|
-
// Pre-computed shimmer colors to avoid repeated list creation
|
|
26
22
|
private val shimmerColors = listOf(
|
|
27
23
|
Colors.black_05,
|
|
28
24
|
Colors.black_03,
|
|
29
25
|
Colors.black_05,
|
|
30
26
|
)
|
|
31
|
-
|
|
32
|
-
// Constants for better performance
|
|
33
27
|
private const val SHADOW_BRUSH_PERCENTAGE = 0.6f
|
|
34
28
|
private const val DEFAULT_DURATION_MILLIS = 1000
|
|
35
29
|
|
|
36
30
|
@Composable
|
|
37
31
|
fun Skeleton() {
|
|
38
32
|
BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
|
|
39
|
-
// Memoize width calculation
|
|
40
33
|
val maxWidthValue = remember(maxWidth) { maxWidth.value.toInt() }
|
|
41
34
|
|
|
42
35
|
Box(
|
|
@@ -52,6 +45,7 @@ fun Skeleton() {
|
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
@Composable
|
|
48
|
+
@InternalApi
|
|
55
49
|
fun Modifier.shimmerLoadingAnimation(
|
|
56
50
|
maxWidth: Int,
|
|
57
51
|
angleOfAxisY: Float = 0f,
|
|
@@ -4,25 +4,12 @@ import androidx.compose.animation.core.animateFloatAsState
|
|
|
4
4
|
import androidx.compose.animation.core.spring
|
|
5
5
|
import androidx.compose.foundation.background
|
|
6
6
|
import androidx.compose.foundation.border
|
|
7
|
-
import androidx.compose.foundation.layout
|
|
8
|
-
import androidx.compose.foundation.layout.BoxWithConstraints
|
|
9
|
-
import androidx.compose.foundation.layout.fillMaxWidth
|
|
10
|
-
import androidx.compose.foundation.layout.height
|
|
11
|
-
import androidx.compose.foundation.layout.offset
|
|
12
|
-
import androidx.compose.foundation.layout.padding
|
|
13
|
-
import androidx.compose.foundation.layout.size
|
|
14
|
-
import androidx.compose.foundation.layout.width
|
|
7
|
+
import androidx.compose.foundation.layout.*
|
|
15
8
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
16
|
-
import androidx.compose.runtime
|
|
17
|
-
import androidx.compose.runtime.getValue
|
|
18
|
-
import androidx.compose.runtime.mutableFloatStateOf
|
|
19
|
-
import androidx.compose.runtime.mutableStateOf
|
|
20
|
-
import androidx.compose.runtime.remember
|
|
21
|
-
import androidx.compose.runtime.setValue
|
|
9
|
+
import androidx.compose.runtime.*
|
|
22
10
|
import androidx.compose.ui.Alignment
|
|
23
11
|
import androidx.compose.ui.Modifier
|
|
24
12
|
import androidx.compose.ui.draw.clip
|
|
25
|
-
import androidx.compose.ui.graphics.Color
|
|
26
13
|
import androidx.compose.ui.input.pointer.pointerInput
|
|
27
14
|
import androidx.compose.ui.layout.onGloballyPositioned
|
|
28
15
|
import androidx.compose.ui.platform.LocalDensity
|
|
@@ -30,19 +17,12 @@ import androidx.compose.ui.text.style.TextAlign
|
|
|
30
17
|
import androidx.compose.ui.unit.IntOffset
|
|
31
18
|
import androidx.compose.ui.unit.dp
|
|
32
19
|
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
33
|
-
import vn.momo.kits.const
|
|
34
|
-
import vn.momo.kits.const.Colors
|
|
35
|
-
import vn.momo.kits.const.Radius
|
|
36
|
-
import vn.momo.kits.const.Spacing
|
|
37
|
-
import vn.momo.kits.const.Typography
|
|
20
|
+
import vn.momo.kits.const.*
|
|
38
21
|
import vn.momo.kits.modifier.conditional
|
|
39
|
-
import vn.momo.kits.modifier.shadow
|
|
40
22
|
import kotlin.math.abs
|
|
41
23
|
import kotlin.math.min
|
|
42
24
|
import kotlin.math.roundToInt
|
|
43
25
|
|
|
44
|
-
// ── Design constants ─────────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
26
|
private val THUMB_SIZE = 20.dp
|
|
47
27
|
private val THUMB_BORDER = 3.dp
|
|
48
28
|
private val TRACK_HEIGHT = 4.dp
|
|
@@ -50,15 +30,10 @@ private val LABEL_PAD_H = Spacing.XS
|
|
|
50
30
|
private val LABEL_PAD_V = Spacing.XXS
|
|
51
31
|
private val LABEL_GAP = Spacing.XS // space between label and thumb top
|
|
52
32
|
|
|
53
|
-
// ── Pure helpers (mirrors RN helpers.ts) ─────────────────────────────────────
|
|
54
33
|
|
|
55
34
|
private fun clamp(value: Float, min: Float, max: Float): Float =
|
|
56
35
|
min(kotlin.math.max(value, min), max)
|
|
57
36
|
|
|
58
|
-
/**
|
|
59
|
-
* Converts a raw touch position into a snapped slider value.
|
|
60
|
-
* Direct port of RN getValueForPosition().
|
|
61
|
-
*/
|
|
62
37
|
private fun getValueForPosition(
|
|
63
38
|
positionInView: Float,
|
|
64
39
|
containerWidth: Float,
|