Reputation: 1588
I am using lottie for animation from here it is working perfect but it is not working for android 4.4, 4.3 and 4.2 how can fix it. also if I check an animation with lottie preview app in my device which is android API 24 . it says this warning:
Animation contains merge paths. merge paths are only supported on kitkat+ and must be manually enabled by calling enableMergePathsForKitkatandAbove()
Upvotes: 3
Views: 4172
Reputation: 3487
enableMergePathsForKitKatAndAbove in XML & Code.
XML
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/anim_view_vpn_status"
android:layout_width="@dimen/lottie_view_width"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/status_view_top_margin"
app:lottie_autoPlay="true"
app:lottie_enableMergePathsForKitKatAndAbove="true"
app:lottie_loop="true" />
Code
vpnStatusAnimView = (LottieAnimationView) findViewById(R.id.anim_view_vpn_status);
vpnStatusAnimView.enableMergePathsForKitKatAndAbove(true);
Upvotes: 0
Reputation: 725
Try to put this in you XML file in the com.airbnb.lottie.LottieAnimationView
app:lottie_enableMergePathsForKitKatAndAbove="true"
Or in your activity
vpnStatusAnimView = (LottieAnimationView) findViewById(R.id.anim_view_vpn_status);
vpnStatusAnimView.enableMergePathsForKitKatAndAbove(true)
You will still have that warning message tho..
Upvotes: 2