@granite-js/lottie 1.0.15 → 1.0.17
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/CHANGELOG.md +8 -0
- package/android/src/main/java/run/granite/lottie/GraniteLottieProvider.kt +2 -1
- package/android/src/main/java/run/granite/lottie/GraniteLottieView.kt +4 -0
- package/android/src/main/java/run/granite/lottie/GraniteLottieViewManager.kt +5 -0
- package/dist/module/GraniteLottieViewNativeComponent.ts +1 -0
- package/dist/typescript/GraniteLottieViewNativeComponent.d.ts +1 -0
- package/package.json +1 -1
- package/src/GraniteLottieViewNativeComponent.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -91,7 +91,8 @@ data class GraniteLottieLoadConfig(
|
|
|
91
91
|
var enableMergePaths: Boolean = false,
|
|
92
92
|
var enableSafeMode: Boolean = false,
|
|
93
93
|
var hardwareAcceleration: Boolean = false,
|
|
94
|
-
var imageAssetsFolder: String? = null
|
|
94
|
+
var imageAssetsFolder: String? = null,
|
|
95
|
+
var duration: Float? = null
|
|
95
96
|
)
|
|
96
97
|
|
|
97
98
|
/**
|
|
@@ -154,6 +154,10 @@ class GraniteLottieView(context: Context) : FrameLayout(context), GraniteLottieL
|
|
|
154
154
|
config.imageAssetsFolder = folder
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
fun setDuration(duration: Double) {
|
|
158
|
+
config.duration = if (duration > 0) duration.toFloat() else null
|
|
159
|
+
}
|
|
160
|
+
|
|
157
161
|
fun setColorFilters(filters: List<Map<String, Any>>?) {
|
|
158
162
|
if (filters != null) {
|
|
159
163
|
config.colorFilters = filters.mapNotNull { filter ->
|
|
@@ -112,6 +112,11 @@ class GraniteLottieViewManager : SimpleViewManager<GraniteLottieView>(),
|
|
|
112
112
|
view.setCacheComposition(value)
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
@ReactProp(name = "duration")
|
|
116
|
+
override fun setDuration(view: GraniteLottieView, value: Double) {
|
|
117
|
+
view.setDuration(value)
|
|
118
|
+
}
|
|
119
|
+
|
|
115
120
|
// Filter props
|
|
116
121
|
@ReactProp(name = "colorFilters")
|
|
117
122
|
override fun setColorFilters(view: GraniteLottieView, value: ReadableArray?) {
|
|
@@ -27,6 +27,7 @@ export interface NativeProps extends ViewProps {
|
|
|
27
27
|
sourceDotLottieURI?: string;
|
|
28
28
|
progress?: Float;
|
|
29
29
|
speed?: Double;
|
|
30
|
+
duration?: Double;
|
|
30
31
|
loop?: WithDefault<boolean, true>;
|
|
31
32
|
autoPlay?: WithDefault<boolean, false>;
|
|
32
33
|
resizeMode?: WithDefault<string, 'contain'>;
|
package/package.json
CHANGED