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