Skip to content

Commit

Permalink
[Compose] Set merge paths before the composition (#1997)
Browse files Browse the repository at this point in the history
The correct value for merge paths must be set before setting the composition.

Fixes #1970
  • Loading branch information
gpeal authored Jan 16, 2022
1 parent 516ecba commit 1c1fe29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG_COMPOSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Added support for loading animations via content provider URIs (LottieCompositionSpec.ContentProvider) ([#1982](https://github.com/airbnb/lottie-android/pull/1982))
* Fixed dynamic gradient properties ([#1969](https://github.com/airbnb/lottie-android/pull/1969)).
* Prevent infinite animations from hanging espresso tests by using the same mechanism as androidx animations ([#1987](https://github.com/airbnb/lottie-android/pull/1987))
* Set the merge paths property before the composition to avoid building the composition layer with the wrong merge paths value and triggering a second rebuilt ([#1997](https://github.com/airbnb/lottie-android/pull/1997))

# 4.2.0
* [BREAKING CHANGE] LottieAnimation will now default to the composition size rather than `fillMaxSize()` ([#1892](https://github.com/airbnb/lottie-android/pull/1892))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ fun LottieAnimation(
matrix.preTranslate(translation.x.toFloat(), translation.y.toFloat())
matrix.preScale(scale.scaleX, scale.scaleY)

drawable.enableMergePathsForKitKatAndAbove(enableMergePaths)
drawable.composition = composition
if (dynamicProperties !== setDynamicProperties) {
setDynamicProperties?.removeFrom(drawable)
Expand All @@ -113,7 +114,6 @@ fun LottieAnimation(
}
drawable.setOutlineMasksAndMattes(outlineMasksAndMattes)
drawable.isApplyingOpacityToLayersEnabled = applyOpacityToLayers
drawable.enableMergePathsForKitKatAndAbove(enableMergePaths)
drawable.useSoftwareRendering(useSoftwareRendering)
drawable.maintainOriginalImageBounds = maintainOriginalImageBounds
drawable.clipToCompositionBounds = clipToComposition
Expand Down

0 comments on commit 1c1fe29

Please sign in to comment.