@granite-js/lottie 1.0.4 → 1.0.6
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/default/java/run/granite/lottie/builtin/BuiltInLottieProvider.kt +7 -0
- package/android/src/main/java/run/granite/lottie/GraniteLottieProvider.kt +1 -0
- 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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -208,6 +208,13 @@ class BuiltInLottieProvider : GraniteLottieProvider {
|
|
|
208
208
|
animationViews[view]?.cancelAnimation()
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
override fun disposeView(view: View) {
|
|
212
|
+
animationViews[view]?.cancelAnimation()
|
|
213
|
+
animationViews[view]?.removeAllAnimatorListeners()
|
|
214
|
+
animationViews.remove(view)
|
|
215
|
+
listeners.remove(view)
|
|
216
|
+
}
|
|
217
|
+
|
|
211
218
|
// Private helpers
|
|
212
219
|
|
|
213
220
|
private fun setupAnimatorListener(lottieView: LottieAnimationView, view: View) {
|
|
@@ -202,6 +202,10 @@ class GraniteLottieView(context: Context) : FrameLayout(context), GraniteLottieL
|
|
|
202
202
|
containerView?.let { provider?.reset(it) }
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
fun dispose() {
|
|
206
|
+
containerView?.let { provider?.disposeView(it) }
|
|
207
|
+
}
|
|
208
|
+
|
|
205
209
|
private fun loadAnimation() {
|
|
206
210
|
isLoaded = false
|
|
207
211
|
val p = provider ?: return
|
|
@@ -165,6 +165,11 @@ class GraniteLottieViewManager : SimpleViewManager<GraniteLottieView>(),
|
|
|
165
165
|
view.reset()
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
override fun onDropViewInstance(view: GraniteLottieView) {
|
|
169
|
+
view.dispose()
|
|
170
|
+
super.onDropViewInstance(view)
|
|
171
|
+
}
|
|
172
|
+
|
|
168
173
|
companion object {
|
|
169
174
|
const val NAME = "GraniteLottieView"
|
|
170
175
|
}
|