@momo-kits/native-kits 0.162.6-debug → 0.163.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.md +78 -0
- package/compose/build.gradle.kts +8 -11
- package/compose/build.gradle.kts.backup +7 -10
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +7 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +5 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +24 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +19 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +10 -1
- 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 +16 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +101 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +15 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +33 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +25 -22
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +29 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +26 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +30 -27
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +13 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +18 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +59 -84
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +71 -13
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +51 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +1 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +21 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +75 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +26 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +11 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +36 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +9 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +28 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +13 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +10 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +28 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +47 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +25 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +11 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +17 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +6 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +111 -50
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +8 -7
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +12 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +96 -4
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +12 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +21 -9
- 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 +14 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +11 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +40 -24
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +5 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +4 -94
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +15 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +14 -65
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +33 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +55 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +9 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +31 -13
- 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 +24 -6
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +6 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +1 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +3 -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 +13 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +40 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +8 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +17 -2
- 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 +3 -2
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +2 -0
- package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +46 -0
- package/gradle.properties +1 -1
- package/ios/Application/ApplicationEnvironment.swift +0 -1
- package/ios/Application/Components.swift +0 -1
- package/ios/Application/FloatingButton.swift +0 -1
- package/ios/Badge/Badge.swift +0 -1
- package/ios/Badge/BadgeRibbon.swift +0 -2
- package/ios/Button/Button.swift +1 -1
- package/ios/Checkbox/Checkbox.swift +0 -1
- package/ios/Input/Input.swift +0 -1
- package/ios/Input/InputPhoneNumber.swift +0 -1
- package/ios/Input/InputSearch.swift +0 -3
- package/ios/Input/InputTextArea.swift +0 -1
- package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +0 -6
- package/ios/Popup/PopupInput.swift +0 -2
- package/ios/Template/TrustBanner/TrustBanner.swift +0 -2
- package/ios/Typography/Text.swift +7 -13
- package/ios/Typography/Typography.swift +8 -22
- package/local.properties +8 -0
- package/package.json +1 -1
- package/ios/Application/FontScaleStore.swift +0 -59
- package/ios/Information/Information.swift +0 -151
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
package vn.momo.kits.navigation.component
|
|
2
2
|
|
|
3
|
-
import vn.momo.kits.modifier.InternalApi
|
|
4
|
-
|
|
5
3
|
import androidx.compose.animation.core.animateFloatAsState
|
|
6
4
|
import androidx.compose.foundation.background
|
|
7
5
|
import androidx.compose.foundation.border
|
|
@@ -44,14 +42,12 @@ import vn.momo.kits.navigation.LocalOptions
|
|
|
44
42
|
import vn.momo.kits.navigation.LocalScrollState
|
|
45
43
|
import vn.momo.kits.navigation.getInputSearchType
|
|
46
44
|
|
|
47
|
-
@InternalApi
|
|
48
45
|
const val HEADER_HEIGHT = 52
|
|
49
|
-
|
|
46
|
+
enum class InputSearchType { None, Header, Animated }
|
|
50
47
|
enum class TitlePosition { LEFT, CENTER }
|
|
51
48
|
|
|
52
|
-
@Suppress("FrequentlyChangingValue")
|
|
53
49
|
@Composable
|
|
54
|
-
|
|
50
|
+
fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
55
51
|
val options = LocalOptions.current
|
|
56
52
|
val navigator = LocalNavigator.current
|
|
57
53
|
val scrollState = LocalScrollState.current
|
|
@@ -110,7 +106,7 @@ internal fun Header(onBackHandler: (() -> Unit)? = null) {
|
|
|
110
106
|
backgroundButton = headerColor.backgroundButton,
|
|
111
107
|
tintIconColor = headerColor.tintIconColor,
|
|
112
108
|
onBackHandler = {
|
|
113
|
-
navigator.onBackSafe { }
|
|
109
|
+
onBackHandler?.invoke() ?: navigator.onBackSafe { }
|
|
114
110
|
}
|
|
115
111
|
)
|
|
116
112
|
Spacer(Modifier.width(Spacing.S))
|
|
@@ -172,7 +168,7 @@ private fun BackButton(borderColor: Color, backgroundButton: Color, tintIconColo
|
|
|
172
168
|
}
|
|
173
169
|
|
|
174
170
|
@Composable
|
|
175
|
-
|
|
171
|
+
fun HeaderContent(
|
|
176
172
|
headerTitle: HeaderTitle,
|
|
177
173
|
tintIconColor: Color,
|
|
178
174
|
titlePosition: TitlePosition = TitlePosition.LEFT,
|
|
@@ -203,7 +199,7 @@ internal fun HeaderContent(
|
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
@Composable
|
|
206
|
-
|
|
202
|
+
fun VerticalShadow(opacity: Float){
|
|
207
203
|
if(opacity == 1f){
|
|
208
204
|
Box(modifier = Modifier
|
|
209
205
|
.fillMaxWidth()
|
|
@@ -286,9 +282,8 @@ data class HeaderBackProps(
|
|
|
286
282
|
val preventBack: PopupNotifyProps? = null,
|
|
287
283
|
)
|
|
288
284
|
|
|
289
|
-
@InternalApi
|
|
290
285
|
data class HeaderColor(val tintIconColor: Color, val backgroundButton: Color, val borderColor: Color)
|
|
291
|
-
|
|
286
|
+
fun getHeaderColor(headerType: HeaderType, opacity: Float, tintColor: Color?, defaultColor: Color): HeaderColor{
|
|
292
287
|
return if(headerType is HeaderType.Animated) {
|
|
293
288
|
if (opacity == 1f || !headerType.isSurface)
|
|
294
289
|
HeaderColor(
|
|
@@ -27,9 +27,8 @@ enum class AnimatedHeaderRatio(val value: Float){
|
|
|
27
27
|
RATIO_3_2(3f / 2f)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
@Suppress("FrequentlyChangingValue")
|
|
31
30
|
@Composable
|
|
32
|
-
|
|
31
|
+
fun HeaderBackground() {
|
|
33
32
|
val density = LocalDensity.current
|
|
34
33
|
val theme = AppTheme.current
|
|
35
34
|
val options = LocalOptions.current
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
package vn.momo.kits.navigation.component
|
|
2
2
|
|
|
3
|
-
import vn.momo.kits.modifier.InternalApi
|
|
4
|
-
|
|
5
3
|
import androidx.compose.foundation.background
|
|
6
4
|
import androidx.compose.foundation.border
|
|
7
5
|
import androidx.compose.foundation.layout.Arrangement
|
|
@@ -37,7 +35,6 @@ import vn.momo.kits.modifier.activeOpacityClickable
|
|
|
37
35
|
import vn.momo.kits.navigation.LocalMaxApi
|
|
38
36
|
|
|
39
37
|
@Composable
|
|
40
|
-
@InternalApi
|
|
41
38
|
fun HeaderRight(
|
|
42
39
|
headerRight: HeaderRight,
|
|
43
40
|
tintColor: Color? = null,
|
|
@@ -60,7 +57,7 @@ fun HeaderRight(
|
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
@Composable
|
|
63
|
-
|
|
60
|
+
fun Toolkit(
|
|
64
61
|
headerRight: HeaderRight.Toolkit,
|
|
65
62
|
tintColor: Color? = null,
|
|
66
63
|
headerColor: HeaderColor
|
|
@@ -189,7 +186,7 @@ internal fun Toolkit(
|
|
|
189
186
|
|
|
190
187
|
|
|
191
188
|
@Composable
|
|
192
|
-
|
|
189
|
+
fun NavigationButton(
|
|
193
190
|
disabled: Boolean,
|
|
194
191
|
icon: String,
|
|
195
192
|
showBadge: Boolean? = false,
|
|
@@ -303,7 +300,7 @@ data class Tool(
|
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
|
|
306
|
-
|
|
303
|
+
data class NavigationButtonConfig(
|
|
307
304
|
val icon: String,
|
|
308
305
|
val onPress: () -> Unit
|
|
309
306
|
)
|
|
@@ -2,7 +2,17 @@ package vn.momo.kits.navigation.component
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
4
|
import androidx.compose.foundation.border
|
|
5
|
-
import androidx.compose.foundation.layout
|
|
5
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
6
|
+
import androidx.compose.foundation.layout.Box
|
|
7
|
+
import androidx.compose.foundation.layout.Column
|
|
8
|
+
import androidx.compose.foundation.layout.Row
|
|
9
|
+
import androidx.compose.foundation.layout.Spacer
|
|
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.size
|
|
14
|
+
import androidx.compose.foundation.layout.width
|
|
15
|
+
import androidx.compose.foundation.layout.widthIn
|
|
6
16
|
import androidx.compose.foundation.shape.CircleShape
|
|
7
17
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
8
18
|
import androidx.compose.foundation.text.BasicText
|
|
@@ -33,7 +43,7 @@ import vn.momo.kits.navigation.component.HeaderTitle.User
|
|
|
33
43
|
import vn.momo.kits.platform.getScreenDimensions
|
|
34
44
|
|
|
35
45
|
@Composable
|
|
36
|
-
|
|
46
|
+
fun HeaderUser(
|
|
37
47
|
data: HeaderTitle
|
|
38
48
|
) {
|
|
39
49
|
if (data !is User) return
|
|
@@ -357,4 +367,4 @@ private fun RemoteIcon16(url: String) {
|
|
|
357
367
|
}
|
|
358
368
|
|
|
359
369
|
@Immutable
|
|
360
|
-
|
|
370
|
+
data class AvatarUrls(val items: List<String>)
|
|
@@ -29,7 +29,6 @@ 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
|
|
33
32
|
|
|
34
33
|
sealed class SnackBar(open val duration: Long? = null) {
|
|
35
34
|
data class Custom(
|
|
@@ -43,7 +42,7 @@ sealed class SnackBar(open val duration: Long? = null) {
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
@Composable
|
|
46
|
-
|
|
45
|
+
fun SnackBar(
|
|
47
46
|
data: SnackBar,
|
|
48
47
|
onDismiss: (() -> Unit)?
|
|
49
48
|
) {
|
|
@@ -96,7 +95,7 @@ internal fun SnackBar(
|
|
|
96
95
|
LaunchedEffect(data.duration) {
|
|
97
96
|
val duration = data.duration
|
|
98
97
|
if (duration != null) {
|
|
99
|
-
delay(duration
|
|
98
|
+
delay(duration)
|
|
100
99
|
navigator.hideSnackBar()
|
|
101
100
|
}
|
|
102
101
|
}
|
|
@@ -5,9 +5,13 @@ 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
|
+
*/
|
|
8
11
|
class ScreenTrackingState {
|
|
9
12
|
@OptIn(ExperimentalTime::class)
|
|
10
|
-
var
|
|
13
|
+
var startTime: Long = Clock.System.now().toEpochMilliseconds()
|
|
14
|
+
var endTime: Long = startTime
|
|
11
15
|
var releaseNavigated: Boolean = false
|
|
12
16
|
var releaseLoad: Boolean = false
|
|
13
17
|
var releaseInteraction: Boolean = false
|
|
@@ -15,10 +19,22 @@ class ScreenTrackingState {
|
|
|
15
19
|
var action: String = "push"
|
|
16
20
|
}
|
|
17
21
|
|
|
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
|
+
*/
|
|
18
30
|
object ScreenTracker {
|
|
19
31
|
|
|
20
32
|
private var lastScreenName: String? = null
|
|
21
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Track screen navigation event
|
|
36
|
+
* Called when screen is focused
|
|
37
|
+
*/
|
|
22
38
|
fun trackScreenNavigated(
|
|
23
39
|
maxApi: IMaxApi?,
|
|
24
40
|
context: MiniAppContext?,
|
|
@@ -45,6 +61,10 @@ object ScreenTracker {
|
|
|
45
61
|
state.previousScreenName = previousScreen
|
|
46
62
|
}
|
|
47
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Track screen displayed event
|
|
66
|
+
* Called when screen finished loading all elements
|
|
67
|
+
*/
|
|
48
68
|
fun trackScreenDisplayed(
|
|
49
69
|
maxApi: IMaxApi?,
|
|
50
70
|
context: MiniAppContext?,
|
|
@@ -65,6 +85,10 @@ object ScreenTracker {
|
|
|
65
85
|
state.releaseLoad = true
|
|
66
86
|
}
|
|
67
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Track screen interacted event
|
|
90
|
+
* Called when screen is ready for user interaction
|
|
91
|
+
*/
|
|
68
92
|
fun trackScreenInteracted(
|
|
69
93
|
maxApi: IMaxApi?,
|
|
70
94
|
context: MiniAppContext?,
|
|
@@ -87,6 +111,9 @@ object ScreenTracker {
|
|
|
87
111
|
state.releaseInteraction = true
|
|
88
112
|
}
|
|
89
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Build base tracking params from MiniAppContext
|
|
116
|
+
*/
|
|
90
117
|
private fun buildBaseParams(
|
|
91
118
|
context: MiniAppContext?,
|
|
92
119
|
screenName: String,
|
|
@@ -101,6 +128,12 @@ object ScreenTracker {
|
|
|
101
128
|
)
|
|
102
129
|
}
|
|
103
130
|
|
|
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
|
+
*/
|
|
104
137
|
fun trackPopupDisplayed(
|
|
105
138
|
maxApi: IMaxApi?,
|
|
106
139
|
context: MiniAppContext?,
|
|
@@ -119,8 +152,14 @@ object ScreenTracker {
|
|
|
119
152
|
)
|
|
120
153
|
}
|
|
121
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Get previous screen name for back navigation detection
|
|
157
|
+
*/
|
|
122
158
|
fun getLastScreenName(): String? = lastScreenName
|
|
123
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Reset tracker (for testing or cleanup)
|
|
162
|
+
*/
|
|
124
163
|
@Suppress("UNUSED")
|
|
125
164
|
fun reset() {
|
|
126
165
|
lastScreenName = null
|
|
@@ -36,6 +36,8 @@ 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.
|
|
39
41
|
val dynamicProperties = if (tintColor != null) {
|
|
40
42
|
rememberLottieDynamicProperties(tintColor) {
|
|
41
43
|
shapeLayer("**") {
|
|
@@ -43,6 +43,14 @@ 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
|
+
*/
|
|
46
54
|
@Composable
|
|
47
55
|
expect fun LottieAnimation(
|
|
48
56
|
path: String,
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
package vn.momo.kits.utils
|
|
2
2
|
|
|
3
|
-
import androidx.compose.runtime
|
|
3
|
+
import androidx.compose.runtime.Composable
|
|
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
|
|
4
9
|
import org.jetbrains.compose.resources.DrawableResource
|
|
5
10
|
import org.jetbrains.compose.resources.InternalResourceApi
|
|
6
11
|
import org.jetbrains.compose.resources.ResourceItem
|
|
7
12
|
import org.jetbrains.compose.resources.readResourceBytes
|
|
13
|
+
|
|
14
|
+
@OptIn(InternalResourceApi::class)
|
|
15
|
+
@Composable
|
|
16
|
+
fun getResource(name: String): DrawableResource {
|
|
17
|
+
return DrawableResource(
|
|
18
|
+
"drawable:$name",
|
|
19
|
+
setOf(ResourceItem(setOf(), "drawable/$name", -1, -1))
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
@OptIn(InternalResourceApi::class)
|
|
9
24
|
@Composable
|
|
10
|
-
|
|
25
|
+
fun readJson(name: String): String {
|
|
11
26
|
val path = name.plus(".json")
|
|
12
27
|
val candidatePaths = listOf(
|
|
13
28
|
path,
|
|
@@ -41,8 +41,8 @@ internal fun Modifier.bottomBorder(strokeWidth: Dp, color: Color) = composed(
|
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
|
|
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 =
|
|
44
|
+
inline fun <T> Boolean.ifTrue(trueCase: T, falseCase: T): T = if (this) trueCase else falseCase
|
|
45
|
+
inline 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
|
-
|
|
94
|
+
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,13 +13,14 @@ 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
|
|
16
|
+
val cb = callback
|
|
17
|
+
val token: NSObjectProtocol? = if (cb != null) {
|
|
17
18
|
NSNotificationCenter.defaultCenter.addObserverForName(
|
|
18
19
|
name = STATUS_BAR_TAPPED_NOTIFICATION,
|
|
19
20
|
`object` = null,
|
|
20
21
|
queue = NSOperationQueue.mainQueue,
|
|
21
22
|
) { _: NSNotification? ->
|
|
22
|
-
runCatching {
|
|
23
|
+
runCatching { cb() }.onFailure {
|
|
23
24
|
maxApi?.logFile("[ScrollToTop] callback threw: ${it.message}") {}
|
|
24
25
|
|
|
25
26
|
}
|
|
@@ -19,6 +19,8 @@ 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
|
|
22
24
|
import androidx.compose.ui.unit.Dp
|
|
23
25
|
import androidx.compose.ui.unit.dp
|
|
24
26
|
import androidx.compose.ui.viewinterop.UIKitInteropProperties
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,58 @@
|
|
|
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 = "92EBFA3E7005B4C18A9C0B44324EB80F"
|
|
18
|
+
BuildableName = "SDWebImageSwiftUI.framework"
|
|
19
|
+
BlueprintName = "SDWebImageSwiftUI"
|
|
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>
|