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