1 package com.airbnb.lottie; 2 3 import android.graphics.Bitmap; 4 import android.graphics.ColorFilter; 5 import android.graphics.Path; 6 import android.graphics.PointF; 7 import android.graphics.Typeface; 8 9 import com.airbnb.lottie.value.LottieValueCallback; 10 import com.airbnb.lottie.value.ScaleXY; 11 12 /** 13 * Property values are the same type as the generic type of their corresponding 14 * {@link LottieValueCallback}. With this, we can use generics to maintain type safety 15 * of the callbacks. 16 * <p> 17 * Supported properties: 18 * Transform: 19 * {@link #TRANSFORM_ANCHOR_POINT} 20 * {@link #TRANSFORM_POSITION} 21 * {@link #TRANSFORM_OPACITY} 22 * {@link #TRANSFORM_SCALE} 23 * {@link #TRANSFORM_ROTATION} 24 * {@link #TRANSFORM_SKEW} 25 * {@link #TRANSFORM_SKEW_ANGLE} 26 * <p> 27 * Fill: 28 * {@link #COLOR} (non-gradient) 29 * {@link #OPACITY} 30 * {@link #COLOR_FILTER} 31 * <p> 32 * Stroke: 33 * {@link #COLOR} (non-gradient) 34 * {@link #STROKE_WIDTH} 35 * {@link #OPACITY} 36 * {@link #COLOR_FILTER} 37 * <p> 38 * Ellipse: 39 * {@link #POSITION} 40 * {@link #ELLIPSE_SIZE} 41 * <p> 42 * Polystar: 43 * {@link #POLYSTAR_POINTS} 44 * {@link #POLYSTAR_ROTATION} 45 * {@link #POSITION} 46 * {@link #POLYSTAR_INNER_RADIUS} (star) 47 * {@link #POLYSTAR_OUTER_RADIUS} 48 * {@link #POLYSTAR_INNER_ROUNDEDNESS} (star) 49 * {@link #POLYSTAR_OUTER_ROUNDEDNESS} 50 * <p> 51 * Repeater: 52 * All transform properties 53 * {@link #REPEATER_COPIES} 54 * {@link #REPEATER_OFFSET} 55 * {@link #TRANSFORM_ROTATION} 56 * {@link #TRANSFORM_START_OPACITY} 57 * {@link #TRANSFORM_END_OPACITY} 58 * <p> 59 * Layers: 60 * All transform properties 61 * {@link #TIME_REMAP} (composition layers only) 62 */ 63 public interface LottieProperty { 64 /** 65 * ColorInt 66 **/ 67 Integer COLOR = 1; 68 Integer STROKE_COLOR = 2; 69 /** 70 * Opacity value are 0-100 to match after effects 71 **/ 72 Integer TRANSFORM_OPACITY = 3; 73 /** 74 * [0,100] 75 */ 76 Integer OPACITY = 4; 77 Integer DROP_SHADOW_COLOR = 5; 78 /** 79 * In Px 80 */ 81 PointF TRANSFORM_ANCHOR_POINT = new PointF(); 82 /** 83 * In Px 84 */ 85 PointF TRANSFORM_POSITION = new PointF(); 86 /** 87 * When split dimensions is enabled. In Px 88 */ 89 Float TRANSFORM_POSITION_X = 15f; 90 /** 91 * When split dimensions is enabled. In Px 92 */ 93 Float TRANSFORM_POSITION_Y = 16f; 94 /** 95 * In Px 96 */ 97 Float BLUR_RADIUS = 17f; 98 /** 99 * In Px 100 */ 101 PointF ELLIPSE_SIZE = new PointF(); 102 /** 103 * In Px 104 */ 105 PointF RECTANGLE_SIZE = new PointF(); 106 /** 107 * In degrees 108 */ 109 Float CORNER_RADIUS = 0f; 110 /** 111 * In Px 112 */ 113 PointF POSITION = new PointF(); 114 ScaleXY TRANSFORM_SCALE = new ScaleXY(); 115 /** 116 * In degrees 117 */ 118 Float TRANSFORM_ROTATION = 1f; 119 /** 120 * 0-85 121 */ 122 Float TRANSFORM_SKEW = 0f; 123 /** 124 * In degrees 125 */ 126 Float TRANSFORM_SKEW_ANGLE = 0f; 127 /** 128 * In Px 129 */ 130 Float STROKE_WIDTH = 2f; 131 Float TEXT_TRACKING = 3f; 132 Float REPEATER_COPIES = 4f; 133 Float REPEATER_OFFSET = 5f; 134 Float POLYSTAR_POINTS = 6f; 135 /** 136 * In degrees 137 */ 138 Float POLYSTAR_ROTATION = 7f; 139 /** 140 * In Px 141 */ 142 Float POLYSTAR_INNER_RADIUS = 8f; 143 /** 144 * In Px 145 */ 146 Float POLYSTAR_OUTER_RADIUS = 9f; 147 /** 148 * [0,100] 149 */ 150 Float POLYSTAR_INNER_ROUNDEDNESS = 10f; 151 /** 152 * [0,100] 153 */ 154 Float POLYSTAR_OUTER_ROUNDEDNESS = 11f; 155 /** 156 * [0,100] 157 */ 158 Float TRANSFORM_START_OPACITY = 12f; 159 /** 160 * [0,100] 161 */ 162 Float TRANSFORM_END_OPACITY = 12.1f; 163 /** 164 * The time value in seconds 165 */ 166 Float TIME_REMAP = 13f; 167 /** 168 * In Dp 169 */ 170 Float TEXT_SIZE = 14f; 171 /** 172 * [0,100] 173 * Lottie Android resolved drop shadows on drawing content such as fills and strokes. 174 * If a drop shadow is applied to a layer, the dynamic properties must be set on all 175 * of its child elements that draw. The easiest way to do this is to append "**" to your 176 * Keypath after the layer name. 177 */ 178 Float DROP_SHADOW_OPACITY = 15f; 179 /** 180 * Degrees from 12 o'clock. 181 * Lottie Android resolved drop shadows on drawing content such as fills and strokes. 182 * If a drop shadow is applied to a layer, the dynamic properties must be set on all 183 * of its child elements that draw. The easiest way to do this is to append "**" to your 184 * Keypath after the layer name. 185 */ 186 Float DROP_SHADOW_DIRECTION = 16f; 187 /** 188 * In Px 189 * Lottie Android resolved drop shadows on drawing content such as fills and strokes. 190 * If a drop shadow is applied to a layer, the dynamic properties must be set on all 191 * of its child elements that draw. The easiest way to do this is to append "**" to your 192 * Keypath after the layer name. 193 */ 194 Float DROP_SHADOW_DISTANCE = 17f; 195 /** 196 * In Px 197 * Lottie Android resolved drop shadows on drawing content such as fills and strokes. 198 * If a drop shadow is applied to a layer, the dynamic properties must be set on all 199 * of its child elements that draw. The easiest way to do this is to append "**" to your 200 * Keypath after the layer name. 201 */ 202 Float DROP_SHADOW_RADIUS = 18f; 203 /** 204 * Set the color filter for an entire drawable content. Can be applied to fills, strokes, images, and solids. 205 */ 206 ColorFilter COLOR_FILTER = new ColorFilter(); 207 /** 208 * Array of ARGB colors that map to position stops in the original gradient. 209 * For example, a gradient from red to blue could be remapped with [0xFF00FF00, 0xFFFF00FF] (green to purple). 210 */ 211 Integer[] GRADIENT_COLOR = new Integer[0]; 212 /** 213 * Set on text layers. 214 */ 215 Typeface TYPEFACE = Typeface.DEFAULT; 216 /** 217 * Set on image layers. 218 */ 219 Bitmap IMAGE = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8); 220 /** 221 * Replace the text for a text layer. 222 */ 223 CharSequence TEXT = "dynamic_text"; 224 225 /** 226 * Replace a path. This can only be used on path contents. For other shapes such as rectangles and polystars, 227 * use LottieProperties corresponding to their specific properties. 228 * <p> 229 * If you need to do any operations on the path such as morphing, use the Jetpack androidx.graphics.path library. 230 * <p> 231 * In After Effects, any of those other shapes can be converted to a bezier path by right clicking it and 232 * selecting "Convert To Bezier Path". 233 */ 234 Path PATH = new Path(); 235 } 236