diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d30f6dfc..c5f1ddfa0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ +# 2.5.1 +### Features and Improvements +* Removed framerate restriction introduced in 2.5.0 that caused Lottie to attempt to render at the After Effects framerate. This caused animations to appear unexpectedly janky in most cases. +### Bugs Fixed +* Many minor bug fixes around setting min/max frames +* Removed @RestrictTo on LottieValueCallback +* Improved thread safety of animation listeners +* Fixed looping when the animation speed is reversed + + # 2.5.0 +### Features and Improvements * Added the ability to dynamically change properties at runtime. See [docs](http://airbnb.io/lottie/android/dynamic.html) for more info. This feature removed the existing APIs for -changing the color dynamically with a color filter. Refer to the docs for migration info from +changing the color dynamically with a color filter. Refer to the docs for migration info from existing ColorFilter APIs. * Added a setRepeatMode and setRepeatCount (Thanks Fabio Nuno!). * Completely overhauled json deserialization. Deserializing a composition takes half as long and diff --git a/LottieSample/build.gradle b/LottieSample/build.gradle index ea353db28c..3fa402e569 100644 --- a/LottieSample/build.gradle +++ b/LottieSample/build.gradle @@ -13,8 +13,8 @@ android { applicationId "com.airbnb.lottie" minSdkVersion 16 targetSdkVersion 27 - versionCode 34 - versionName "2.5.0" + versionCode 35 + versionName "2.5.1" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/README.md b/README.md index 2632199767..d085f2aa14 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,6 @@ Gradle is the only supported build configuration, so just add the dependency to ```groovy dependencies { - compile 'com.airbnb.android:lottie:2.5.0' + compile 'com.airbnb.android:lottie:2.5.1' } ``` diff --git a/gradle.properties b/gradle.properties index 3f1b78776e..b8cbb11b77 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -VERSION_NAME=2.5.0 +VERSION_NAME=2.5.1 GROUP=com.airbnb.android POM_DESCRIPTION=Lottie is an animation library that renders Adobe After Effects animations natively in realtime. diff --git a/lottie/build.gradle b/lottie/build.gradle index 7fdd5a4b89..93a74c1321 100644 --- a/lottie/build.gradle +++ b/lottie/build.gradle @@ -10,7 +10,7 @@ android { minSdkVersion 16 targetSdkVersion 27 versionCode 100 - versionName "2.5.0" + versionName "2.5.1" } lintOptions { abortOnError true diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java index a4328bb3c2..2bc075ee07 100644 --- a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java +++ b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java @@ -703,6 +703,12 @@ public boolean isAnimating() { * * If your images are located in src/main/assets/airbnb_loader/ then call * `setImageAssetsFolder("airbnb_loader/");`. + * + * Be wary if you are using many images, however. Lottie is designed to work with vector shapes + * from After Effects. If your images look like they could be represented with vector shapes, + * see if it is possible to convert them to shape layers and re-export your animation. Check + * the documentation at http://airbnb.io/lottie for more information about importing shapes from + * Sketch or Illustrator to avoid this. */ public void setImageAssetsFolder(String imageAssetsFolder) { lottieDrawable.setImagesAssetsFolder(imageAssetsFolder); @@ -728,6 +734,12 @@ public Bitmap updateBitmap(String id, @Nullable Bitmap bitmap) { * Use this if you can't bundle images with your app. This may be useful if you download the * animations from the network or have the images saved to an SD Card. In that case, Lottie * will defer the loading of the bitmap to this delegate. + * + * Be wary if you are using many images, however. Lottie is designed to work with vector shapes + * from After Effects. If your images look like they could be represented with vector shapes, + * see if it is possible to convert them to shape layers and re-export your animation. Check + * the documentation at http://airbnb.io/lottie for more information about importing shapes from + * Sketch or Illustrator to avoid this. */ public void setImageAssetDelegate(ImageAssetDelegate assetDelegate) { lottieDrawable.setImageAssetDelegate(assetDelegate); @@ -793,6 +805,9 @@ public void addValueCallback(KeyPath keyPath, T property, * animation down then rendering it in a larger ImageView and letting ImageView scale it back up * with a scaleType such as centerInside will yield better performance with little perceivable * quality loss. + * + * You can also use a fixed view width/height in conjunction with the normal ImageView + * scaleTypes centerCrop and centerInside. */ public void setScale(float scale) { lottieDrawable.setScale(scale); diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java index e3365067ef..fc33535a20 100644 --- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java +++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java @@ -157,6 +157,12 @@ public boolean isMergePathsEnabledForKitKatAndAbove() { * If you use LottieDrawable directly, you MUST call {@link #recycleBitmaps()} when you * are done. Calling {@link #recycleBitmaps()} doesn't have to be final and {@link LottieDrawable} * will recreate the bitmaps if needed but they will leak if you don't recycle them. + * + * Be wary if you are using many images, however. Lottie is designed to work with vector shapes + * from After Effects. If your images look like they could be represented with vector shapes, + * see if it is possible to convert them to shape layers and re-export your animation. Check + * the documentation at http://airbnb.io/lottie for more information about importing shapes from + * Sketch or Illustrator to avoid this. */ public void setImagesAssetsFolder(@Nullable String imageAssetsFolder) { this.imageAssetsFolder = imageAssetsFolder; @@ -604,6 +610,9 @@ public boolean isAnimating() { * animation down then rendering it in a larger ImageView and letting ImageView scale it back up * with a scaleType such as centerInside will yield better performance with little perceivable * quality loss. + * + * You can also use a fixed view width/height in conjunction with the normal ImageView + * scaleTypes centerCrop and centerInside. */ public void setScale(float scale) { this.scale = scale; @@ -614,6 +623,12 @@ public void setScale(float scale) { * Use this if you can't bundle images with your app. This may be useful if you download the * animations from the network or have the images saved to an SD Card. In that case, Lottie * will defer the loading of the bitmap to this delegate. + * + * Be wary if you are using many images, however. Lottie is designed to work with vector shapes + * from After Effects. If your images look like they could be represented with vector shapes, + * see if it is possible to convert them to shape layers and re-export your animation. Check + * the documentation at http://airbnb.io/lottie for more information about importing shapes from + * Sketch or Illustrator to avoid this. */ public void setImageAssetDelegate( @SuppressWarnings("NullableProblems") ImageAssetDelegate assetDelegate) {