airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
35.02k stars 5.42k forks source link

When I set a different size, the animation flashes #2329

Closed zhangzhuo1024 closed 10 months ago

zhangzhuo1024 commented 1 year ago

What version of Lottie did you test this on? implementation 'com.airbnb.android:lottie:6.0.0'

What version of Android did you test this on? android11

The same json file, when I set the LottieAnimationView to a smaller size, the animation worked fine; When I set the LottieAnimationView to a larger size, the animation flashes

<com.airbnb.lottie.LottieAnimationView
    android:layout_width="match_parent"
    android:layout_height="500dp"
    app:lottie_autoPlay="true"
    app:lottie_fileName="91502-waves.json"
    app:lottie_loop="true"
    app:lottie_speed="1" />
<com.airbnb.lottie.LottieAnimationView
    android:layout_width="180dp"
    android:layout_height="180dp"
    app:lottie_autoPlay="true"
    app:lottie_fileName="91502-waves.json"
    app:lottie_loop="true"
    app:lottie_speed="1" />

videotogif_20230704_163943

zhangzhuo1024 commented 1 year ago

The same results were found on the simulator

gpeal commented 1 year ago

Can you attach your animation? Does this happen when you set renderMode to both software and hardware?

zhangzhuo1024 commented 1 year ago

mywaves.zip

Adding Android: hardwareAccelerated="true" to the activity also has no effect