Package com.airbnb.lottie.model.layer
Class BaseLayer
- java.lang.Object
-
- com.airbnb.lottie.model.layer.BaseLayer
-
- All Implemented Interfaces:
Content,DrawingContent,BaseKeyframeAnimation.AnimationListener,KeyPathElement
- Direct Known Subclasses:
CompositionLayer,ImageLayer,NullLayer,ShapeLayer,SolidLayer,TextLayer
public abstract class BaseLayer extends java.lang.Object implements DrawingContent, BaseKeyframeAnimation.AnimationListener, KeyPathElement
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnimation(BaseKeyframeAnimation<?,?> newAnimation)<T> voidaddValueCallback(T property, LottieValueCallback<T> callback)The overridden method should handle appropriate properties and set value callbacks on their animations.voiddraw(Canvas canvas, Matrix parentMatrix, int parentAlpha)voidgetBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents)java.lang.StringgetName()voidonValueChanged()voidremoveAnimation(BaseKeyframeAnimation<?,?> animation)voidresolveKeyPath(KeyPath keyPath, int depth, java.util.List<KeyPath> accumulator, KeyPath currentPartialKeyPath)Called recursively during keypath resolution.voidsetContents(java.util.List<Content> contentsBefore, java.util.List<Content> contentsAfter)
-
-
-
Method Detail
-
onValueChanged
public void onValueChanged()
- Specified by:
onValueChangedin interfaceBaseKeyframeAnimation.AnimationListener
-
addAnimation
public void addAnimation(@Nullable BaseKeyframeAnimation<?,?> newAnimation)
-
removeAnimation
public void removeAnimation(BaseKeyframeAnimation<?,?> animation)
-
getBounds
@CallSuper public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents)
- Specified by:
getBoundsin interfaceDrawingContent
-
draw
public void draw(Canvas canvas, Matrix parentMatrix, int parentAlpha)
- Specified by:
drawin interfaceDrawingContent
-
setContents
public void setContents(java.util.List<Content> contentsBefore, java.util.List<Content> contentsAfter)
- Specified by:
setContentsin interfaceContent
-
resolveKeyPath
public void resolveKeyPath(KeyPath keyPath, int depth, java.util.List<KeyPath> accumulator, KeyPath currentPartialKeyPath)
Description copied from interface:KeyPathElementCalled recursively during keypath resolution. The overridden method should just call: MiscUtils.resolveKeyPath(keyPath, depth, accumulator, currentPartialKeyPath, this);- Specified by:
resolveKeyPathin interfaceKeyPathElement- Parameters:
keyPath- The full keypath being resolved.depth- The current depth that this element should be checked at in the keypath.accumulator- A list of fully resolved keypaths. If this element fully matches the keypath then it should add itself to this list.currentPartialKeyPath- A keypath that contains all parent element of this one. This element should create a copy of this and append itself with KeyPath#addKey when it adds itself to the accumulator or propagates resolution to its children.
-
addValueCallback
@CallSuper public <T> void addValueCallback(T property, @Nullable LottieValueCallback<T> callback)Description copied from interface:KeyPathElementThe overridden method should handle appropriate properties and set value callbacks on their animations.- Specified by:
addValueCallbackin interfaceKeyPathElement
-
-