/** * Used to determine if an animation can be drawn with hardware acceleration. */ @RestrictTo(RestrictTo.Scope.LIBRARY) public int getMaskAndMatteCount() { return maskAndMatteCount; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public LottieImageAsset(int width, int height, String id, String fileName, String dirName) { this.width = width; this.height = height; this.id = id; this.fileName = fileName; this.dirName = dirName; }
/** * Used to determine if an animation can be drawn with hardware acceleration. */ @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean hasDashPattern() { return hasDashPattern; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public void incrementMatteOrMaskCount(int amount) { maskAndMatteCount += amount; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public float getStartFrame() { return startFrame; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public LottieTask(Callable<LottieResult<T>> runnable) { this(runnable, false); }
@RestrictTo(RestrictTo.Scope.LIBRARY) public float getEndFrame() { return endFrame; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public void setHasDashPattern(boolean hasDashPattern) { this.hasDashPattern = hasDashPattern; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public void init(Rect bounds, float startFrame, float endFrame, float frameRate, List<Layer> layers, LongSparseArray<Layer> layerMap, Map<String, List<Layer>> precomps, Map<String, LottieImageAsset> images, SparseArrayCompat<FontCharacter> characters, Map<String, Font> fonts) { this.bounds = bounds; this.startFrame = startFrame; this.endFrame = endFrame; this.frameRate = frameRate; this.layers = layers; this.layerMap = layerMap; this.precomps = precomps; this.images = images; this.characters = characters; this.fonts = fonts; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public LottieFrameInfo<T> set( float startFrame, float endFrame, T startValue, T endValue, float linearKeyframeProgress, float interpolatedKeyframeProgress, float overallProgress ) { this.startFrame = startFrame; this.endFrame = endFrame; this.startValue = startValue; this.endValue = endValue; this.linearKeyframeProgress = linearKeyframeProgress; this.interpolatedKeyframeProgress = interpolatedKeyframeProgress; this.overallProgress = overallProgress; return this; }
/** * Returns a {@link KeyPathElement} that this has been resolved to. KeyPaths get resolved with * resolveKeyPath on LottieDrawable or LottieAnimationView. */ @RestrictTo(RestrictTo.Scope.LIBRARY) @Nullable public KeyPathElement getResolvedElement() { return resolvedElement; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public final void setAnimation(@Nullable BaseKeyframeAnimation<?, ?> animation) { this.animation = animation; } }
@RestrictTo(RestrictTo.Scope.LIBRARY) public void addWarning(String warning) { Log.w(L.TAG, warning); warnings.add(warning); }
@RestrictTo(RestrictTo.Scope.LIBRARY) @Nullable public List<Layer> getPrecomps(String id) { return precomps.get(id); }
@NonNull @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public PermissionHelper getHelper() { return mHelper; }
/** * Returns whether the keypath resolution should propagate to children. Some keypaths resolve * to content other than leaf contents (such as a layer or content group transform) so sometimes * this will return false. */ @SuppressWarnings("SimplifiableIfStatement") @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean propagateToChildren(String key, int depth) { if ("__container".equals(key)) { return true; } return depth < keys.size() - 1 || keys.get(depth).equals("**"); }
/** * Return a new KeyPath with the element resolved to the specified {@link KeyPathElement}. */ @RestrictTo(RestrictTo.Scope.LIBRARY) public KeyPath resolve(KeyPathElement element) { KeyPath keyPath = new KeyPath(this); keyPath.resolvedElement = element; return keyPath; }
@RestrictTo(RestrictTo.Scope.LIBRARY) public Layer layerModelForId(long id) { return layerMap.get(id); }
/** * Returns a new KeyPath with the key added. * This is used during keypath resolution. Children normally don't know about all of their parent * elements so this is used to keep track of the fully qualified keypath. * This returns a key keypath because during resolution, the full keypath element tree is walked * and if this modified the original copy, it would remain after popping back up the element tree. */ @CheckResult @RestrictTo(RestrictTo.Scope.LIBRARY) public KeyPath addKey(String key) { KeyPath newKeyPath = new KeyPath(this); newKeyPath.keys.add(key); return newKeyPath; }
/** * runNow is only used for testing. */ @RestrictTo(RestrictTo.Scope.LIBRARY) LottieTask(Callable<LottieResult<T>> runnable, boolean runNow) { task = new FutureTask<>(runnable); if (runNow) { try { setResult(runnable.call()); } catch (Throwable e) { setResult(new LottieResult<T>(e)); } } else { EXECUTOR.execute(task); startTaskObserverIfNeeded(); } }