-
-
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 generalized Lottie Feature Flags API #2512
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 getting started with this!
return lottieDrawable.isFeatureFlagEnabled(LottieFeatureFlags.FeatureFlag.MergePathsApi19); | ||
} | ||
|
||
public void enableFeatureFlag(LottieFeatureFlags.FeatureFlag flag, boolean enable) { |
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.
Could you add docs here since this is a new public API?
I would make it extra explicit that people validate that opted in features look acceptable across all supported API levels.
|
||
import java.util.HashSet; | ||
|
||
public class LottieFeatureFlags { |
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.
Let's move LottieFeatureFlags
to a package that's package-private so we don't expose this class in the public API and make FeatureFlag
a top-level public enum LottieFeatureFlag
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.
Looks good! Would you like to add this API to lottie-compose as well or would you like me to?
I could add it, but I also thought that was covered by adding it to LottiePainter.kt and LottieAnimation.kt, so I'd need to be pointed in the right direction. We can followup later or in another PR. |
I'll add support for Compose in a bit |
Currently there are individual methods for enabling and disabling Merge Paths in Lottie. This PR aims to generalize these functions as we consider adding more features guarded behind opt-in flags.
See jbeta51#2 for draft comments.