From cc1486b80608a95db1aab10f0392e269ed7cc24d Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 15 Jul 2019 12:00:52 +0800 Subject: [PATCH 1/7] Add enableMergePathsForKitKatAndAbove = true --- android/src/main/java/com/example/flutter_lottie/LottieView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/java/com/example/flutter_lottie/LottieView.java b/android/src/main/java/com/example/flutter_lottie/LottieView.java index 255b3ff..910ada5 100644 --- a/android/src/main/java/com/example/flutter_lottie/LottieView.java +++ b/android/src/main/java/com/example/flutter_lottie/LottieView.java @@ -33,6 +33,7 @@ public class LottieView implements PlatformView, MethodChannel.MethodCallHandler mArgs = args; mRegistrar = registrar; animationView = new LottieAnimationView(context); + animationView.enableMergePathsForKitKatAndAbove(true); Map params = (Map) args; create(params); From 620a056c7ff2f05023b8b069794397257f94ae7c Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 15 Jul 2019 12:10:44 +0800 Subject: [PATCH 2/7] Update lottie_android to 3.0.7 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index ba998e0..d7447aa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -34,5 +34,5 @@ android { } dependencies { - implementation 'com.airbnb.android:lottie:2.7.0' + implementation 'com.airbnb.android:lottie:3.0.7' } From 624679fa610cceb7c5a84dcb50078a79a1fa5765 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 15 Jul 2019 13:48:44 +0800 Subject: [PATCH 3/7] Upgrade to AndroidX --- android/build.gradle | 5 +++-- android/gradle.properties | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index d7447aa..bbe0a48 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.3.0' } } @@ -26,7 +26,8 @@ android { defaultConfig { minSdkVersion 16 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + targetSdkVersion 28 + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..678cd62 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,3 @@ org.gradle.jvmargs=-Xmx1536M +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file From d7994b113ba7d332018fbdfff0a002a4c209d787 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 9 Sep 2019 12:27:09 +0800 Subject: [PATCH 4/7] Used enums LottieDrawable instead of int --- .../com/example/flutter_lottie/LottieView.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/com/example/flutter_lottie/LottieView.java b/android/src/main/java/com/example/flutter_lottie/LottieView.java index 910ada5..c44606e 100644 --- a/android/src/main/java/com/example/flutter_lottie/LottieView.java +++ b/android/src/main/java/com/example/flutter_lottie/LottieView.java @@ -5,6 +5,7 @@ import android.graphics.Color; import android.view.View; import com.airbnb.lottie.LottieAnimationView; +import com.airbnb.lottie.LottieDrawable; import com.airbnb.lottie.LottieProperty; import com.airbnb.lottie.model.KeyPath; import com.airbnb.lottie.value.LottieValueCallback; @@ -80,9 +81,9 @@ public void onCancel(Object o) { maxFrame = animationView.getMaxFrame(); if(reverse) { - animationView.setRepeatMode(2); + animationView.setRepeatMode(LottieDrawable.REVERSE); } else { - animationView.setRepeatMode(1); + animationView.setRepeatMode(LottieDrawable.RESTART); } if(autoPlay) { @@ -166,7 +167,7 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) { animationView.cancelAnimation(); animationView.setProgress(0.0f); final int mode = animationView.getRepeatMode(); - animationView.setRepeatMode(1); + animationView.setRepeatMode(LottieDrawable.RESTART); animationView.setRepeatMode(mode); break; case "pause": @@ -182,9 +183,9 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) { case "setAutoReverseAnimation": boolean reverse = ((args.get("reverse")) != null) ? Boolean.parseBoolean(args.get("reverse").toString()) : false; if(reverse) { - animationView.setRepeatMode(2); + animationView.setRepeatMode(LottieDrawable.REVERSE); } else { - animationView.setRepeatMode(1); + animationView.setRepeatMode(LottieDrawable.RESTART); } break; case "setAnimationProgress": @@ -207,10 +208,10 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) { result.success((double)animationView.getSpeed()); break; case "getLoopAnimation": - result.success(animationView.getRepeatCount() == -1 ? true : false); + result.success(animationView.getRepeatCount() == LottieDrawable.INFINITE ? true : false); break; case "getAutoReverseAnimation": - result.success(animationView.getRepeatMode() == 2 ? true : false); + result.success(animationView.getRepeatMode() == LottieDrawable.REVERSE ? true : false); break; case "setValue": final String value = args.get("value").toString(); From 515bac1d290216115167ee263e749bead8ea3324 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 9 Sep 2019 12:27:30 +0800 Subject: [PATCH 5/7] Updated pubspec.lock --- example/pubspec.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index c332687..11734a0 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: async: dependency: transitive @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.2.0" boolean_selector: dependency: transitive description: @@ -59,7 +59,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.5" meta: dependency: transitive description: @@ -80,14 +80,14 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.7.0" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" sky_engine: dependency: transitive description: flutter @@ -99,7 +99,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.4" + version: "1.5.5" stack_trace: dependency: transitive description: @@ -113,7 +113,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.0.0" string_scanner: dependency: transitive description: @@ -134,7 +134,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.5" typed_data: dependency: transitive description: @@ -150,4 +150,4 @@ packages: source: hosted version: "2.0.8" sdks: - dart: ">=2.1.0 <3.0.0" + dart: ">=2.2.2 <3.0.0" From 36d9f2e7cfa86878a42c58ed64e6b02d9a572b9b Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 9 Sep 2019 12:27:43 +0800 Subject: [PATCH 6/7] Updated pubspec.lock --- pubspec.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index ea890ff..7642229 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: async: dependency: transitive @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.2.0" boolean_selector: dependency: transitive description: @@ -45,7 +45,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.5" meta: dependency: transitive description: @@ -66,14 +66,14 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.4.0" + version: "1.7.0" quiver: dependency: transitive description: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" sky_engine: dependency: transitive description: flutter @@ -85,7 +85,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.4" + version: "1.5.5" stack_trace: dependency: transitive description: @@ -99,7 +99,7 @@ packages: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.0.0" string_scanner: dependency: transitive description: @@ -120,7 +120,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.5" typed_data: dependency: transitive description: @@ -136,4 +136,4 @@ packages: source: hosted version: "2.0.8" sdks: - dart: ">=2.1.0 <3.0.0" + dart: ">=2.2.2 <3.0.0" From 5db54f67d2137e6bc5b1682c1789e6be2117bfb6 Mon Sep 17 00:00:00 2001 From: Joseph Date: Mon, 9 Sep 2019 12:27:59 +0800 Subject: [PATCH 7/7] Updated iml file --- flutter_lottie.iml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flutter_lottie.iml b/flutter_lottie.iml index 429df7d..1c8886c 100644 --- a/flutter_lottie.iml +++ b/flutter_lottie.iml @@ -1,18 +1,27 @@ + + + + + + + + + -