@momo-kits/native-kits 0.160.3-debug → 0.160.4-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/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +1 -0
- 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 +8 -4
- package/gradle.properties +1 -1
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -12,17 +12,19 @@ import androidx.compose.runtime.getValue
|
|
|
12
12
|
import androidx.compose.runtime.mutableStateOf
|
|
13
13
|
import androidx.compose.runtime.remember
|
|
14
14
|
import androidx.compose.runtime.setValue
|
|
15
|
+
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
15
16
|
import androidx.compose.ui.InternalComposeUiApi
|
|
16
17
|
import androidx.compose.ui.Modifier
|
|
17
18
|
import androidx.compose.ui.backhandler.LocalCompatNavigationEventDispatcherOwner
|
|
18
19
|
import androidx.compose.ui.graphics.Color
|
|
19
20
|
import androidx.compose.ui.graphics.NativePaint
|
|
20
21
|
import androidx.compose.ui.graphics.toArgb
|
|
21
|
-
import androidx.compose.ui.interop.UIKitView
|
|
22
22
|
import androidx.compose.ui.semantics.SemanticsPropertyKey
|
|
23
23
|
import androidx.compose.ui.semantics.semantics
|
|
24
24
|
import androidx.compose.ui.unit.Dp
|
|
25
25
|
import androidx.compose.ui.unit.dp
|
|
26
|
+
import androidx.compose.ui.viewinterop.UIKitInteropProperties
|
|
27
|
+
import androidx.compose.ui.viewinterop.UIKitView
|
|
26
28
|
import cocoapods.lottie_ios.CompatibleAnimation
|
|
27
29
|
import cocoapods.lottie_ios.CompatibleAnimationKeypath
|
|
28
30
|
import cocoapods.lottie_ios.CompatibleAnimationView
|
|
@@ -89,12 +91,13 @@ actual fun getOSVersion(): OSVersion = OSVersion.IOS(
|
|
|
89
91
|
major = UIDevice.currentDevice.systemVersion.substringBefore(".").toIntOrNull() ?: 0
|
|
90
92
|
)
|
|
91
93
|
|
|
92
|
-
@OptIn(ExperimentalForeignApi::class)
|
|
94
|
+
@OptIn(ExperimentalForeignApi::class, ExperimentalComposeUiApi::class)
|
|
93
95
|
@Composable
|
|
94
96
|
actual fun LottieAnimation(
|
|
95
97
|
path: String,
|
|
96
98
|
tintColor: Color?,
|
|
97
99
|
bgColor: Color?,
|
|
100
|
+
placedAsOverlay: Boolean,
|
|
98
101
|
modifier: Modifier
|
|
99
102
|
) {
|
|
100
103
|
var animation by remember { mutableStateOf<CompatibleAnimation?>(null) }
|
|
@@ -112,11 +115,12 @@ actual fun LottieAnimation(
|
|
|
112
115
|
Box(modifier) {
|
|
113
116
|
UIKitView(
|
|
114
117
|
modifier = Modifier.fillMaxSize(),
|
|
118
|
+
properties = UIKitInteropProperties(placedAsOverlay = placedAsOverlay),
|
|
115
119
|
factory = {
|
|
116
120
|
CompatibleAnimationView(value).apply {
|
|
117
121
|
translatesAutoresizingMaskIntoConstraints = true
|
|
118
122
|
|
|
119
|
-
setBackgroundColor(bgColor?.toUIColor() ?: UIColor.
|
|
123
|
+
setBackgroundColor(bgColor?.toUIColor() ?: UIColor.clearColor)
|
|
120
124
|
|
|
121
125
|
setLoopAnimationCount(-1.0)
|
|
122
126
|
setAnimationSpeed(1.0)
|
|
@@ -137,7 +141,7 @@ actual fun LottieAnimation(
|
|
|
137
141
|
},
|
|
138
142
|
|
|
139
143
|
update = { view ->
|
|
140
|
-
view.setBackgroundColor(bgColor?.toUIColor() ?: UIColor.
|
|
144
|
+
view.setBackgroundColor(bgColor?.toUIColor() ?: UIColor.clearColor)
|
|
141
145
|
|
|
142
146
|
if (tintColor != null) {
|
|
143
147
|
val uiColor = tintColor.toUIColor()
|
package/gradle.properties
CHANGED