@momo-kits/native-kits 0.160.1-beta.11-debug → 0.160.1-beta.13-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 +11 -0
- package/compose/build.gradle.kts +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +10 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +16 -10
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +3 -5
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +2 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +1 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +10 -6
- package/gradle.properties +1 -1
- package/local.properties +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(yarn react-native:*)",
|
|
5
|
+
"Read(//Users/phuc/.claude/skills/ai-skill-generator/**)",
|
|
6
|
+
"Bash(python3 scripts/install_skill.py --update)",
|
|
7
|
+
"Bash(cd /Users/phuc/momo-kits/.claude/skills/design-system-kits && mkdir -p .claude/skills/design-system-kits && mv SKILL.md README.md references .claude/skills/design-system-kits/)",
|
|
8
|
+
"Bash(mv .claude/skills/design-system-kits/* . && rmdir .claude/skills/design-system-kits && rmdir .claude/skills)"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
package/compose/build.gradle.kts
CHANGED
|
@@ -14,14 +14,13 @@ import androidx.compose.ui.graphics.Color
|
|
|
14
14
|
import androidx.compose.ui.graphics.NativePaint
|
|
15
15
|
import androidx.compose.ui.graphics.toArgb
|
|
16
16
|
import androidx.compose.ui.platform.LocalConfiguration
|
|
17
|
-
import androidx.compose.ui.semantics.contentDescription
|
|
18
|
-
import androidx.compose.ui.semantics.semantics
|
|
19
17
|
import androidx.compose.ui.unit.Dp
|
|
20
18
|
import androidx.compose.ui.unit.dp
|
|
21
19
|
import com.airbnb.lottie.LottieProperty
|
|
22
20
|
import com.airbnb.lottie.compose.LottieAnimation
|
|
23
21
|
import com.airbnb.lottie.compose.LottieCompositionSpec
|
|
24
22
|
import com.airbnb.lottie.compose.LottieConstants
|
|
23
|
+
import com.airbnb.lottie.compose.animateLottieCompositionAsState
|
|
25
24
|
import com.airbnb.lottie.compose.rememberLottieComposition
|
|
26
25
|
import com.airbnb.lottie.compose.rememberLottieDynamicProperties
|
|
27
26
|
import com.airbnb.lottie.compose.rememberLottieDynamicProperty
|
|
@@ -78,6 +77,7 @@ actual fun LottieAnimation(
|
|
|
78
77
|
tintColor: Color?,
|
|
79
78
|
bgColor: Color?,
|
|
80
79
|
placedAsOverlay: Boolean,
|
|
80
|
+
isPlaying: Boolean,
|
|
81
81
|
modifier: Modifier
|
|
82
82
|
) {
|
|
83
83
|
val json = readJson(path)
|
|
@@ -91,6 +91,13 @@ actual fun LottieAnimation(
|
|
|
91
91
|
LottieCompositionSpec.JsonString(json)
|
|
92
92
|
)
|
|
93
93
|
|
|
94
|
+
val progress by animateLottieCompositionAsState(
|
|
95
|
+
composition = composition,
|
|
96
|
+
iterations = LottieConstants.IterateForever,
|
|
97
|
+
isPlaying = isPlaying,
|
|
98
|
+
restartOnPlay = false,
|
|
99
|
+
)
|
|
100
|
+
|
|
94
101
|
val colorFilter = PorterDuffColorFilter(
|
|
95
102
|
tintColor?.toArgb() ?: Color.White.toArgb(),
|
|
96
103
|
PorterDuff.Mode.SRC_ATOP
|
|
@@ -106,7 +113,7 @@ actual fun LottieAnimation(
|
|
|
106
113
|
|
|
107
114
|
LottieAnimation(
|
|
108
115
|
composition = composition,
|
|
109
|
-
|
|
116
|
+
progress = { progress },
|
|
110
117
|
dynamicProperties = if (tintColor != null) dynamicProperties else null,
|
|
111
118
|
modifier = modifier
|
|
112
119
|
)
|
|
@@ -97,6 +97,7 @@ fun Screen(
|
|
|
97
97
|
inputSearchProps: InputSearchProps? = null,
|
|
98
98
|
useAnimationSearch: Boolean = false,
|
|
99
99
|
headerRightWidth: Dp = 0.dp,
|
|
100
|
+
usePlaceAsOverlay: Boolean = false,
|
|
100
101
|
content: @Composable () -> Unit,
|
|
101
102
|
) {
|
|
102
103
|
val statusBarHeight = getAppStatusBarHeight()
|
|
@@ -172,7 +173,7 @@ fun Screen(
|
|
|
172
173
|
Column(
|
|
173
174
|
modifier = Modifier.fillMaxSize()
|
|
174
175
|
.padding( top = when {
|
|
175
|
-
animatedHeader != null -> 0.dp
|
|
176
|
+
animatedHeader != null && !usePlaceAsOverlay -> 0.dp
|
|
176
177
|
headerType == HeaderType.NONE -> 0.dp
|
|
177
178
|
fullScreenContent -> 0.dp
|
|
178
179
|
else -> statusBarHeight + HEADER_HEIGHT.dp
|
|
@@ -196,10 +197,10 @@ fun Screen(
|
|
|
196
197
|
horizontalAlignment = horizontalAlignment
|
|
197
198
|
) {
|
|
198
199
|
Box {
|
|
199
|
-
if (animatedHeader !== null) headerAnimated()
|
|
200
|
+
if (!usePlaceAsOverlay && animatedHeader !== null) headerAnimated()
|
|
200
201
|
Column {
|
|
201
202
|
if (animatedHeader !== null) {
|
|
202
|
-
Spacer(modifier = Modifier.padding(top = statusBarHeight + HEADER_HEIGHT.dp + layoutOffset))
|
|
203
|
+
Spacer(modifier = Modifier.padding(top = if (usePlaceAsOverlay) layoutOffset else statusBarHeight + HEADER_HEIGHT.dp + layoutOffset))
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
if (useAnimationSearch && inputSearchProps != null && headerType == HeaderType.EXTENDED) {
|
|
@@ -217,6 +218,16 @@ fun Screen(
|
|
|
217
218
|
}
|
|
218
219
|
}
|
|
219
220
|
|
|
221
|
+
if (animatedHeader !== null && usePlaceAsOverlay) {
|
|
222
|
+
Box(
|
|
223
|
+
modifier = Modifier
|
|
224
|
+
.fillMaxWidth()
|
|
225
|
+
.zIndex(1.5f)
|
|
226
|
+
) {
|
|
227
|
+
headerAnimated()
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
220
231
|
Box(Modifier.zIndex(4f).align(Alignment.BottomCenter)) {
|
|
221
232
|
footer?.let {
|
|
222
233
|
Footer(
|
|
@@ -340,7 +351,7 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
340
351
|
val navigationBar = AppNavigationBar.current
|
|
341
352
|
|
|
342
353
|
val footerHeight = if (footerHeightPx > 0) {
|
|
343
|
-
|
|
354
|
+
footerHeightPx
|
|
344
355
|
} else {
|
|
345
356
|
with(density) {
|
|
346
357
|
navigationBar.toPx()
|
|
@@ -395,9 +406,4 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
|
|
|
395
406
|
is SnackBar.Toast -> {}
|
|
396
407
|
}
|
|
397
408
|
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
409
|
+
}
|
|
@@ -234,10 +234,8 @@ fun ColumnScope.MainContent(content: @Composable ()-> Unit){
|
|
|
234
234
|
val density = LocalDensity.current
|
|
235
235
|
val scrollState = LocalScrollState.current
|
|
236
236
|
|
|
237
|
-
Spacer(Modifier.height(
|
|
238
|
-
|
|
239
|
-
AppStatusBar.current + HEADER_HEIGHT.dp else 0.dp)
|
|
240
|
-
)
|
|
237
|
+
Spacer(Modifier.height(if (options.headerType is HeaderType.Transparent || options.headerType is HeaderType.None) 0.dp else AppStatusBar.current + HEADER_HEIGHT.dp))
|
|
238
|
+
|
|
241
239
|
if (inputSearchType == InputSearchType.Animated){
|
|
242
240
|
val scrollDp = with(density) { scrollState.value.toDp() }
|
|
243
241
|
|
|
@@ -250,7 +248,7 @@ fun ColumnScope.MainContent(content: @Composable ()-> Unit){
|
|
|
250
248
|
Column (Modifier
|
|
251
249
|
.fillMaxWidth()
|
|
252
250
|
.weight(1f)
|
|
253
|
-
.conditional(options.scrollData.scrollable && options.scrollData.scrollState
|
|
251
|
+
.conditional(options.scrollData.scrollable && options.scrollData.scrollState is ScrollState) {
|
|
254
252
|
verticalScroll(scrollState)
|
|
255
253
|
}
|
|
256
254
|
) {
|
|
@@ -230,6 +230,8 @@ sealed class HeaderType {
|
|
|
230
230
|
|
|
231
231
|
data object None : HeaderType()
|
|
232
232
|
|
|
233
|
+
data object Transparent : HeaderType()
|
|
234
|
+
|
|
233
235
|
data class Animated(
|
|
234
236
|
val aspectRatio: AnimatedHeaderRatio = AnimatedHeaderRatio.RATIO_16_9,
|
|
235
237
|
val isSurface: Boolean = true,
|
|
@@ -237,9 +239,6 @@ sealed class HeaderType {
|
|
|
237
239
|
val composable: @Composable (scrollState: Int) -> Unit = {}
|
|
238
240
|
) : HeaderType()
|
|
239
241
|
|
|
240
|
-
data class Transparent(
|
|
241
|
-
val isFullScreenContent: Boolean = false
|
|
242
|
-
) : HeaderType()
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
data class HeaderBackProps(
|
|
@@ -19,20 +19,18 @@ 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
|
|
27
25
|
import androidx.compose.ui.viewinterop.UIKitView
|
|
26
|
+
import androidx.navigationevent.NavigationEventDispatcher
|
|
27
|
+
import androidx.navigationevent.NavigationEventDispatcherOwner
|
|
28
28
|
import cocoapods.lottie_ios.CompatibleAnimation
|
|
29
29
|
import cocoapods.lottie_ios.CompatibleAnimationKeypath
|
|
30
30
|
import cocoapods.lottie_ios.CompatibleAnimationView
|
|
31
31
|
import kotlinx.cinterop.ExperimentalForeignApi
|
|
32
32
|
import kotlinx.cinterop.get
|
|
33
33
|
import kotlinx.cinterop.memScoped
|
|
34
|
-
import androidx.navigationevent.NavigationEventDispatcher
|
|
35
|
-
import androidx.navigationevent.NavigationEventDispatcherOwner
|
|
36
34
|
import org.jetbrains.skia.FilterBlurMode
|
|
37
35
|
import org.jetbrains.skia.MaskFilter
|
|
38
36
|
import platform.Foundation.NSBundle
|
|
@@ -98,6 +96,7 @@ actual fun LottieAnimation(
|
|
|
98
96
|
tintColor: Color?,
|
|
99
97
|
bgColor: Color?,
|
|
100
98
|
placedAsOverlay: Boolean,
|
|
99
|
+
isPlaying: Boolean,
|
|
101
100
|
modifier: Modifier
|
|
102
101
|
) {
|
|
103
102
|
var animation by remember { mutableStateOf<CompatibleAnimation?>(null) }
|
|
@@ -115,7 +114,10 @@ actual fun LottieAnimation(
|
|
|
115
114
|
Box(modifier) {
|
|
116
115
|
UIKitView(
|
|
117
116
|
modifier = Modifier.fillMaxSize(),
|
|
118
|
-
properties = UIKitInteropProperties(
|
|
117
|
+
properties = UIKitInteropProperties(
|
|
118
|
+
interactionMode = null,
|
|
119
|
+
placedAsOverlay = placedAsOverlay,
|
|
120
|
+
),
|
|
119
121
|
factory = {
|
|
120
122
|
CompatibleAnimationView(value).apply {
|
|
121
123
|
translatesAutoresizingMaskIntoConstraints = true
|
|
@@ -136,7 +138,7 @@ actual fun LottieAnimation(
|
|
|
136
138
|
setColorValue(uiColor, CompatibleAnimationKeypath("**.Stroke.Color"))
|
|
137
139
|
}
|
|
138
140
|
|
|
139
|
-
play()
|
|
141
|
+
if (isPlaying) play() else pause()
|
|
140
142
|
}
|
|
141
143
|
},
|
|
142
144
|
|
|
@@ -152,6 +154,8 @@ actual fun LottieAnimation(
|
|
|
152
154
|
view.setColorValue(uiColor, CompatibleAnimationKeypath("**.Stroke 1.Color"))
|
|
153
155
|
view.setColorValue(uiColor, CompatibleAnimationKeypath("**.Stroke.Color"))
|
|
154
156
|
}
|
|
157
|
+
|
|
158
|
+
if (isPlaying) view.play() else view.pause()
|
|
155
159
|
}
|
|
156
160
|
)
|
|
157
161
|
}
|
package/gradle.properties
CHANGED
package/local.properties
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Mon Dec 22 10:07:29 ICT 2025
|
|
8
|
+
sdk.dir=/Users/phuc/Library/Android/sdk
|