@@ -11,6 +11,7 @@ import android.os.Looper
11
11
import android.util.Log
12
12
import android.view.animation.AlphaAnimation
13
13
import android.view.animation.Animation
14
+ import android.webkit.WebView
14
15
import android.widget.ImageView
15
16
import com.airbnb.lottie.LottieAnimationView
16
17
import com.airbnb.lottie.LottieComposition
@@ -272,11 +273,11 @@ class LottieSplashScreen : CordovaPlugin() {
272
273
animationView.addAnimatorListener(
273
274
object : Animator .AnimatorListener {
274
275
override fun onAnimationStart (animation : Animator ) {
275
- webView.engine? .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationStart'))" ) { }
276
+ ( webView.getView() as WebView ) .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationStart'))" ) { }
276
277
}
277
278
278
279
override fun onAnimationEnd (animation : Animator ) {
279
- webView.engine? .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationEnd'))" ) { }
280
+ ( webView.getView() as WebView ) .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationEnd'))" ) { }
280
281
val hideAfterAnimationDone = preferences.getBoolean(
281
282
" LottieHideAfterAnimationEnd" ,
282
283
false
@@ -288,11 +289,11 @@ class LottieSplashScreen : CordovaPlugin() {
288
289
}
289
290
290
291
override fun onAnimationCancel (animation : Animator ) {
291
- webView.engine? .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationCancel'))" ) { }
292
+ ( webView.getView() as WebView ) .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationCancel'))" ) { }
292
293
}
293
294
294
295
override fun onAnimationRepeat (animation : Animator ) {
295
- webView.engine? .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationRepeat'))" ) { }
296
+ ( webView.getView() as WebView ) .evaluateJavascript(" document.dispatchEvent(new Event('lottieAnimationRepeat'))" ) { }
296
297
}
297
298
}
298
299
)
0 commit comments