1 package com.airbnb.lottie.model.animatable; 2 3 import android.graphics.PointF; 4 5 import androidx.annotation.Nullable; 6 7 import com.airbnb.lottie.LottieDrawable; 8 import com.airbnb.lottie.animation.content.Content; 9 import com.airbnb.lottie.animation.content.ModifierContent; 10 import com.airbnb.lottie.animation.keyframe.TransformKeyframeAnimation; 11 import com.airbnb.lottie.model.content.ContentModel; 12 import com.airbnb.lottie.model.layer.BaseLayer; 13 14 public class AnimatableTransform implements ModifierContent, ContentModel { 15 @Nullable 16 private final AnimatablePathValue anchorPoint; 17 @Nullable 18 private final AnimatableValue<PointF, PointF> position; 19 @Nullable 20 private final AnimatableScaleValue scale; 21 @Nullable 22 private final AnimatableFloatValue rotation; 23 @Nullable 24 private final AnimatableIntegerValue opacity; 25 @Nullable 26 private final AnimatableFloatValue skew; 27 @Nullable 28 private final AnimatableFloatValue skewAngle; 29 30 // Used for repeaters 31 @Nullable 32 private final AnimatableFloatValue startOpacity; 33 @Nullable 34 private final AnimatableFloatValue endOpacity; 35 AnimatableTransform()36 public AnimatableTransform() { 37 this(null, null, null, null, null, null, null, null, null); 38 } 39 AnimatableTransform(@ullable AnimatablePathValue anchorPoint, @Nullable AnimatableValue<PointF, PointF> position, @Nullable AnimatableScaleValue scale, @Nullable AnimatableFloatValue rotation, @Nullable AnimatableIntegerValue opacity, @Nullable AnimatableFloatValue startOpacity, @Nullable AnimatableFloatValue endOpacity, @Nullable AnimatableFloatValue skew, @Nullable AnimatableFloatValue skewAngle)40 public AnimatableTransform(@Nullable AnimatablePathValue anchorPoint, 41 @Nullable AnimatableValue<PointF, PointF> position, @Nullable AnimatableScaleValue scale, 42 @Nullable AnimatableFloatValue rotation, @Nullable AnimatableIntegerValue opacity, 43 @Nullable AnimatableFloatValue startOpacity, @Nullable AnimatableFloatValue endOpacity, 44 @Nullable AnimatableFloatValue skew, @Nullable AnimatableFloatValue skewAngle) { 45 this.anchorPoint = anchorPoint; 46 this.position = position; 47 this.scale = scale; 48 this.rotation = rotation; 49 this.opacity = opacity; 50 this.startOpacity = startOpacity; 51 this.endOpacity = endOpacity; 52 this.skew = skew; 53 this.skewAngle = skewAngle; 54 } 55 56 @Nullable getAnchorPoint()57 public AnimatablePathValue getAnchorPoint() { 58 return anchorPoint; 59 } 60 61 @Nullable getPosition()62 public AnimatableValue<PointF, PointF> getPosition() { 63 return position; 64 } 65 66 @Nullable getScale()67 public AnimatableScaleValue getScale() { 68 return scale; 69 } 70 71 @Nullable getRotation()72 public AnimatableFloatValue getRotation() { 73 return rotation; 74 } 75 76 @Nullable getOpacity()77 public AnimatableIntegerValue getOpacity() { 78 return opacity; 79 } 80 81 @Nullable getStartOpacity()82 public AnimatableFloatValue getStartOpacity() { 83 return startOpacity; 84 } 85 86 @Nullable getEndOpacity()87 public AnimatableFloatValue getEndOpacity() { 88 return endOpacity; 89 } 90 91 @Nullable getSkew()92 public AnimatableFloatValue getSkew() { 93 return skew; 94 } 95 96 @Nullable getSkewAngle()97 public AnimatableFloatValue getSkewAngle() { 98 return skewAngle; 99 } 100 createAnimation()101 public TransformKeyframeAnimation createAnimation() { 102 return new TransformKeyframeAnimation(this); 103 } 104 105 @Nullable 106 @Override toContent(LottieDrawable drawable, BaseLayer layer)107 public Content toContent(LottieDrawable drawable, BaseLayer layer) { 108 return null; 109 } 110 } 111