discord-jadx/app/src/main/java/c/c/a/w/b/d.java

258 lines
7.2 KiB
Java

package c.c.a.w.b;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import androidx.annotation.Nullable;
import c.c.a.c0.c;
import c.c.a.j;
import c.c.a.w.c.a;
import c.c.a.w.c.o;
import c.c.a.y.f;
import c.c.a.y.g;
import c.c.a.y.k.l;
import c.c.a.y.l.m;
import c.c.a.y.m.b;
import java.util.ArrayList;
import java.util.List;
/* compiled from: ContentGroup */
public class d implements e, m, a.b, g {
public Paint a;
public RectF b;
/* renamed from: c reason: collision with root package name */
public final Matrix f276c;
public final Path d;
public final RectF e;
public final String f;
public final boolean g;
public final List<c> h;
public final j i;
@Nullable
public List<m> j;
@Nullable
public o k;
/* JADX WARNING: Illegal instructions before constructor call */
public d(j jVar, b bVar, m mVar) {
this(jVar, bVar, r3, r4, r5, r6);
l lVar;
String str = mVar.a;
boolean z2 = mVar.f319c;
List<c.c.a.y.l.b> list = mVar.b;
ArrayList arrayList = new ArrayList(list.size());
int i = 0;
for (int i2 = 0; i2 < list.size(); i2++) {
c a = list.get(i2).a(jVar, bVar);
if (a != null) {
arrayList.add(a);
}
}
List<c.c.a.y.l.b> list2 = mVar.b;
while (true) {
if (i >= list2.size()) {
lVar = null;
break;
}
c.c.a.y.l.b bVar2 = list2.get(i);
if (bVar2 instanceof l) {
lVar = (l) bVar2;
break;
}
i++;
}
}
public d(j jVar, b bVar, String str, boolean z2, List<c> list, @Nullable l lVar) {
this.a = new c.c.a.w.a();
this.b = new RectF();
this.f276c = new Matrix();
this.d = new Path();
this.e = new RectF();
this.f = str;
this.i = jVar;
this.g = z2;
this.h = list;
if (lVar != null) {
o oVar = new o(lVar);
this.k = oVar;
oVar.a(bVar);
this.k.b(this);
}
ArrayList arrayList = new ArrayList();
int size = list.size();
while (true) {
size--;
if (size < 0) {
break;
}
c cVar = list.get(size);
if (cVar instanceof j) {
arrayList.add((j) cVar);
}
}
int size2 = arrayList.size();
while (true) {
size2--;
if (size2 >= 0) {
((j) arrayList.get(size2)).e(list.listIterator(list.size()));
} else {
return;
}
}
}
@Override // c.c.a.w.c.a.b
public void a() {
this.i.invalidateSelf();
}
@Override // c.c.a.w.b.c
public void b(List<c> list, List<c> list2) {
ArrayList arrayList = new ArrayList(this.h.size() + list.size());
arrayList.addAll(list);
for (int size = this.h.size() - 1; size >= 0; size--) {
c cVar = this.h.get(size);
cVar.b(arrayList, this.h.subList(0, size));
arrayList.add(cVar);
}
}
@Override // c.c.a.y.g
public void c(f fVar, int i, List<f> list, f fVar2) {
if (fVar.e(this.f, i)) {
if (!"__container".equals(this.f)) {
fVar2 = fVar2.a(this.f);
if (fVar.c(this.f, i)) {
list.add(fVar2.g(this));
}
}
if (fVar.f(this.f, i)) {
int d = fVar.d(this.f, i) + i;
for (int i2 = 0; i2 < this.h.size(); i2++) {
c cVar = this.h.get(i2);
if (cVar instanceof g) {
((g) cVar).c(fVar, d, list, fVar2);
}
}
}
}
}
@Override // c.c.a.w.b.e
public void d(RectF rectF, Matrix matrix, boolean z2) {
this.f276c.set(matrix);
o oVar = this.k;
if (oVar != null) {
this.f276c.preConcat(oVar.e());
}
this.e.set(0.0f, 0.0f, 0.0f, 0.0f);
for (int size = this.h.size() - 1; size >= 0; size--) {
c cVar = this.h.get(size);
if (cVar instanceof e) {
((e) cVar).d(this.e, this.f276c, z2);
rectF.union(this.e);
}
}
}
public List<m> e() {
if (this.j == null) {
this.j = new ArrayList();
for (int i = 0; i < this.h.size(); i++) {
c cVar = this.h.get(i);
if (cVar instanceof m) {
this.j.add((m) cVar);
}
}
}
return this.j;
}
@Override // c.c.a.w.b.e
public void f(Canvas canvas, Matrix matrix, int i) {
boolean z2;
if (!this.g) {
this.f276c.set(matrix);
o oVar = this.k;
if (oVar != null) {
this.f276c.preConcat(oVar.e());
a<Integer, Integer> aVar = this.k.j;
i = (int) ((((((float) (aVar == null ? 100 : aVar.e().intValue())) / 100.0f) * ((float) i)) / 255.0f) * 255.0f);
}
boolean z3 = false;
if (this.i.f264z) {
int i2 = 0;
int i3 = 0;
while (true) {
if (i2 >= this.h.size()) {
z2 = false;
break;
}
if ((this.h.get(i2) instanceof e) && (i3 = i3 + 1) >= 2) {
z2 = true;
break;
}
i2++;
}
if (z2 && i != 255) {
z3 = true;
}
}
if (z3) {
this.b.set(0.0f, 0.0f, 0.0f, 0.0f);
d(this.b, this.f276c, true);
this.a.setAlpha(i);
c.c.a.b0.g.f(canvas, this.b, this.a, 31);
}
if (z3) {
i = 255;
}
for (int size = this.h.size() - 1; size >= 0; size--) {
c cVar = this.h.get(size);
if (cVar instanceof e) {
((e) cVar).f(canvas, this.f276c, i);
}
}
if (z3) {
canvas.restore();
}
}
}
@Override // c.c.a.y.g
public <T> void g(T t, @Nullable c<T> cVar) {
o oVar = this.k;
if (oVar != null) {
oVar.c(t, cVar);
}
}
@Override // c.c.a.w.b.c
public String getName() {
return this.f;
}
@Override // c.c.a.w.b.m
public Path getPath() {
this.f276c.reset();
o oVar = this.k;
if (oVar != null) {
this.f276c.set(oVar.e());
}
this.d.reset();
if (this.g) {
return this.d;
}
for (int size = this.h.size() - 1; size >= 0; size--) {
c cVar = this.h.get(size);
if (cVar instanceof m) {
this.d.addPath(((m) cVar).getPath(), this.f276c);
}
}
return this.d;
}
}