ResourceMethod(@Nullable ClassName typeName, String name, boolean requiresResources, int sdk) { this.typeName = typeName; this.name = name; this.requiresResources = requiresResources; this.sdk = sdk; }
/** * Composition will be null if there was an error loading it. Check logcat for more details. */ void onCompositionLoaded(@Nullable LottieComposition composition); }
/** * Returns the bitmap that has been stored for this image asset if one was explicitly set. */ @Nullable public Bitmap getBitmap() { return bitmap; }
/** * Override this if you haven't set a static value in the constructor or with setValue. * * Return null to resort to the default value. */ @Nullable public T getValue(LottieFrameInfo<T> frameInfo) { return value; }
/** This will be null if the startValue and endValue are the same. */ @Nullable Path getPath() { return path; } }
/** * Data class to help drawing trim paths individually. */ private static final class PathGroup { private final List<PathContent> paths = new ArrayList<>(); @Nullable private final TrimPathContent trimPath; private PathGroup(@Nullable TrimPathContent trimPath) { this.trimPath = trimPath; } } }
/** * The overridden method should handle appropriate properties and set value callbacks on their * animations. */ <T> void addValueCallback(T property, @Nullable LottieValueCallback<T> callback); }
@Nullable static AnimatableTransform findTransform(List<ContentModel> contentModels) { for (int i = 0; i < contentModels.size(); i++) { ContentModel contentModel = contentModels.get(i); if (contentModel instanceof AnimatableTransform) { return (AnimatableTransform) contentModel; } } return null; }
public FontAssetManager(Drawable.Callback callback, @Nullable FontAssetDelegate delegate) { this.delegate = delegate; if (!(callback instanceof View)) { Log.w(L.TAG, "LottieDrawable must be inside of a view for images to work."); assetManager = null; return; } assetManager = ((View) callback).getContext().getAssets(); }
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_font, container, false); ButterKnife.bind(this, view); textDelegate = new TextDelegate(nameAnimationView); nameAnimationView.setTextDelegate(textDelegate); return view; }
@Nullable static TypefaceStyles fromValue(int value) { for (TypefaceStyles style : values()) { if (style.value == value) { return style; } } return null; } }
@Override public <T> void addValueCallback(T property, @Nullable LottieValueCallback<T> callback) { if (transformAnimation != null) { transformAnimation.applyValueCallback(property, callback); } } }
public static LottieTask<LottieComposition> fromZipStream(final ZipInputStream inputStream, @Nullable final String cacheKey) { return cache(cacheKey, new Callable<LottieResult<LottieComposition>>() { @Override public LottieResult<LottieComposition> call() { return fromZipStreamSync(inputStream, cacheKey); } }); }
@RestrictTo(RestrictTo.Scope.LIBRARY) @Nullable public List<Layer> getPrecomps(String id) { return precomps.get(id); }
/** * @see #fromJsonSync(JSONObject, String) */ @Deprecated public static LottieTask<LottieComposition> fromJson(final JSONObject json, @Nullable final String cacheKey) { return cache(cacheKey, new Callable<LottieResult<LottieComposition>>() { @Override public LottieResult<LottieComposition> call() { //noinspection deprecation return fromJsonSync(json, cacheKey); } }); }
@Nullable public PerformanceTracker getPerformanceTracker() { if (composition != null) { return composition.getPerformanceTracker(); } return null; }
private void setResult(@Nullable LottieResult<T> result) { if (this.result != null) { throw new IllegalStateException("A task may only be set once."); } this.result = result; notifyListeners(); }
/** * Will return null if the animation can't be played such as if it has expressions. */ @Nullable private static <T> List<Keyframe<T>> parse(JsonReader reader, float scale, LottieComposition composition, ValueParser<T> valueParser) throws IOException { return KeyframesParser.parse(reader, composition, scale, valueParser); } }