@momo-kits/native-kits 0.162.34-debug → 0.162.34
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/package.json +1 -1
- package/build.gradle.kts +0 -11
- package/compose/build.gradle.kts +0 -190
- package/compose/build.gradle.kts.backup +0 -190
- package/compose/compose.podspec +0 -47
- package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
- package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -150
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -106
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -183
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -207
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -39
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -293
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -826
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -110
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -378
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -113
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -134
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -475
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -214
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -240
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -216
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -259
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -182
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -328
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -97
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -310
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -323
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -217
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -199
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -91
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -470
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -88
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -131
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -203
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -175
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -234
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -188
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -263
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -38
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -39
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -299
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -129
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -103
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -172
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -372
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -589
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -156
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -225
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -320
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -81
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -309
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -34
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -360
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -132
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -69
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -105
- package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -40
- package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -207
- package/gradle/libs.versions.toml +0 -69
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +0 -8
- package/gradle.properties +0 -26
- package/gradlew +0 -252
- package/gradlew.bat +0 -94
- package/ios-demo/README.md +0 -120
- package/settings.gradle.kts +0 -64
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.platform
|
|
2
|
-
|
|
3
|
-
import androidx.compose.foundation.Image
|
|
4
|
-
import androidx.compose.foundation.background
|
|
5
|
-
import androidx.compose.foundation.layout.Box
|
|
6
|
-
import androidx.compose.foundation.layout.fillMaxSize
|
|
7
|
-
import androidx.compose.runtime.Composable
|
|
8
|
-
import androidx.compose.runtime.LaunchedEffect
|
|
9
|
-
import androidx.compose.runtime.getValue
|
|
10
|
-
import androidx.compose.runtime.rememberUpdatedState
|
|
11
|
-
import androidx.compose.runtime.snapshotFlow
|
|
12
|
-
import androidx.compose.ui.Modifier
|
|
13
|
-
import androidx.compose.ui.graphics.Color
|
|
14
|
-
import io.github.alexzhirkevich.compottie.ExperimentalCompottieApi
|
|
15
|
-
import io.github.alexzhirkevich.compottie.LottieCompositionSpec
|
|
16
|
-
import io.github.alexzhirkevich.compottie.animateLottieCompositionAsState
|
|
17
|
-
import io.github.alexzhirkevich.compottie.dynamic.rememberLottieDynamicProperties
|
|
18
|
-
import io.github.alexzhirkevich.compottie.rememberLottieComposition
|
|
19
|
-
import io.github.alexzhirkevich.compottie.rememberLottiePainter
|
|
20
|
-
import vn.momo.kits.utils.readJson
|
|
21
|
-
|
|
22
|
-
@OptIn(ExperimentalCompottieApi::class)
|
|
23
|
-
@Composable
|
|
24
|
-
internal fun ComposeLottieAnimation(
|
|
25
|
-
path: String,
|
|
26
|
-
tintColor: Color?,
|
|
27
|
-
bgColor: Color?,
|
|
28
|
-
iterations: Int,
|
|
29
|
-
isPlaying: Boolean,
|
|
30
|
-
onEvent: ((String) -> Unit)?,
|
|
31
|
-
modifier: Modifier,
|
|
32
|
-
) {
|
|
33
|
-
val json = readJson(path)
|
|
34
|
-
|
|
35
|
-
if (json.isEmpty()) {
|
|
36
|
-
Box(modifier.background(bgColor ?: Color.Transparent))
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
val composition by rememberLottieComposition(json) {
|
|
41
|
-
LottieCompositionSpec.JsonString(json)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
val dynamicProperties = if (tintColor != null) {
|
|
45
|
-
rememberLottieDynamicProperties(tintColor) {
|
|
46
|
-
shapeLayer("**") {
|
|
47
|
-
fill("**") { color { tintColor } }
|
|
48
|
-
stroke("**") { color { tintColor } }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
null
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
val lottieState = animateLottieCompositionAsState(
|
|
56
|
-
composition = composition,
|
|
57
|
-
iterations = iterations,
|
|
58
|
-
isPlaying = isPlaying,
|
|
59
|
-
restartOnPlay = false,
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
val currentOnEvent by rememberUpdatedState(onEvent)
|
|
63
|
-
|
|
64
|
-
LaunchedEffect(isPlaying) {
|
|
65
|
-
currentOnEvent?.invoke(if (isPlaying) LottieEvent.Start else LottieEvent.Pause)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
LaunchedEffect(lottieState) {
|
|
69
|
-
var armed = false
|
|
70
|
-
snapshotFlow { lottieState.isAtEnd }.collect { atEnd ->
|
|
71
|
-
if (!atEnd) armed = true
|
|
72
|
-
else if (armed) { armed = false; currentOnEvent?.invoke(LottieEvent.Finish) }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
Box(modifier.background(bgColor ?: Color.Transparent)) {
|
|
77
|
-
Image(
|
|
78
|
-
painter = rememberLottiePainter(
|
|
79
|
-
composition = composition,
|
|
80
|
-
progress = lottieState::value,
|
|
81
|
-
dynamicProperties = dynamicProperties,
|
|
82
|
-
enableExpressions = false,
|
|
83
|
-
expressionEngineFactory = { _, _ ->
|
|
84
|
-
error("Lottie JS expressions are disabled in MoMo kits")
|
|
85
|
-
},
|
|
86
|
-
),
|
|
87
|
-
contentDescription = null,
|
|
88
|
-
modifier = Modifier.fillMaxSize(),
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.platform
|
|
2
|
-
|
|
3
|
-
import androidx.compose.runtime.Composable
|
|
4
|
-
|
|
5
|
-
// Overrides LocalDensity.fontScale with the live OS Dynamic Type scale so text re-scales while a
|
|
6
|
-
// screen is visible. Wrapped inside the containers so every screen is covered, not just callers of
|
|
7
|
-
// the app-level wrappers.
|
|
8
|
-
@Composable
|
|
9
|
-
expect fun ProvideOsFontScale(content: @Composable () -> Unit)
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
package vn.momo.kits.platform
|
|
2
|
-
|
|
3
|
-
import androidx.compose.runtime.Composable
|
|
4
|
-
import androidx.compose.ui.Modifier
|
|
5
|
-
import androidx.compose.ui.graphics.Color
|
|
6
|
-
import androidx.compose.ui.graphics.NativePaint
|
|
7
|
-
import androidx.compose.ui.unit.Dp
|
|
8
|
-
|
|
9
|
-
data class ScreenDimension(
|
|
10
|
-
val width: Int,
|
|
11
|
-
val height: Int,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
expect fun getPlatformName(): String
|
|
15
|
-
|
|
16
|
-
@Composable
|
|
17
|
-
expect fun getScreenDimensions(): ScreenDimension
|
|
18
|
-
|
|
19
|
-
expect fun NativePaint.setMaskFilter(blurRadius: Float)
|
|
20
|
-
|
|
21
|
-
@Composable
|
|
22
|
-
expect fun getStatusBarHeight(): Dp
|
|
23
|
-
|
|
24
|
-
@Composable
|
|
25
|
-
expect fun BackHandler(enabled: Boolean, onBack: () -> Unit)
|
|
26
|
-
|
|
27
|
-
@Composable
|
|
28
|
-
expect fun ProvideNavigationEventDispatcherOwner(content: @Composable () -> Unit)
|
|
29
|
-
|
|
30
|
-
@Composable
|
|
31
|
-
expect fun getScreenHeight(): Dp
|
|
32
|
-
|
|
33
|
-
sealed interface OSVersion {
|
|
34
|
-
val value: Int
|
|
35
|
-
data class Android(val sdk: Int) : OSVersion { override val value: Int get() = sdk }
|
|
36
|
-
data class IOS(val major: Int) : OSVersion { override val value: Int get() = major }
|
|
37
|
-
|
|
38
|
-
operator fun compareTo(other: Int): Int = value.compareTo(other)
|
|
39
|
-
}
|
|
40
|
-
expect fun getOSVersion(): OSVersion
|
|
41
|
-
|
|
42
|
-
fun supportsImePadding(): Boolean = when (val v = getOSVersion()) {
|
|
43
|
-
is OSVersion.Android -> v.sdk > 29
|
|
44
|
-
is OSVersion.IOS -> true
|
|
45
|
-
}
|
|
46
|
-
const val LottieIterateForever: Int = Int.MAX_VALUE
|
|
47
|
-
|
|
48
|
-
object LottieEvent {
|
|
49
|
-
const val Start = "start"
|
|
50
|
-
const val Pause = "pause"
|
|
51
|
-
const val Finish = "finish"
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@Composable
|
|
55
|
-
expect fun LottieAnimation(
|
|
56
|
-
path: String,
|
|
57
|
-
tintColor: Color? = null,
|
|
58
|
-
bgColor: Color? = null,
|
|
59
|
-
placedAsOverlay: Boolean = false,
|
|
60
|
-
iterations: Int = LottieIterateForever,
|
|
61
|
-
isPlaying: Boolean = true,
|
|
62
|
-
onEvent: ((String) -> Unit)? = null,
|
|
63
|
-
modifier: Modifier = Modifier,
|
|
64
|
-
useCompose: Boolean = false
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
expect fun NativePaint.setColor(
|
|
68
|
-
color: Color = Color.Black
|
|
69
|
-
)
|