-
-
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
base: master
Are you sure you want to change the base?
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.
} | ||
|
||
/** | ||
* Enable this to get merge path support for devices running KitKat (19) and above. | ||
* Deprecated: Use enableFeatureFlag(LottieFeatureFlags.FeatureFlag.MergePathsApi19, 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.
You can use @deprecated
and @link
for proper javadoc syntax.
|
||
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
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.