- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
104 lines
2.9 KiB
Java
104 lines
2.9 KiB
Java
package com.applovin.exoplayer2.ui;
|
|
|
|
import android.content.Context;
|
|
import android.graphics.Canvas;
|
|
import android.text.Layout;
|
|
import android.util.AttributeSet;
|
|
import android.view.View;
|
|
import com.applovin.exoplayer2.ui.SubtitleView;
|
|
import com.applovin.impl.b5;
|
|
import com.applovin.impl.x2;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class a extends View implements SubtitleView.a {
|
|
private final List a;
|
|
private List b;
|
|
private int c;
|
|
private float d;
|
|
private x2 f;
|
|
private float g;
|
|
|
|
public a(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
public a(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.a = new ArrayList();
|
|
this.b = Collections.emptyList();
|
|
this.c = 0;
|
|
this.d = 0.0533f;
|
|
this.f = x2.g;
|
|
this.g = 0.08f;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void dispatchDraw(Canvas canvas) {
|
|
List list = this.b;
|
|
if (list.isEmpty()) {
|
|
return;
|
|
}
|
|
int height = getHeight();
|
|
int paddingLeft = getPaddingLeft();
|
|
int paddingTop = getPaddingTop();
|
|
int width = getWidth() - getPaddingRight();
|
|
int paddingBottom = height - getPaddingBottom();
|
|
if (paddingBottom <= paddingTop || width <= paddingLeft) {
|
|
return;
|
|
}
|
|
int i = paddingBottom - paddingTop;
|
|
float a = h.a(this.c, this.d, height, i);
|
|
if (a <= 0.0f) {
|
|
return;
|
|
}
|
|
int size = list.size();
|
|
int i2 = 0;
|
|
while (i2 < size) {
|
|
b5 b5Var = (b5) list.get(i2);
|
|
if (b5Var.q != Integer.MIN_VALUE) {
|
|
b5Var = a(b5Var);
|
|
}
|
|
b5 b5Var2 = b5Var;
|
|
int i3 = paddingBottom;
|
|
((g) this.a.get(i2)).a(b5Var2, this.f, a, h.a(b5Var2.o, b5Var2.p, height, i), this.g, canvas, paddingLeft, paddingTop, width, i3);
|
|
i2++;
|
|
size = size;
|
|
i = i;
|
|
paddingBottom = i3;
|
|
width = width;
|
|
}
|
|
}
|
|
|
|
private static b5 a(b5 b5Var) {
|
|
b5.b b = b5Var.a().b(-3.4028235E38f).b(Integer.MIN_VALUE).b((Layout.Alignment) null);
|
|
if (b5Var.g == 0) {
|
|
b.a(1.0f - b5Var.f, 0);
|
|
} else {
|
|
b.a((-b5Var.f) - 1.0f, 1);
|
|
}
|
|
int i = b5Var.h;
|
|
if (i == 0) {
|
|
b.a(2);
|
|
} else if (i == 2) {
|
|
b.a(0);
|
|
}
|
|
return b.a();
|
|
}
|
|
|
|
@Override // com.applovin.exoplayer2.ui.SubtitleView.a
|
|
public void a(List list, x2 x2Var, float f, int i, float f2) {
|
|
this.b = list;
|
|
this.f = x2Var;
|
|
this.d = f;
|
|
this.c = i;
|
|
this.g = f2;
|
|
while (this.a.size() < list.size()) {
|
|
this.a.add(new g(getContext()));
|
|
}
|
|
invalidate();
|
|
}
|
|
}
|