354 lines
14 KiB
Java
354 lines
14 KiB
Java
package c.c.a.a0;
|
|
|
|
import android.graphics.Rect;
|
|
import androidx.collection.LongSparseArray;
|
|
import androidx.collection.SparseArrayCompat;
|
|
import c.c.a.a0.h0.c;
|
|
import c.c.a.b0.g;
|
|
import c.c.a.d;
|
|
import c.c.a.k;
|
|
import c.c.a.y.e;
|
|
import c.c.a.y.i;
|
|
import c.c.a.y.l.m;
|
|
import c.c.a.y.m.e;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
/* compiled from: LottieCompositionMoshiParser */
|
|
public class s {
|
|
public static final c.a a = c.a.a("w", "h", "ip", "op", "fr", "v", "layers", "assets", "fonts", "chars", "markers");
|
|
public static c.a b = c.a.a("id", "layers", "w", "h", "p", "u");
|
|
|
|
/* renamed from: c reason: collision with root package name */
|
|
public static final c.a f256c = c.a.a("list");
|
|
public static final c.a d = c.a.a("cm", "tm", "dr");
|
|
|
|
public static d a(c cVar) throws IOException {
|
|
ArrayList arrayList;
|
|
SparseArrayCompat<e> sparseArrayCompat;
|
|
ArrayList arrayList2;
|
|
float f;
|
|
float f2;
|
|
float f3;
|
|
float c2 = g.c();
|
|
LongSparseArray<c.c.a.y.m.e> longSparseArray = new LongSparseArray<>();
|
|
ArrayList arrayList3 = new ArrayList();
|
|
HashMap hashMap = new HashMap();
|
|
HashMap hashMap2 = new HashMap();
|
|
HashMap hashMap3 = new HashMap();
|
|
ArrayList arrayList4 = new ArrayList();
|
|
SparseArrayCompat<e> sparseArrayCompat2 = new SparseArrayCompat<>();
|
|
d dVar = new d();
|
|
cVar.b();
|
|
float f4 = 0.0f;
|
|
int i = 0;
|
|
int i2 = 0;
|
|
float f5 = 0.0f;
|
|
float f6 = 0.0f;
|
|
while (cVar.e()) {
|
|
switch (cVar.z(a)) {
|
|
case 0:
|
|
i = cVar.r();
|
|
break;
|
|
case 1:
|
|
i2 = cVar.r();
|
|
break;
|
|
case 2:
|
|
arrayList = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f5 = (float) cVar.p();
|
|
f4 = f4;
|
|
arrayList4 = arrayList;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 3:
|
|
arrayList = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f6 = ((float) cVar.p()) - 0.01f;
|
|
f4 = f4;
|
|
arrayList4 = arrayList;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 4:
|
|
arrayList = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f4 = (float) cVar.p();
|
|
arrayList4 = arrayList;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 5:
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f = f5;
|
|
f2 = f6;
|
|
String[] split = cVar.t().split("\\.");
|
|
int parseInt = Integer.parseInt(split[0]);
|
|
boolean z2 = true;
|
|
int parseInt2 = Integer.parseInt(split[1]);
|
|
int parseInt3 = Integer.parseInt(split[2]);
|
|
if (parseInt < 4 || (parseInt <= 4 && (parseInt2 < 4 || (parseInt2 <= 4 && parseInt3 < 0)))) {
|
|
z2 = false;
|
|
}
|
|
if (!z2) {
|
|
dVar.a("Lottie only supports bodymovin >= 4.4.0");
|
|
}
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 6:
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.a();
|
|
int i3 = 0;
|
|
while (cVar.e()) {
|
|
c.c.a.y.m.e a2 = r.a(cVar, dVar);
|
|
if (a2.e == e.a.IMAGE) {
|
|
i3++;
|
|
}
|
|
arrayList3.add(a2);
|
|
longSparseArray.put(a2.d, a2);
|
|
if (i3 > 4) {
|
|
c.c.a.b0.c.b("You have " + i3 + " images. Lottie should primarily be used with shapes. If you are using Adobe Illustrator, convert the Illustrator layers to shape layers.");
|
|
}
|
|
}
|
|
cVar.c();
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 7:
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
ArrayList arrayList5 = new ArrayList();
|
|
LongSparseArray longSparseArray2 = new LongSparseArray();
|
|
cVar.b();
|
|
String str = null;
|
|
String str2 = null;
|
|
String str3 = null;
|
|
int i4 = 0;
|
|
int i5 = 0;
|
|
while (cVar.e()) {
|
|
int z3 = cVar.z(b);
|
|
if (z3 == 0) {
|
|
str = cVar.t();
|
|
} else if (z3 == 1) {
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
c.c.a.y.m.e a3 = r.a(cVar, dVar);
|
|
longSparseArray2.put(a3.d, a3);
|
|
arrayList5.add(a3);
|
|
}
|
|
cVar.c();
|
|
} else if (z3 == 2) {
|
|
i4 = cVar.r();
|
|
} else if (z3 == 3) {
|
|
i5 = cVar.r();
|
|
} else if (z3 == 4) {
|
|
str2 = cVar.t();
|
|
} else if (z3 != 5) {
|
|
cVar.B();
|
|
cVar.C();
|
|
} else {
|
|
str3 = cVar.t();
|
|
}
|
|
}
|
|
cVar.d();
|
|
if (str2 != null) {
|
|
hashMap2.put(str, new k(i4, i5, str, str2, str3));
|
|
} else {
|
|
hashMap.put(str, arrayList5);
|
|
}
|
|
}
|
|
cVar.c();
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 8:
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.b();
|
|
while (cVar.e()) {
|
|
if (cVar.z(f256c) != 0) {
|
|
cVar.B();
|
|
cVar.C();
|
|
} else {
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
c.a aVar = j.a;
|
|
cVar.b();
|
|
String str4 = null;
|
|
String str5 = null;
|
|
String str6 = null;
|
|
float f7 = 0.0f;
|
|
while (cVar.e()) {
|
|
int z4 = cVar.z(j.a);
|
|
if (z4 != 0) {
|
|
if (z4 == 1) {
|
|
str5 = cVar.t();
|
|
} else if (z4 == 2) {
|
|
str6 = cVar.t();
|
|
} else if (z4 != 3) {
|
|
cVar.B();
|
|
cVar.C();
|
|
} else {
|
|
f7 = (float) cVar.p();
|
|
}
|
|
arrayList4 = arrayList4;
|
|
sparseArrayCompat2 = sparseArrayCompat2;
|
|
} else {
|
|
str4 = cVar.t();
|
|
arrayList4 = arrayList4;
|
|
}
|
|
}
|
|
cVar.d();
|
|
hashMap3.put(str5, new c.c.a.y.d(str4, str5, str6, f7));
|
|
arrayList4 = arrayList4;
|
|
}
|
|
cVar.c();
|
|
}
|
|
}
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
cVar.d();
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 9:
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
c.a aVar2 = i.a;
|
|
ArrayList arrayList6 = new ArrayList();
|
|
cVar.b();
|
|
double d2 = 0.0d;
|
|
double d3 = 0.0d;
|
|
String str7 = null;
|
|
String str8 = null;
|
|
char c3 = 0;
|
|
while (cVar.e()) {
|
|
int z5 = cVar.z(i.a);
|
|
if (z5 == 0) {
|
|
c3 = cVar.t().charAt(0);
|
|
} else if (z5 == 1) {
|
|
d2 = cVar.p();
|
|
} else if (z5 == 2) {
|
|
d3 = cVar.p();
|
|
} else if (z5 == 3) {
|
|
str7 = cVar.t();
|
|
} else if (z5 == 4) {
|
|
str8 = cVar.t();
|
|
} else if (z5 != 5) {
|
|
cVar.B();
|
|
cVar.C();
|
|
} else {
|
|
cVar.b();
|
|
while (cVar.e()) {
|
|
if (cVar.z(i.b) != 0) {
|
|
cVar.B();
|
|
cVar.C();
|
|
} else {
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
arrayList6.add((m) f.a(cVar, dVar));
|
|
}
|
|
cVar.c();
|
|
}
|
|
}
|
|
cVar.d();
|
|
}
|
|
}
|
|
cVar.d();
|
|
c.c.a.y.e eVar = new c.c.a.y.e(arrayList6, c3, d2, d3, str7, str8);
|
|
sparseArrayCompat2.put(eVar.hashCode(), eVar);
|
|
}
|
|
cVar.c();
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
case 10:
|
|
cVar.a();
|
|
while (cVar.e()) {
|
|
cVar.b();
|
|
String str9 = null;
|
|
float f8 = 0.0f;
|
|
float f9 = 0.0f;
|
|
while (cVar.e()) {
|
|
int z6 = cVar.z(d);
|
|
if (z6 != 0) {
|
|
if (z6 == 1) {
|
|
f3 = f5;
|
|
f8 = (float) cVar.p();
|
|
} else if (z6 != 2) {
|
|
cVar.B();
|
|
cVar.C();
|
|
f6 = f6;
|
|
} else {
|
|
f3 = f5;
|
|
f9 = (float) cVar.p();
|
|
}
|
|
f6 = f6;
|
|
f5 = f3;
|
|
} else {
|
|
str9 = cVar.t();
|
|
}
|
|
}
|
|
cVar.d();
|
|
arrayList4.add(new i(str9, f8, f9));
|
|
f5 = f5;
|
|
f6 = f6;
|
|
}
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.c();
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
default:
|
|
arrayList2 = arrayList4;
|
|
sparseArrayCompat = sparseArrayCompat2;
|
|
f = f5;
|
|
f2 = f6;
|
|
cVar.B();
|
|
cVar.C();
|
|
f4 = f4;
|
|
f5 = f;
|
|
arrayList4 = arrayList2;
|
|
f6 = f2;
|
|
sparseArrayCompat2 = sparseArrayCompat;
|
|
}
|
|
f4 = f4;
|
|
}
|
|
dVar.j = new Rect(0, 0, (int) (((float) i) * c2), (int) (((float) i2) * c2));
|
|
dVar.k = f5;
|
|
dVar.l = f6;
|
|
dVar.m = f4;
|
|
dVar.i = arrayList3;
|
|
dVar.h = longSparseArray;
|
|
dVar.f260c = hashMap;
|
|
dVar.d = hashMap2;
|
|
dVar.g = sparseArrayCompat2;
|
|
dVar.e = hashMap3;
|
|
dVar.f = arrayList4;
|
|
return dVar;
|
|
}
|
|
}
|