@momo-kits/native-kits 0.162.0-debug → 0.162.1-beta.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/.claude/settings.local.json +32 -0
- package/compose/build.gradle.kts +66 -63
- package/compose/build.gradle.kts.backup +66 -63
- 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 +1 -1
- 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 +5 -16
- 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/NavigationContainer.kt +4 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +9 -34
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +1 -6
- 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 +27 -30
- 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/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 +15 -76
- 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 +15 -36
- 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/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/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 +3 -18
- 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/Shadow.kt +0 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +1 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +5 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +6 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +55 -55
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +3 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +12 -32
- 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 +55 -15
- 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 +6 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +5 -3
- 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/Deprecated.kt +107 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +3 -8
- 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.properties +1 -1
- package/local.properties +2 -2
- package/package.json +1 -1
- package/publish.sh +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
- package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
|
@@ -29,6 +29,7 @@ import vn.momo.kits.navigation.LocalFooterHeightPx
|
|
|
29
29
|
import vn.momo.kits.navigation.LocalNavigator
|
|
30
30
|
import vn.momo.kits.navigation.LocalOptions
|
|
31
31
|
import vn.momo.kits.navigation.OverplayComponentRegistry
|
|
32
|
+
import kotlin.time.Duration.Companion.milliseconds
|
|
32
33
|
|
|
33
34
|
sealed class SnackBar(open val duration: Long? = null) {
|
|
34
35
|
data class Custom(
|
|
@@ -42,7 +43,7 @@ sealed class SnackBar(open val duration: Long? = null) {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
@Composable
|
|
45
|
-
fun SnackBar(
|
|
46
|
+
internal fun SnackBar(
|
|
46
47
|
data: SnackBar,
|
|
47
48
|
onDismiss: (() -> Unit)?
|
|
48
49
|
) {
|
|
@@ -95,7 +96,7 @@ fun SnackBar(
|
|
|
95
96
|
LaunchedEffect(data.duration) {
|
|
96
97
|
val duration = data.duration
|
|
97
98
|
if (duration != null) {
|
|
98
|
-
delay(duration)
|
|
99
|
+
delay(duration.milliseconds)
|
|
99
100
|
navigator.hideSnackBar()
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -5,13 +5,9 @@ import vn.momo.maxapi.IMaxApi
|
|
|
5
5
|
import kotlin.time.Clock
|
|
6
6
|
import kotlin.time.ExperimentalTime
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Screen tracking state holder
|
|
10
|
-
*/
|
|
11
8
|
class ScreenTrackingState {
|
|
12
9
|
@OptIn(ExperimentalTime::class)
|
|
13
|
-
var
|
|
14
|
-
var endTime: Long = startTime
|
|
10
|
+
var time: Long = Clock.System.now().toEpochMilliseconds()
|
|
15
11
|
var releaseNavigated: Boolean = false
|
|
16
12
|
var releaseLoad: Boolean = false
|
|
17
13
|
var releaseInteraction: Boolean = false
|
|
@@ -19,22 +15,10 @@ class ScreenTrackingState {
|
|
|
19
15
|
var action: String = "push"
|
|
20
16
|
}
|
|
21
17
|
|
|
22
|
-
/**
|
|
23
|
-
* Screen tracker for auto tracking events
|
|
24
|
-
*
|
|
25
|
-
* Tracks 3 main events:
|
|
26
|
-
* - auto_screen_navigated: When screen is focused
|
|
27
|
-
* - auto_screen_displayed: When screen finished loading
|
|
28
|
-
* - auto_screen_interacted: When screen is ready for interaction
|
|
29
|
-
*/
|
|
30
18
|
object ScreenTracker {
|
|
31
19
|
|
|
32
20
|
private var lastScreenName: String? = null
|
|
33
21
|
|
|
34
|
-
/**
|
|
35
|
-
* Track screen navigation event
|
|
36
|
-
* Called when screen is focused
|
|
37
|
-
*/
|
|
38
22
|
fun trackScreenNavigated(
|
|
39
23
|
maxApi: IMaxApi?,
|
|
40
24
|
context: MiniAppContext?,
|
|
@@ -61,10 +45,6 @@ object ScreenTracker {
|
|
|
61
45
|
state.previousScreenName = previousScreen
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
/**
|
|
65
|
-
* Track screen displayed event
|
|
66
|
-
* Called when screen finished loading all elements
|
|
67
|
-
*/
|
|
68
48
|
fun trackScreenDisplayed(
|
|
69
49
|
maxApi: IMaxApi?,
|
|
70
50
|
context: MiniAppContext?,
|
|
@@ -85,10 +65,6 @@ object ScreenTracker {
|
|
|
85
65
|
state.releaseLoad = true
|
|
86
66
|
}
|
|
87
67
|
|
|
88
|
-
/**
|
|
89
|
-
* Track screen interacted event
|
|
90
|
-
* Called when screen is ready for user interaction
|
|
91
|
-
*/
|
|
92
68
|
fun trackScreenInteracted(
|
|
93
69
|
maxApi: IMaxApi?,
|
|
94
70
|
context: MiniAppContext?,
|
|
@@ -111,9 +87,6 @@ object ScreenTracker {
|
|
|
111
87
|
state.releaseInteraction = true
|
|
112
88
|
}
|
|
113
89
|
|
|
114
|
-
/**
|
|
115
|
-
* Build base tracking params from MiniAppContext
|
|
116
|
-
*/
|
|
117
90
|
private fun buildBaseParams(
|
|
118
91
|
context: MiniAppContext?,
|
|
119
92
|
screenName: String,
|
|
@@ -128,12 +101,6 @@ object ScreenTracker {
|
|
|
128
101
|
)
|
|
129
102
|
}
|
|
130
103
|
|
|
131
|
-
/**
|
|
132
|
-
* Track popup/modal displayed event
|
|
133
|
-
*
|
|
134
|
-
* @param popupName name of the popup/modal
|
|
135
|
-
* @param parentScreenName the screen that shows the popup
|
|
136
|
-
*/
|
|
137
104
|
fun trackPopupDisplayed(
|
|
138
105
|
maxApi: IMaxApi?,
|
|
139
106
|
context: MiniAppContext?,
|
|
@@ -152,14 +119,8 @@ object ScreenTracker {
|
|
|
152
119
|
)
|
|
153
120
|
}
|
|
154
121
|
|
|
155
|
-
/**
|
|
156
|
-
* Get previous screen name for back navigation detection
|
|
157
|
-
*/
|
|
158
122
|
fun getLastScreenName(): String? = lastScreenName
|
|
159
123
|
|
|
160
|
-
/**
|
|
161
|
-
* Reset tracker (for testing or cleanup)
|
|
162
|
-
*/
|
|
163
124
|
@Suppress("UNUSED")
|
|
164
125
|
fun reset() {
|
|
165
126
|
lastScreenName = null
|
|
@@ -36,8 +36,6 @@ internal fun ComposeLottieAnimation(
|
|
|
36
36
|
LottieCompositionSpec.JsonString(json)
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Recolor only the fill/stroke color slots (matching the native lottie-ios per-keypath tint)
|
|
40
|
-
// instead of a global ColorFilter.tint, which would flatten a multicolor animation to a silhouette.
|
|
41
39
|
val dynamicProperties = if (tintColor != null) {
|
|
42
40
|
rememberLottieDynamicProperties(tintColor) {
|
|
43
41
|
shapeLayer("**") {
|
|
@@ -43,14 +43,6 @@ fun supportsImePadding(): Boolean = when (val v = getOSVersion()) {
|
|
|
43
43
|
is OSVersion.Android -> v.sdk > 29
|
|
44
44
|
is OSVersion.IOS -> true
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @param useCompose when `true`, renders via the pure-Compose Compottie engine instead of the
|
|
49
|
-
* platform-native engine (airbnb-lottie on Android, lottie-ios on iOS). Defaults to `false` for
|
|
50
|
-
* backward compatibility. Note: when `useCompose = true`, `tintColor` recolors only the fill/stroke
|
|
51
|
-
* color slots (matching the native lottie-ios per-keypath tint), so gradient and text-layer colors
|
|
52
|
-
* are left untinted; `placedAsOverlay` is a no-op.
|
|
53
|
-
*/
|
|
54
46
|
@Composable
|
|
55
47
|
expect fun LottieAnimation(
|
|
56
48
|
path: String,
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
package vn.momo.kits.utils
|
|
2
|
+
|
|
3
|
+
import androidx.compose.animation.core.LinearEasing
|
|
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
|
|
9
|
+
import androidx.compose.runtime.Composable
|
|
10
|
+
import androidx.compose.runtime.getValue
|
|
11
|
+
import androidx.compose.ui.Modifier
|
|
12
|
+
import androidx.compose.ui.draw.drawWithContent
|
|
13
|
+
import androidx.compose.ui.geometry.Offset
|
|
14
|
+
import androidx.compose.ui.graphics.Color
|
|
15
|
+
import androidx.compose.ui.graphics.drawscope.clipRect
|
|
16
|
+
import androidx.compose.ui.text.TextStyle
|
|
17
|
+
import androidx.compose.ui.text.drawText
|
|
18
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
19
|
+
import androidx.compose.ui.text.rememberTextMeasurer
|
|
20
|
+
import androidx.compose.ui.unit.sp
|
|
21
|
+
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
22
|
+
import vn.momo.kits.const.Colors
|
|
23
|
+
|
|
24
|
+
object Deprecated {
|
|
25
|
+
|
|
26
|
+
@Suppress("ExperimentalAnnotationRetention")
|
|
27
|
+
@RequiresOptIn(
|
|
28
|
+
message = "This is internal API of native-kits, become internal in next sprint",
|
|
29
|
+
level = RequiresOptIn.Level.WARNING,
|
|
30
|
+
)
|
|
31
|
+
@Retention(AnnotationRetention.BINARY)
|
|
32
|
+
@Target(
|
|
33
|
+
AnnotationTarget.CLASS,
|
|
34
|
+
AnnotationTarget.FUNCTION,
|
|
35
|
+
AnnotationTarget.PROPERTY,
|
|
36
|
+
)
|
|
37
|
+
annotation class InternalApi
|
|
38
|
+
|
|
39
|
+
@Composable
|
|
40
|
+
fun deprecatedModifier(text: String = "Deprecated component"): Modifier = debugMarker(
|
|
41
|
+
label = text,
|
|
42
|
+
background = Colors.red_04.copy(alpha = 0.7f),
|
|
43
|
+
textColor = Colors.red_01,
|
|
44
|
+
animationLabel = "deprecatedMarquee",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
@Composable
|
|
48
|
+
private fun debugMarker(
|
|
49
|
+
label: String,
|
|
50
|
+
background: Color,
|
|
51
|
+
textColor: Color,
|
|
52
|
+
animationLabel: String,
|
|
53
|
+
): Modifier {
|
|
54
|
+
if (!IsShowBaseLineDebug) return Modifier
|
|
55
|
+
|
|
56
|
+
val textMeasurer = rememberTextMeasurer()
|
|
57
|
+
val marquee = rememberInfiniteTransition(label = animationLabel)
|
|
58
|
+
val progress by marquee.animateFloat(
|
|
59
|
+
initialValue = 0f,
|
|
60
|
+
targetValue = 1f,
|
|
61
|
+
animationSpec = infiniteRepeatable(
|
|
62
|
+
animation = tween(durationMillis = 4000, easing = LinearEasing),
|
|
63
|
+
repeatMode = RepeatMode.Restart,
|
|
64
|
+
),
|
|
65
|
+
label = "${animationLabel}Progress",
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
return Modifier.drawWithContent {
|
|
69
|
+
drawContent()
|
|
70
|
+
drawRect(color = background)
|
|
71
|
+
|
|
72
|
+
if (size.width <= 0f || size.height <= 0f) return@drawWithContent
|
|
73
|
+
|
|
74
|
+
val fontPx = (size.width * 0.1f).coerceIn(12.sp.toPx(), 20.sp.toPx())
|
|
75
|
+
val style = TextStyle(
|
|
76
|
+
color = textColor,
|
|
77
|
+
fontSize = fontPx.toSp(),
|
|
78
|
+
fontWeight = FontWeight.Bold,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
val intrinsic = textMeasurer.measure(
|
|
82
|
+
text = label,
|
|
83
|
+
style = style,
|
|
84
|
+
maxLines = 1,
|
|
85
|
+
softWrap = false,
|
|
86
|
+
)
|
|
87
|
+
val textW = intrinsic.size.width
|
|
88
|
+
val textH = intrinsic.size.height
|
|
89
|
+
val y = (size.height - textH) / 2f
|
|
90
|
+
|
|
91
|
+
if (textW <= size.width) {
|
|
92
|
+
drawText(
|
|
93
|
+
textLayoutResult = intrinsic,
|
|
94
|
+
topLeft = Offset((size.width - textW) / 2f, y),
|
|
95
|
+
)
|
|
96
|
+
} else {
|
|
97
|
+
clipRect(right = size.width, bottom = size.height) {
|
|
98
|
+
val gap = textW * 0.5f
|
|
99
|
+
val travel = textW + gap
|
|
100
|
+
val x = -progress * travel
|
|
101
|
+
drawText(textLayoutResult = intrinsic, topLeft = Offset(x, y))
|
|
102
|
+
drawText(textLayoutResult = intrinsic, topLeft = Offset(x + travel, y))
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
package vn.momo.kits.utils
|
|
2
2
|
|
|
3
|
-
import androidx.compose.runtime
|
|
4
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
5
|
-
import androidx.compose.runtime.MutableState
|
|
6
|
-
import androidx.compose.runtime.getValue
|
|
7
|
-
import androidx.compose.runtime.mutableStateOf
|
|
8
|
-
import androidx.compose.runtime.remember
|
|
3
|
+
import androidx.compose.runtime.*
|
|
9
4
|
import org.jetbrains.compose.resources.DrawableResource
|
|
10
5
|
import org.jetbrains.compose.resources.InternalResourceApi
|
|
11
6
|
import org.jetbrains.compose.resources.ResourceItem
|
|
@@ -13,7 +8,7 @@ import org.jetbrains.compose.resources.readResourceBytes
|
|
|
13
8
|
|
|
14
9
|
@OptIn(InternalResourceApi::class)
|
|
15
10
|
@Composable
|
|
16
|
-
fun getResource(name: String): DrawableResource {
|
|
11
|
+
internal fun getResource(name: String): DrawableResource {
|
|
17
12
|
return DrawableResource(
|
|
18
13
|
"drawable:$name",
|
|
19
14
|
setOf(ResourceItem(setOf(), "drawable/$name", -1, -1))
|
|
@@ -22,7 +17,7 @@ fun getResource(name: String): DrawableResource {
|
|
|
22
17
|
|
|
23
18
|
@OptIn(InternalResourceApi::class)
|
|
24
19
|
@Composable
|
|
25
|
-
fun readJson(name: String): String {
|
|
20
|
+
internal fun readJson(name: String): String {
|
|
26
21
|
val path = name.plus(".json")
|
|
27
22
|
val candidatePaths = listOf(
|
|
28
23
|
path,
|
|
@@ -41,8 +41,8 @@ internal fun Modifier.bottomBorder(strokeWidth: Dp, color: Color) = composed(
|
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
fun <T> Boolean.ifTrue(trueCase: T, falseCase: T): T = if (this) trueCase else falseCase
|
|
45
|
+
fun <T> String.ifNotNull(trueCase: T, falseCase: T): T =
|
|
46
46
|
if (this.isBlank()) falseCase else trueCase
|
|
47
47
|
|
|
48
48
|
fun formatNumberToMoney(number: Long, currency: String = "đ"): String {
|
|
@@ -91,7 +91,7 @@ fun getAppStatusBarHeight(): Dp {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@Composable
|
|
94
|
-
fun getNavigationBarHeight(): Dp {
|
|
94
|
+
internal fun getNavigationBarHeight(): Dp {
|
|
95
95
|
return if (AppNavigationBar.current == 0.dp) {
|
|
96
96
|
val systemBottomPadding = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
|
|
97
97
|
if (getPlatformName() == "iOS") {
|
|
@@ -13,14 +13,13 @@ private const val STATUS_BAR_TAPPED_NOTIFICATION = "statusBarSelected"
|
|
|
13
13
|
internal actual fun RegisterScrollToTop(callback: (() -> Unit)?) {
|
|
14
14
|
val maxApi = LocalMaxApi.current
|
|
15
15
|
DisposableEffect(callback) {
|
|
16
|
-
val
|
|
17
|
-
val token: NSObjectProtocol? = if (cb != null) {
|
|
16
|
+
val token: NSObjectProtocol? = if (callback != null) {
|
|
18
17
|
NSNotificationCenter.defaultCenter.addObserverForName(
|
|
19
18
|
name = STATUS_BAR_TAPPED_NOTIFICATION,
|
|
20
19
|
`object` = null,
|
|
21
20
|
queue = NSOperationQueue.mainQueue,
|
|
22
21
|
) { _: NSNotification? ->
|
|
23
|
-
runCatching {
|
|
22
|
+
runCatching { callback() }.onFailure {
|
|
24
23
|
maxApi?.logFile("[ScrollToTop] callback threw: ${it.message}") {}
|
|
25
24
|
|
|
26
25
|
}
|
|
@@ -19,8 +19,6 @@ import androidx.compose.ui.backhandler.LocalCompatNavigationEventDispatcherOwner
|
|
|
19
19
|
import androidx.compose.ui.graphics.Color
|
|
20
20
|
import androidx.compose.ui.graphics.NativePaint
|
|
21
21
|
import androidx.compose.ui.graphics.toArgb
|
|
22
|
-
import androidx.compose.ui.semantics.SemanticsPropertyKey
|
|
23
|
-
import androidx.compose.ui.semantics.semantics
|
|
24
22
|
import androidx.compose.ui.unit.Dp
|
|
25
23
|
import androidx.compose.ui.unit.dp
|
|
26
24
|
import androidx.compose.ui.viewinterop.UIKitInteropProperties
|
package/gradle.properties
CHANGED
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
|
+
#Mon Dec 22 10:07:29 ICT 2025
|
|
8
|
+
sdk.dir=/Users/phuc/Library/Android/sdk
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -456,7 +456,7 @@ case "$PHASE" in
|
|
|
456
456
|
;;
|
|
457
457
|
"maven")
|
|
458
458
|
echo "Running PHASE 2 only: Publish to Maven"
|
|
459
|
-
|
|
459
|
+
phase_publish_maven
|
|
460
460
|
;;
|
|
461
461
|
"npm")
|
|
462
462
|
echo "Running PHASE 3 only: Publish to NPM"
|
|
@@ -465,7 +465,7 @@ case "$PHASE" in
|
|
|
465
465
|
"all")
|
|
466
466
|
echo "Running ALL PHASES"
|
|
467
467
|
phase_check_version
|
|
468
|
-
|
|
468
|
+
phase_publish_maven
|
|
469
469
|
phase_publish_npm
|
|
470
470
|
echo ""
|
|
471
471
|
echo "🎉 ALL PHASES COMPLETED SUCCESSFULLY!"
|
|
@@ -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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.modifier
|
|
2
|
-
|
|
3
|
-
import androidx.compose.foundation.background
|
|
4
|
-
import androidx.compose.runtime.Composable
|
|
5
|
-
import androidx.compose.ui.Modifier
|
|
6
|
-
import vn.momo.kits.application.IsShowBaseLineDebug
|
|
7
|
-
import vn.momo.kits.const.Colors
|
|
8
|
-
|
|
9
|
-
@Composable
|
|
10
|
-
fun DeprecatedModifier(): Modifier {
|
|
11
|
-
return Modifier.conditional(IsShowBaseLineDebug) {
|
|
12
|
-
background(Colors.red_01.copy(alpha = 0.5f))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Example.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|
|
Binary file
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "3B6FB503A75BF5BC1FA6F30BC06B9D28"
|
|
18
|
-
BuildableName = "MoMoUIKits.framework"
|
|
19
|
-
BlueprintName = "MoMoUIKits"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "0AEE99A309977BD12A049FF48AF9BA4B"
|
|
18
|
-
BuildableName = "Pods_Example.framework"
|
|
19
|
-
BlueprintName = "Pods-Example"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<Scheme
|
|
3
|
-
LastUpgradeVersion = "1600"
|
|
4
|
-
version = "1.3">
|
|
5
|
-
<BuildAction
|
|
6
|
-
parallelizeBuildables = "YES"
|
|
7
|
-
buildImplicitDependencies = "YES">
|
|
8
|
-
<BuildActionEntries>
|
|
9
|
-
<BuildActionEntry
|
|
10
|
-
buildForTesting = "YES"
|
|
11
|
-
buildForRunning = "YES"
|
|
12
|
-
buildForProfiling = "YES"
|
|
13
|
-
buildForArchiving = "YES"
|
|
14
|
-
buildForAnalyzing = "YES">
|
|
15
|
-
<BuildableReference
|
|
16
|
-
BuildableIdentifier = "primary"
|
|
17
|
-
BlueprintIdentifier = "3847153A6E5EEFB86565BA840768F429"
|
|
18
|
-
BuildableName = "SDWebImage.framework"
|
|
19
|
-
BlueprintName = "SDWebImage"
|
|
20
|
-
ReferencedContainer = "container:Pods.xcodeproj">
|
|
21
|
-
</BuildableReference>
|
|
22
|
-
</BuildActionEntry>
|
|
23
|
-
</BuildActionEntries>
|
|
24
|
-
</BuildAction>
|
|
25
|
-
<TestAction
|
|
26
|
-
buildConfiguration = "Debug"
|
|
27
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
28
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
29
|
-
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
30
|
-
<Testables>
|
|
31
|
-
</Testables>
|
|
32
|
-
</TestAction>
|
|
33
|
-
<LaunchAction
|
|
34
|
-
buildConfiguration = "Debug"
|
|
35
|
-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
36
|
-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
37
|
-
launchStyle = "0"
|
|
38
|
-
useCustomWorkingDirectory = "NO"
|
|
39
|
-
ignoresPersistentStateOnLaunch = "NO"
|
|
40
|
-
debugDocumentVersioning = "YES"
|
|
41
|
-
debugServiceExtension = "internal"
|
|
42
|
-
allowLocationSimulation = "YES">
|
|
43
|
-
</LaunchAction>
|
|
44
|
-
<ProfileAction
|
|
45
|
-
buildConfiguration = "Release"
|
|
46
|
-
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
47
|
-
savedToolIdentifier = ""
|
|
48
|
-
useCustomWorkingDirectory = "NO"
|
|
49
|
-
debugDocumentVersioning = "YES">
|
|
50
|
-
</ProfileAction>
|
|
51
|
-
<AnalyzeAction
|
|
52
|
-
buildConfiguration = "Debug">
|
|
53
|
-
</AnalyzeAction>
|
|
54
|
-
<ArchiveAction
|
|
55
|
-
buildConfiguration = "Release"
|
|
56
|
-
revealArchiveInOrganizer = "YES">
|
|
57
|
-
</ArchiveAction>
|
|
58
|
-
</Scheme>
|