161 lines
5.4 KiB
Java
161 lines
5.4 KiB
Java
|
package com.airbnb.lottie.model.content;
|
||
|
|
||
|
import android.graphics.Paint;
|
||
|
import com.airbnb.lottie.LottieDrawable;
|
||
|
import com.airbnb.lottie.animation.content.Content;
|
||
|
import com.airbnb.lottie.animation.content.StrokeContent;
|
||
|
import com.airbnb.lottie.model.animatable.AnimatableColorValue;
|
||
|
import com.airbnb.lottie.model.animatable.AnimatableFloatValue;
|
||
|
import com.airbnb.lottie.model.animatable.AnimatableIntegerValue;
|
||
|
import com.airbnb.lottie.model.layer.BaseLayer;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public class ShapeStroke implements ContentModel {
|
||
|
private final LineCapType capType;
|
||
|
private final AnimatableColorValue color;
|
||
|
private final boolean hidden;
|
||
|
private final LineJoinType joinType;
|
||
|
private final List<AnimatableFloatValue> lineDashPattern;
|
||
|
private final float miterLimit;
|
||
|
private final String name;
|
||
|
private final AnimatableFloatValue offset;
|
||
|
private final AnimatableIntegerValue opacity;
|
||
|
private final AnimatableFloatValue width;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public enum LineCapType {
|
||
|
BUTT,
|
||
|
ROUND,
|
||
|
UNKNOWN;
|
||
|
|
||
|
public final Paint.Cap toPaintCap() {
|
||
|
int i = AnonymousClass1.$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineCapType[ordinal()];
|
||
|
if (i == 1) {
|
||
|
return Paint.Cap.BUTT;
|
||
|
}
|
||
|
if (i == 2) {
|
||
|
return Paint.Cap.ROUND;
|
||
|
}
|
||
|
return Paint.Cap.SQUARE;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* renamed from: com.airbnb.lottie.model.content.ShapeStroke$1, reason: invalid class name */
|
||
|
/* loaded from: classes.dex */
|
||
|
static /* synthetic */ class AnonymousClass1 {
|
||
|
static final int[] $SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineCapType;
|
||
|
static final int[] $SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineJoinType;
|
||
|
|
||
|
static {
|
||
|
int[] iArr = new int[LineJoinType.values().length];
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineJoinType = iArr;
|
||
|
try {
|
||
|
iArr[LineJoinType.BEVEL.ordinal()] = 1;
|
||
|
} catch (NoSuchFieldError unused) {
|
||
|
}
|
||
|
try {
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineJoinType[LineJoinType.MITER.ordinal()] = 2;
|
||
|
} catch (NoSuchFieldError unused2) {
|
||
|
}
|
||
|
try {
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineJoinType[LineJoinType.ROUND.ordinal()] = 3;
|
||
|
} catch (NoSuchFieldError unused3) {
|
||
|
}
|
||
|
int[] iArr2 = new int[LineCapType.values().length];
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineCapType = iArr2;
|
||
|
try {
|
||
|
iArr2[LineCapType.BUTT.ordinal()] = 1;
|
||
|
} catch (NoSuchFieldError unused4) {
|
||
|
}
|
||
|
try {
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineCapType[LineCapType.ROUND.ordinal()] = 2;
|
||
|
} catch (NoSuchFieldError unused5) {
|
||
|
}
|
||
|
try {
|
||
|
$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineCapType[LineCapType.UNKNOWN.ordinal()] = 3;
|
||
|
} catch (NoSuchFieldError unused6) {
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public enum LineJoinType {
|
||
|
MITER,
|
||
|
ROUND,
|
||
|
BEVEL;
|
||
|
|
||
|
public final Paint.Join toPaintJoin() {
|
||
|
int i = AnonymousClass1.$SwitchMap$com$airbnb$lottie$model$content$ShapeStroke$LineJoinType[ordinal()];
|
||
|
if (i == 1) {
|
||
|
return Paint.Join.BEVEL;
|
||
|
}
|
||
|
if (i == 2) {
|
||
|
return Paint.Join.MITER;
|
||
|
}
|
||
|
if (i != 3) {
|
||
|
return null;
|
||
|
}
|
||
|
return Paint.Join.ROUND;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public ShapeStroke(String str, AnimatableFloatValue animatableFloatValue, List<AnimatableFloatValue> list, AnimatableColorValue animatableColorValue, AnimatableIntegerValue animatableIntegerValue, AnimatableFloatValue animatableFloatValue2, LineCapType lineCapType, LineJoinType lineJoinType, float f, boolean z) {
|
||
|
this.name = str;
|
||
|
this.offset = animatableFloatValue;
|
||
|
this.lineDashPattern = list;
|
||
|
this.color = animatableColorValue;
|
||
|
this.opacity = animatableIntegerValue;
|
||
|
this.width = animatableFloatValue2;
|
||
|
this.capType = lineCapType;
|
||
|
this.joinType = lineJoinType;
|
||
|
this.miterLimit = f;
|
||
|
this.hidden = z;
|
||
|
}
|
||
|
|
||
|
@Override // com.airbnb.lottie.model.content.ContentModel
|
||
|
public Content toContent(LottieDrawable lottieDrawable, BaseLayer baseLayer) {
|
||
|
return new StrokeContent(lottieDrawable, baseLayer, this);
|
||
|
}
|
||
|
|
||
|
public boolean isHidden() {
|
||
|
return this.hidden;
|
||
|
}
|
||
|
|
||
|
public AnimatableFloatValue getWidth() {
|
||
|
return this.width;
|
||
|
}
|
||
|
|
||
|
public AnimatableIntegerValue getOpacity() {
|
||
|
return this.opacity;
|
||
|
}
|
||
|
|
||
|
public String getName() {
|
||
|
return this.name;
|
||
|
}
|
||
|
|
||
|
public float getMiterLimit() {
|
||
|
return this.miterLimit;
|
||
|
}
|
||
|
|
||
|
public List<AnimatableFloatValue> getLineDashPattern() {
|
||
|
return this.lineDashPattern;
|
||
|
}
|
||
|
|
||
|
public LineJoinType getJoinType() {
|
||
|
return this.joinType;
|
||
|
}
|
||
|
|
||
|
public AnimatableFloatValue getDashOffset() {
|
||
|
return this.offset;
|
||
|
}
|
||
|
|
||
|
public AnimatableColorValue getColor() {
|
||
|
return this.color;
|
||
|
}
|
||
|
|
||
|
public LineCapType getCapType() {
|
||
|
return this.capType;
|
||
|
}
|
||
|
}
|