Closed maheshmobile closed 1 year ago
I don't see a click handler in your sample code. Would it be possible to attach a sample project? I've changed animations from click handlers many times and it should work.
I'm going to close this due to lack of activity. If this is still an issue, feel free to reopen with a repro project.
On button click action I am changing animation.json file from raw directory.based on if condition, but it is not changing/updating with new setAnimation(expired_dark or expired_light).
Note: I am using only one LottieAnimationView inwhich I am trying to replace dark & light animation json based on button click event
<com.airbnb.lottie.LottieAnimationView android:id="@+id/expired_icon" android:layout_width="40dp" android:layout_height="37dp" android:layout_marginTop="-19dp" app:lottie_autoPlay="true" app:lottie_loop="true" />
I tried by changing app:lottie_autoPlay="true" app:lottie_loop="true" and app:lottie_autoPlay="false" app:lottie_loop="false"
Checklist
Java code
**LottieAnimationView sanimationView_status = view.findViewById(R.id.expired_icon); animationView_status.setSafeMode(true);
Always shows initial mapped json animation, example if i luanch app with dark mode it shows expired_dark animation, if it light mode it shows expired_light animation but if I chnage by click action not chnaging.