-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for layer blend mode "bm" for NORMAL, SCREEN, OVERLAY, DARKEN, LIGHTEN, and ADD #2408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a stab at this!
I want to land this but in the past, I have been hesitant to launch feature that require new platforms until the usage of that platform is very high. About 75% of Android phones are on Q and above but most apps aren't there with their minSdk yet.
The use case I'm concerned about is somebody landing an animation that looks correct during development but looks completely broken for end users with old phones.
The only other time I've launched something like this was enableMergePathsForKitKatAndAbove in which it's opt-in and the API makes it very clear what the platform restrictions are.
Also, if you add animations to this folder, they will automatically be picked up by snapshot tests.
lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/model/content/LBlendMode.java
Outdated
Show resolved
Hide resolved
…ontent.java Co-authored-by: Gabriel Peal <[email protected]>
Co-authored-by: Gabriel Peal <[email protected]>
…e.java Co-authored-by: Gabriel Peal <[email protected]>
Thank you for the feedback. I understand what you mean by the version check. I could suggest rolling back a little and only supporting the blend modes that have lower minsdk requirements, and continue working on it from there. Does that seem like a more prudent approach? Also I wasn't entirely sure about the structure of that enum, it feels overly verbose to me. However since Done! |
lottie/src/main/java/com/airbnb/lottie/model/content/LBlendMode.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java
Outdated
Show resolved
Hide resolved
Pushing new changes:
|
# Conflicts: # lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java # lottie/src/main/java/com/airbnb/lottie/model/content/LBlendMode.java
The supported modes look consistent to me on 23 and 31 now |
lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/animation/content/FillContent.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/model/content/LBlendMode.java
Outdated
Show resolved
Hide resolved
lottie/src/main/java/com/airbnb/lottie/model/content/LBlendMode.java
Outdated
Show resolved
Hide resolved
…ontent.java Co-authored-by: Gabriel Peal <[email protected]>
# Conflicts: # lottie/src/main/java/com/airbnb/lottie/parser/LayerParser.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
Adds support for "bm" (BlendMode) on layers. Possibly addresses #1055
Might need a little bit of a refactor. Relies on
Paint.setBlendMode()
available in android Q and up.Sample before & after