Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,427 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.Xfermode;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.annotation.Nullable;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.a.c;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
/* loaded from: classes4.dex */
public class MBCusRoundImageView extends ImageView {
private int a;
private int b;
private int c;
private int d;
private Xfermode e;
private int f;
private int g;
private int h;
private int i;
private int j;
private int k;
private int l;
private int m;
private int n;
private float[] o;
private float[] p;
private RectF q;
private RectF r;
private boolean s;
private boolean t;
private Path u;
private Paint v;
public void setBorder(int i, int i2, int i3) {
this.s = true;
this.m = i2;
this.n = i3;
this.h = i;
}
public void setCornerRadius(int i) {
this.h = i;
}
public void setCustomBorder(int i, int i2, int i3, int i4, int i5, int i6) {
this.s = true;
this.t = true;
this.m = i5;
this.n = i6;
this.i = i;
this.k = i3;
this.j = i2;
this.l = i4;
}
public MBCusRoundImageView(Context context) {
this(context, null);
}
public MBCusRoundImageView(Context context, @Nullable AttributeSet attributeSet) {
this(context, null, 0);
try {
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(context, attributeSet));
} catch (Exception e) {
e.printStackTrace();
}
}
public MBCusRoundImageView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.u = new Path();
this.v = new Paint();
this.o = new float[8];
this.p = new float[8];
this.r = new RectF();
this.q = new RectF();
this.e = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
}
/* JADX WARN: Removed duplicated region for block: B:21:0x00a2 A[Catch: Exception -> 0x0079, TryCatch #2 {Exception -> 0x0079, blocks: (B:3:0x0003, B:19:0x009e, B:21:0x00a2, B:22:0x00b7, B:24:0x00bb, B:6:0x007b, B:8:0x007f, B:18:0x009b, B:54:0x0075, B:30:0x000e, B:32:0x0012, B:36:0x0019, B:40:0x0032, B:44:0x0049, B:48:0x0061, B:11:0x0083, B:13:0x0088), top: B:2:0x0003, inners: #0, #1 }] */
/* JADX WARN: Removed duplicated region for block: B:24:0x00bb A[Catch: Exception -> 0x0079, TRY_LEAVE, TryCatch #2 {Exception -> 0x0079, blocks: (B:3:0x0003, B:19:0x009e, B:21:0x00a2, B:22:0x00b7, B:24:0x00bb, B:6:0x007b, B:8:0x007f, B:18:0x009b, B:54:0x0075, B:30:0x000e, B:32:0x0012, B:36:0x0019, B:40:0x0032, B:44:0x0049, B:48:0x0061, B:11:0x0083, B:13:0x0088), top: B:2:0x0003, inners: #0, #1 }] */
/* JADX WARN: Removed duplicated region for block: B:28:? A[RETURN, SYNTHETIC] */
@Override // android.view.View
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void onSizeChanged(int r4, int r5, int r6, int r7) {
/*
Method dump skipped, instructions count: 208
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.dycreator.baseview.cusview.MBCusRoundImageView.onSizeChanged(int, int, int, int):void");
}
@Override // android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas) {
if (canvas == null) {
return;
}
try {
canvas.saveLayer(this.q, null, 31);
int i = this.f;
int i2 = this.m;
int i3 = this.g;
canvas.scale(((i - (i2 * 2)) * 1.0f) / i, ((i3 - (i2 * 2)) * 1.0f) / i3, i / 2.0f, i3 / 2.0f);
super.onDraw(canvas);
Paint paint = this.v;
if (paint != null) {
paint.reset();
this.v.setAntiAlias(true);
this.v.setStyle(Paint.Style.FILL);
this.v.setXfermode(this.e);
}
Path path = this.u;
if (path != null) {
path.reset();
this.u.addRoundRect(this.q, this.p, Path.Direction.CCW);
}
canvas.drawPath(this.u, this.v);
Paint paint2 = this.v;
if (paint2 != null) {
paint2.setXfermode(null);
}
canvas.restore();
if (this.s) {
int i4 = this.m;
int i5 = this.n;
RectF rectF = this.r;
float[] fArr = this.o;
try {
Path path2 = this.u;
if (path2 != null) {
path2.reset();
}
Paint paint3 = this.v;
if (paint3 != null) {
paint3.setStrokeWidth(i4);
this.v.setColor(i5);
this.v.setStyle(Paint.Style.STROKE);
}
Path path3 = this.u;
if (path3 != null) {
path3.addRoundRect(rectF, fArr, Path.Direction.CCW);
}
canvas.drawPath(this.u, this.v);
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e2) {
af.a("MBridgeImageView", e2.getMessage());
}
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
break;
} else {
break;
}
case 2:
b.a().a(attributeSet.getAttributeValue(i), this);
break;
case 3:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith("#")) {
try {
strArr = attributeValue2.split("-");
} catch (Exception unused) {
strArr = null;
}
if (strArr != null && strArr.length <= 2) {
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
break;
} else {
if (strArr != null && strArr.length == 3) {
try {
GradientDrawable gradientDrawable = new GradientDrawable(GradientOrientationUtils.getOrientation(strArr[2]), new int[]{Color.parseColor(strArr[0]), Color.parseColor(strArr[1])});
gradientDrawable.setGradientType(0);
setBackground(gradientDrawable);
break;
} catch (Exception unused2) {
}
}
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
break;
}
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundResource(getResources().getIdentifier(attributeValue2, "drawable", getContext().getPackageName()));
break;
}
break;
case 4:
String attributeValue3 = attributeSet.getAttributeValue(i);
if (TextUtils.isEmpty(attributeValue3)) {
break;
} else {
CharSequence charSequence = (String) com.mbridge.msdk.dycreator.e.b.a.get(attributeValue3.substring(8));
if (TextUtils.isEmpty(charSequence)) {
break;
} else {
setContentDescription(charSequence);
break;
}
}
case 5:
String attributeValue4 = attributeSet.getAttributeValue(i);
if (TextUtils.isEmpty(attributeValue4)) {
break;
} else {
String str = com.mbridge.msdk.dycreator.e.b.a.get(attributeValue4.substring(8));
if (TextUtils.isEmpty(str)) {
break;
} else {
setTag(str);
break;
}
}
case 6:
String attributeValue5 = attributeSet.getAttributeValue(i);
if (TextUtils.isEmpty(attributeValue5)) {
break;
} else if (attributeValue5.equals("invisible")) {
setVisibility(4);
break;
} else if (attributeValue5.equalsIgnoreCase("gone")) {
setVisibility(8);
break;
} else {
break;
}
case 7:
String attributeValue6 = attributeSet.getAttributeValue(i);
if (TextUtils.isEmpty(attributeValue6)) {
break;
} else if (attributeValue6.equals("fitXY")) {
setScaleType(ImageView.ScaleType.FIT_XY);
break;
} else if (attributeValue6.equals("centerInside")) {
setScaleType(ImageView.ScaleType.CENTER_INSIDE);
break;
} else if (attributeValue6.equals("centerCrop")) {
setScaleType(ImageView.ScaleType.CENTER_CROP);
break;
} else {
break;
}
case 8:
int b = b.a().b(attributeSet.getAttributeValue(i));
this.d = b;
this.c = b;
this.b = b;
this.a = b;
setPadding(b, b, b, b);
break;
case 9:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
this.b = b2;
setPadding(this.a, b2, this.c, this.d);
break;
case 10:
int b3 = b.a().b(attributeSet.getAttributeValue(i));
this.d = b3;
setPadding(this.a, this.b, this.c, b3);
break;
case 11:
int b4 = b.a().b(attributeSet.getAttributeValue(i));
this.a = b4;
setPadding(b4, this.b, this.c, this.d);
break;
case 12:
int b5 = b.a().b(attributeSet.getAttributeValue(i));
this.c = b5;
setPadding(this.a, this.b, b5, this.d);
break;
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.cusview.MBCusRoundImageView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[c.values().length];
a = iArr;
try {
iArr[c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[c.src.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[c.background.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[c.contentDescription.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[c.tag.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[c.visibility.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[c.scaleType.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[c.padding.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[c.paddingTop.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[c.paddingBottom.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[c.paddingLeft.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[c.paddingRight.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[c.layout_width.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[c.layout_height.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[c.gravity.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[c.layout_gravity.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
}
}
public ViewGroup.LayoutParams generateLayoutParams(Context context, AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
HashMap<String, c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 6) {
String attributeValue = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue)) {
if (attributeValue.equals("invisible")) {
setVisibility(4);
} else if (attributeValue.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
} else if (i2 == 13) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue2);
}
} else if (i2 == 14) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (attributeValue3.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue3.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue3.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue3);
}
}
}
}
return layoutParams;
}
}

View File

@@ -0,0 +1,363 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
/* loaded from: classes4.dex */
public class MBRotationView extends FrameLayout {
Runnable a;
private Camera b;
private Matrix c;
private int d;
private int e;
private int f;
private int g;
private int h;
private int i;
private int j;
private int k;
private float l;
private float m;
private boolean n;
private boolean o;
private boolean p;
@Override // android.view.ViewGroup
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
return true;
}
public void setHeightRatio(float f) {
this.m = f;
}
public void setWidthRatio(float f) {
this.l = f;
}
public MBRotationView(Context context) {
super(context);
this.f = 40;
this.g = 20;
this.h = 0;
this.i = 0;
this.k = 0;
this.l = 0.5f;
this.m = 0.9f;
this.n = true;
this.o = false;
this.p = false;
this.a = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBRotationView.1
@Override // java.lang.Runnable
public void run() {
MBRotationView.a(MBRotationView.this);
}
};
a();
}
public MBRotationView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.f = 40;
this.g = 20;
this.h = 0;
this.i = 0;
this.k = 0;
this.l = 0.5f;
this.m = 0.9f;
this.n = true;
this.o = false;
this.p = false;
this.a = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBRotationView.1
@Override // java.lang.Runnable
public void run() {
MBRotationView.a(MBRotationView.this);
}
};
a();
}
public MBRotationView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.f = 40;
this.g = 20;
this.h = 0;
this.i = 0;
this.k = 0;
this.l = 0.5f;
this.m = 0.9f;
this.n = true;
this.o = false;
this.p = false;
this.a = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBRotationView.1
@Override // java.lang.Runnable
public void run() {
MBRotationView.a(MBRotationView.this);
}
};
a();
}
private void a() {
this.b = new Camera();
this.c = new Matrix();
setWillNotDraw(false);
}
@Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
int i5 = i3 - i;
float f = i5;
float f2 = this.l;
int i6 = (int) (((1.0f - f2) * f) / 2.0f);
int i7 = i4 - i2;
float f3 = i7;
float f4 = this.m;
int i8 = (int) (((1.0f - f4) * f3) / 2.0f);
this.d = (int) (f3 * f4);
this.e = (int) (f * f2);
int childCount = getChildCount();
for (int i9 = 0; i9 < childCount; i9++) {
View childAt = getChildAt(i9);
childAt.layout(i6, i8, i5 - i6, i7 - i8);
childAt.setClickable(true);
ViewGroup.LayoutParams layoutParams = childAt.getLayoutParams();
int i10 = layoutParams.width;
int i11 = this.e;
if (i10 != i11) {
layoutParams.width = i11;
layoutParams.height = this.d;
childAt.setLayoutParams(layoutParams);
}
}
}
public void setRotateV(boolean z) {
this.o = z;
invalidate();
}
@Override // android.view.ViewGroup, android.view.View
public void dispatchDraw(Canvas canvas) {
if (getChildCount() == 0) {
return;
}
if (this.o) {
int height = getHeight() / 2;
int i = ((this.h * this.d) / 2) / this.f;
a(canvas, i, height, 0);
a(canvas, i, height, 1);
if (Math.abs(this.h) > this.f / 2) {
a(canvas, i, height, 3);
a(canvas, i, height, 2);
return;
} else {
a(canvas, i, height, 2);
a(canvas, i, height, 3);
return;
}
}
int width = getWidth() / 2;
int i2 = ((this.h * this.e) / 2) / this.f;
b(canvas, i2, width, 0);
b(canvas, i2, width, 1);
if (Math.abs(this.h) > this.f / 2) {
b(canvas, i2, width, 3);
b(canvas, i2, width, 2);
} else {
b(canvas, i2, width, 2);
b(canvas, i2, width, 3);
}
}
public void setAutoscroll(boolean z) {
if (z) {
postDelayed(this.a, 1000 / this.g);
}
this.n = z;
}
private void a(int i, int i2, int i3) {
float f = (-i) / 2.0f;
if (i3 == 0) {
this.b.translate(0.0f, f, 0.0f);
float f2 = -i2;
this.b.rotateX(f2);
this.b.translate(0.0f, f, 0.0f);
this.b.translate(0.0f, f, 0.0f);
this.b.rotateX(f2);
this.b.translate(0.0f, f, 0.0f);
return;
}
if (i3 == 1) {
this.b.translate(0.0f, f, 0.0f);
this.b.rotateX(i2);
this.b.translate(0.0f, f, 0.0f);
} else if (i3 != 2) {
if (i3 != 3) {
return;
}
this.b.rotateX(0.0f);
} else {
this.b.translate(0.0f, f, 0.0f);
this.b.rotateX(-i2);
this.b.translate(0.0f, f, 0.0f);
}
}
private void a(Canvas canvas, int i, int i2, int i3) {
canvas.save();
this.b.save();
this.c.reset();
float f = i;
this.b.translate(0.0f, f, 0.0f);
this.b.rotateX(this.h);
this.b.translate(0.0f, f, 0.0f);
if (i == 0) {
if (this.p) {
a(this.d, this.f, i3);
} else {
a(-this.d, -this.f, i3);
}
} else if (i > 0) {
a(this.d, this.f, i3);
} else if (i < 0) {
a(-this.d, -this.f, i3);
}
this.b.getMatrix(this.c);
this.b.restore();
this.c.preTranslate((-getWidth()) / 2, -i2);
this.c.postTranslate(getWidth() / 2, i2);
canvas.concat(this.c);
View childAt = getChildAt(a(i3));
if (childAt != null) {
drawChild(canvas, childAt, 0L);
}
canvas.restore();
}
private int a(int i) {
int i2;
int i3;
int i4;
if (i == 0) {
i2 = this.p ? this.i - 2 : this.i + 2;
} else if (i != 1) {
if (i != 2) {
i2 = i != 3 ? 0 : this.i;
} else if (this.p) {
i3 = this.i;
i2 = i3 - 1;
} else {
i4 = this.i;
i2 = i4 + 1;
}
} else if (this.p) {
i4 = this.i;
i2 = i4 + 1;
} else {
i3 = this.i;
i2 = i3 - 1;
}
int childCount = i2 % getChildCount();
return childCount >= 0 ? childCount : childCount + getChildCount();
}
private void b(int i, int i2, int i3) {
if (i3 == 0) {
float f = (-i) / 2;
this.b.translate(f, 0.0f, 0.0f);
float f2 = -i2;
this.b.rotateY(f2);
this.b.translate(f, 0.0f, 0.0f);
this.b.translate(f, 0.0f, 0.0f);
this.b.rotateY(f2);
this.b.translate(f, 0.0f, 0.0f);
return;
}
if (i3 == 1) {
float f3 = i / 2;
this.b.translate(f3, 0.0f, 0.0f);
this.b.rotateY(i2);
this.b.translate(f3, 0.0f, 0.0f);
return;
}
if (i3 != 2) {
if (i3 != 3) {
return;
}
this.b.rotateY(0.0f);
} else {
float f4 = (-i) / 2;
this.b.translate(f4, 0.0f, 0.0f);
this.b.rotateY(-i2);
this.b.translate(f4, 0.0f, 0.0f);
}
}
private void b(Canvas canvas, int i, int i2, int i3) {
canvas.save();
this.b.save();
this.c.reset();
float f = i;
this.b.translate(f, 0.0f, 0.0f);
this.b.rotateY(this.h);
this.b.translate(f, 0.0f, 0.0f);
if (i == 0) {
if (this.p) {
b(this.e, this.f, i3);
} else {
b(-this.e, -this.f, i3);
}
} else if (i > 0) {
b(this.e, this.f, i3);
} else if (i < 0) {
b(-this.e, -this.f, i3);
}
this.b.getMatrix(this.c);
this.b.restore();
this.c.preTranslate(-i2, (-getHeight()) / 2);
this.c.postTranslate(i2, getHeight() / 2);
canvas.concat(this.c);
View childAt = getChildAt(a(i3));
if (childAt != null) {
drawChild(canvas, childAt, 0L);
}
canvas.restore();
}
public static /* synthetic */ void a(MBRotationView mBRotationView) {
int a;
if (mBRotationView.getChildCount() == 0) {
return;
}
int i = mBRotationView.h - 1;
mBRotationView.h = i;
int i2 = mBRotationView.i;
mBRotationView.j = i2;
int i3 = mBRotationView.f;
int i4 = i2 - (i / i3);
int i5 = i % i3;
mBRotationView.h = i5;
mBRotationView.i = i4;
if (Math.abs(i5) > mBRotationView.f / 2) {
a = mBRotationView.a(2);
} else {
a = mBRotationView.a(3);
}
if (mBRotationView.k != a) {
mBRotationView.k = a;
}
mBRotationView.invalidate();
if (mBRotationView.n) {
mBRotationView.postDelayed(mBRotationView.a, 1000 / mBRotationView.g);
}
}
}

View File

@@ -0,0 +1,384 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.graphics.Bitmap;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.same.c.b;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
/* loaded from: classes4.dex */
public class MBridgeBaitClickView extends RelativeLayout {
public static final int ANIMATION_TYPE_DOUBLE_CLICK = 4;
public static final int ANIMATION_TYPE_FAST_SCALE = 1;
public static final int ANIMATION_TYPE_ROTATE = 5;
public static final int ANIMATION_TYPE_SLOW_SCALE = 2;
public static final int ANIMATION_TYPE_SLOW_SCALE_WITH_PAUSE = 3;
private MBridgeDyImageView a;
private MBridgeDyImageView b;
private TextView c;
private String d;
private String e;
private String f;
private int g;
private int h;
private Animation i;
private Animation j;
private Animation k;
private Animation l;
public MBridgeBaitClickView(@NonNull Context context) {
super(context);
this.d = "";
this.e = "";
this.f = "Click now for details";
this.g = 1;
this.h = 1342177280;
}
public MBridgeBaitClickView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
this.d = "";
this.e = "";
this.f = "Click now for details";
this.g = 1;
this.h = 1342177280;
}
public MBridgeBaitClickView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.d = "";
this.e = "";
this.f = "Click now for details";
this.g = 1;
this.h = 1342177280;
}
@RequiresApi(api = 21)
public MBridgeBaitClickView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.d = "";
this.e = "";
this.f = "Click now for details";
this.g = 1;
this.h = 1342177280;
}
public void init(int i) {
this.g = i;
init();
}
public void init(int i, int i2) {
this.h = i;
this.g = i2;
init();
}
public void init(int i, int i2, String str, String str2, String str3) {
this.h = i;
this.g = i2;
this.d = str;
this.e = str2;
this.f = str3;
init();
}
public void init() {
try {
setBackgroundColor(this.h);
try {
this.f = getContext().getResources().getConfiguration().locale.getLanguage().contains("zh") ? "点击查看详情" : "Click now for details";
} catch (Throwable th) {
af.b("MBridgeAnimationClickView", th.getMessage());
}
RelativeLayout relativeLayout = new RelativeLayout(getContext());
relativeLayout.setLayoutParams(new RelativeLayout.LayoutParams(-2, -2));
int a = ak.a(getContext(), 55.0f);
int a2 = ak.a(getContext(), 33.0f);
this.b = new MBridgeDyImageView(getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(a, a);
layoutParams.setMargins(a2, a2, 0, 0);
this.b.setLayoutParams(layoutParams);
final int a3 = x.a(getContext(), "mbridge_icon_click_circle", "drawable");
if (TextUtils.isEmpty(this.e)) {
this.b.setImageResource(a3);
} else {
b.a(c.m().c()).a(this.d, new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.1
@Override // com.mbridge.msdk.foundation.same.c.c
public void onSuccessLoad(Bitmap bitmap, String str) {
if (bitmap.isRecycled()) {
return;
}
MBridgeBaitClickView.this.b.setImageBitmap(bitmap);
}
@Override // com.mbridge.msdk.foundation.same.c.c
public void onFailedLoad(String str, String str2) {
MBridgeBaitClickView.this.b.setImageResource(a3);
}
});
}
int a4 = ak.a(getContext(), 108.0f);
int a5 = ak.a(getContext(), 35.0f);
int a6 = ak.a(getContext(), 43.0f);
this.a = new MBridgeDyImageView(getContext());
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(a4, a4);
layoutParams2.setMargins(a5, a6, 0, 0);
this.a.setLayoutParams(layoutParams2);
final int a7 = x.a(getContext(), "mbridge_icon_click_hand", "drawable");
if (TextUtils.isEmpty(this.d)) {
this.a.setImageResource(a7);
} else {
b.a(c.m().c()).a(this.d, new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.2
@Override // com.mbridge.msdk.foundation.same.c.c
public void onSuccessLoad(Bitmap bitmap, String str) {
if (bitmap.isRecycled()) {
return;
}
MBridgeBaitClickView.this.a.setImageBitmap(bitmap);
}
@Override // com.mbridge.msdk.foundation.same.c.c
public void onFailedLoad(String str, String str2) {
MBridgeBaitClickView.this.a.setImageResource(a7);
}
});
}
relativeLayout.addView(this.b);
relativeLayout.addView(this.a);
LinearLayout linearLayout = new LinearLayout(getContext());
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -2);
layoutParams3.addRule(13);
linearLayout.setLayoutParams(layoutParams3);
linearLayout.setOrientation(1);
linearLayout.setGravity(1);
linearLayout.addView(relativeLayout);
this.c = new TextView(getContext());
this.c.setLayoutParams(new RelativeLayout.LayoutParams(-2, -2));
this.c.setText(this.f);
this.c.setTextColor(-1);
this.c.setGravity(14);
linearLayout.addView(this.c);
addView(linearLayout);
} catch (Throwable th2) {
af.b("MBridgeAnimationClickView", th2.getMessage());
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
clearAnimation();
Animation animation = this.i;
if (animation != null) {
animation.cancel();
}
Animation animation2 = this.j;
if (animation2 != null) {
animation2.cancel();
}
Animation animation3 = this.k;
if (animation3 != null) {
animation3.cancel();
}
Animation animation4 = this.l;
if (animation4 != null) {
animation4.cancel();
}
}
public void startAnimation() {
int i = this.g;
if (i == 2) {
this.b.setVisibility(4);
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.7f, 1.0f, 0.7f, 1, 0.5f, 1, 0.5f);
this.i = scaleAnimation;
scaleAnimation.setDuration(500L);
this.i.setRepeatCount(-1);
this.i.setRepeatMode(2);
MBridgeDyImageView mBridgeDyImageView = this.a;
if (mBridgeDyImageView != null) {
mBridgeDyImageView.startAnimation(this.i);
return;
}
return;
}
if (i == 3) {
MBridgeDyImageView mBridgeDyImageView2 = this.b;
if (mBridgeDyImageView2 != null) {
mBridgeDyImageView2.setVisibility(4);
}
ScaleAnimation scaleAnimation2 = new ScaleAnimation(1.0f, 0.7f, 1.0f, 0.7f, 1, 0.5f, 1, 0.5f);
this.i = scaleAnimation2;
scaleAnimation2.setDuration(500L);
this.i.setRepeatCount(1);
this.i.setRepeatMode(2);
ScaleAnimation scaleAnimation3 = new ScaleAnimation(0.0f, 1.5f, 0.0f, 1.5f, 1, 0.5f, 1, 0.5f);
this.j = scaleAnimation3;
scaleAnimation3.setDuration(1000L);
this.j.setRepeatCount(0);
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
this.k = alphaAnimation;
alphaAnimation.setDuration(1000L);
this.k.setRepeatCount(0);
final AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(this.j);
animationSet.addAnimation(this.k);
this.j.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.3
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
if (MBridgeBaitClickView.this.b != null) {
MBridgeBaitClickView.this.b.setVisibility(0);
}
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
if (MBridgeBaitClickView.this.b != null) {
MBridgeBaitClickView.this.b.setVisibility(4);
}
}
});
this.i.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.4
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
MBridgeBaitClickView.this.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.4.1
@Override // java.lang.Runnable
public void run() {
if (MBridgeBaitClickView.this.b != null) {
MBridgeBaitClickView.this.b.startAnimation(animationSet);
}
}
}, 550L);
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
MBridgeBaitClickView.this.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.4.2
@Override // java.lang.Runnable
public void run() {
if (MBridgeBaitClickView.this.a != null) {
MBridgeBaitClickView.this.a.startAnimation(MBridgeBaitClickView.this.i);
}
}
}, 1000L);
}
});
MBridgeDyImageView mBridgeDyImageView3 = this.a;
if (mBridgeDyImageView3 != null) {
mBridgeDyImageView3.startAnimation(this.i);
return;
}
return;
}
if (i == 4) {
this.b.setVisibility(4);
ScaleAnimation scaleAnimation4 = new ScaleAnimation(0.8f, 1.0f, 0.8f, 1.0f, 1, 0.5f, 1, 0.5f);
this.i = scaleAnimation4;
scaleAnimation4.setDuration(200L);
this.i.setRepeatCount(1);
this.i.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.5
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
MBridgeBaitClickView.this.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView.5.1
@Override // java.lang.Runnable
public void run() {
if (MBridgeBaitClickView.this.a != null) {
MBridgeBaitClickView.this.a.startAnimation(MBridgeBaitClickView.this.i);
}
}
}, 1000L);
}
});
MBridgeDyImageView mBridgeDyImageView4 = this.a;
if (mBridgeDyImageView4 != null) {
mBridgeDyImageView4.startAnimation(this.i);
return;
}
return;
}
if (i != 5) {
ScaleAnimation scaleAnimation5 = new ScaleAnimation(1.0f, 0.7f, 1.0f, 0.7f, 1, 0.5f, 1, 0.5f);
this.i = scaleAnimation5;
scaleAnimation5.setDuration(200L);
this.i.setRepeatCount(-1);
this.i.setRepeatMode(2);
MBridgeDyImageView mBridgeDyImageView5 = this.a;
if (mBridgeDyImageView5 != null) {
mBridgeDyImageView5.startAnimation(this.i);
}
ScaleAnimation scaleAnimation6 = new ScaleAnimation(0.0f, 1.2f, 0.0f, 1.2f, 1, 0.5f, 1, 0.5f);
this.j = scaleAnimation6;
scaleAnimation6.setDuration(400L);
this.j.setRepeatCount(-1);
AlphaAnimation alphaAnimation2 = new AlphaAnimation(1.0f, 0.3f);
this.k = alphaAnimation2;
alphaAnimation2.setDuration(400L);
this.k.setRepeatCount(-1);
AnimationSet animationSet2 = new AnimationSet(true);
animationSet2.addAnimation(this.j);
animationSet2.addAnimation(this.k);
MBridgeDyImageView mBridgeDyImageView6 = this.b;
if (mBridgeDyImageView6 != null) {
mBridgeDyImageView6.startAnimation(animationSet2);
return;
}
return;
}
RotateAnimation rotateAnimation = new RotateAnimation(-10.0f, 30.0f, 1, 0.5f, 1, 0.5f);
this.l = rotateAnimation;
rotateAnimation.setDuration(300L);
this.l.setRepeatMode(2);
this.l.setRepeatCount(-1);
ScaleAnimation scaleAnimation7 = new ScaleAnimation(0.0f, 1.2f, 0.0f, 1.2f, 1, 0.5f, 1, 0.5f);
this.j = scaleAnimation7;
scaleAnimation7.setDuration(600L);
this.j.setRepeatCount(-1);
AlphaAnimation alphaAnimation3 = new AlphaAnimation(1.0f, 0.0f);
this.k = alphaAnimation3;
alphaAnimation3.setDuration(600L);
this.k.setRepeatCount(-1);
AnimationSet animationSet3 = new AnimationSet(true);
animationSet3.addAnimation(this.j);
animationSet3.addAnimation(this.k);
MBridgeDyImageView mBridgeDyImageView7 = this.a;
if (mBridgeDyImageView7 != null) {
mBridgeDyImageView7.startAnimation(this.l);
}
MBridgeDyImageView mBridgeDyImageView8 = this.b;
if (mBridgeDyImageView8 != null) {
mBridgeDyImageView8.startAnimation(animationSet3);
}
}
}

View File

@@ -0,0 +1,32 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mbridge.msdk.foundation.tools.af;
/* loaded from: classes4.dex */
public class MBridgeDyImageView extends ImageView {
public MBridgeDyImageView(Context context) {
super(context);
}
public MBridgeDyImageView(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBridgeDyImageView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
@Override // android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas) {
try {
super.onDraw(canvas);
} catch (Throwable th) {
af.b("MBridgeDyImageView", th.getMessage());
}
}
}

View File

@@ -0,0 +1,55 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.animation.AnimatorSet;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/* loaded from: classes4.dex */
public class MBridgeFramLayout extends FrameLayout {
private AnimatorSet a;
public void setAnimatorSet(AnimatorSet animatorSet) {
this.a = animatorSet;
}
public MBridgeFramLayout(@NonNull Context context) {
super(context);
}
public MBridgeFramLayout(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBridgeFramLayout(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
AnimatorSet animatorSet = this.a;
if (animatorSet != null) {
try {
animatorSet.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
AnimatorSet animatorSet = this.a;
if (animatorSet != null) {
try {
animatorSet.cancel();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,218 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.Xfermode;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mbridge.msdk.foundation.tools.af;
/* loaded from: classes4.dex */
public class MBridgeImageView extends ImageView {
private Xfermode a;
private int b;
private int c;
private int d;
private int e;
private int f;
private int g;
private int h;
private int i;
private int j;
private float[] k;
private float[] l;
private RectF m;
private RectF n;
private boolean o;
private boolean p;
private Path q;
private Paint r;
public void setBorder(int i, int i2, int i3) {
this.o = true;
this.i = i2;
this.j = i3;
this.d = i;
}
public void setCornerRadius(int i) {
this.d = i;
}
public void setCustomBorder(int i, int i2, int i3, int i4, int i5, int i6) {
this.o = true;
this.p = true;
this.i = i5;
this.j = i6;
this.e = i;
this.g = i3;
this.f = i2;
this.h = i4;
}
public MBridgeImageView(Context context) {
this(context, null);
}
public MBridgeImageView(Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public MBridgeImageView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.q = new Path();
this.r = new Paint();
this.k = new float[8];
this.l = new float[8];
this.n = new RectF();
this.m = new RectF();
this.a = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
}
@Override // android.view.View
public void onSizeChanged(int i, int i2, int i3, int i4) {
int i5;
int i6;
int i7;
super.onSizeChanged(i, i2, i3, i4);
this.b = i;
this.c = i2;
int i8 = 0;
if (this.p) {
try {
if (this.k != null && this.l != null) {
while (true) {
i5 = 2;
if (i8 >= 2) {
break;
}
float[] fArr = this.k;
int i9 = this.e;
fArr[i8] = i9;
this.l[i8] = i9 - (this.i / 2.0f);
i8++;
}
while (true) {
i6 = 4;
if (i5 >= 4) {
break;
}
float[] fArr2 = this.k;
int i10 = this.f;
fArr2[i5] = i10;
this.l[i5] = i10 - (this.i / 2.0f);
i5++;
}
while (true) {
if (i6 >= 6) {
break;
}
float[] fArr3 = this.k;
int i11 = this.g;
fArr3[i6] = i11;
this.l[i6] = i11 - (this.i / 2.0f);
i6++;
}
for (i7 = 6; i7 < 8; i7++) {
float[] fArr4 = this.k;
int i12 = this.h;
fArr4[i7] = i12;
this.l[i7] = i12 - (this.i / 2.0f);
}
}
} catch (Exception e) {
e.printStackTrace();
}
} else if (this.k != null && this.l != null) {
while (true) {
try {
float[] fArr5 = this.k;
if (i8 >= fArr5.length) {
break;
}
int i13 = this.d;
fArr5[i8] = i13;
this.l[i8] = i13 - (this.i / 2.0f);
i8++;
} catch (Exception e2) {
e2.printStackTrace();
}
}
}
RectF rectF = this.n;
if (rectF != null) {
int i14 = this.i;
rectF.set(i14 / 2.0f, i14 / 2.0f, this.b - (i14 / 2.0f), this.c - (i14 / 2.0f));
}
RectF rectF2 = this.m;
if (rectF2 != null) {
rectF2.set(0.0f, 0.0f, this.b, this.c);
}
}
@Override // android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas) {
if (canvas == null) {
return;
}
try {
canvas.saveLayer(this.m, null, 31);
int i = this.b;
int i2 = this.i;
int i3 = this.c;
canvas.scale(((i - (i2 * 2)) * 1.0f) / i, ((i3 - (i2 * 2)) * 1.0f) / i3, i / 2.0f, i3 / 2.0f);
super.onDraw(canvas);
Paint paint = this.r;
if (paint != null) {
paint.reset();
this.r.setAntiAlias(true);
this.r.setStyle(Paint.Style.FILL);
this.r.setXfermode(this.a);
}
Path path = this.q;
if (path != null) {
path.reset();
this.q.addRoundRect(this.m, this.l, Path.Direction.CCW);
}
canvas.drawPath(this.q, this.r);
Paint paint2 = this.r;
if (paint2 != null) {
paint2.setXfermode(null);
}
canvas.restore();
if (this.o) {
int i4 = this.i;
int i5 = this.j;
RectF rectF = this.n;
float[] fArr = this.k;
try {
Path path2 = this.q;
if (path2 != null) {
path2.reset();
}
Paint paint3 = this.r;
if (paint3 != null) {
paint3.setStrokeWidth(i4);
this.r.setColor(i5);
this.r.setStyle(Paint.Style.STROKE);
}
Path path3 = this.q;
if (path3 != null) {
path3.addRoundRect(rectF, fArr, Path.Direction.CCW);
}
canvas.drawPath(this.q, this.r);
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e2) {
af.a("MBridgeImageView", e2.getMessage());
}
}
}

View File

@@ -0,0 +1,287 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.R;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.ScaleDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.x;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public class MBridgeSegmentsProgressBar extends LinearLayout {
private final String a;
private int b;
private int c;
private int d;
private int e;
private int f;
private int g;
private int h;
private List<ProgressBar> i;
private TextView j;
private String k;
private boolean l;
public void setIndicatorText(String str) {
this.k = str;
}
public MBridgeSegmentsProgressBar(Context context) {
super(context);
this.a = "MBridgeSegmentsProgressBar";
this.c = 1;
this.d = 20;
this.e = 10;
this.f = 1;
this.g = -1711276033;
this.h = -1;
this.i = new ArrayList();
this.l = false;
}
public MBridgeSegmentsProgressBar(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
this.a = "MBridgeSegmentsProgressBar";
this.c = 1;
this.d = 20;
this.e = 10;
this.f = 1;
this.g = -1711276033;
this.h = -1;
this.i = new ArrayList();
this.l = false;
}
public MBridgeSegmentsProgressBar(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = "MBridgeSegmentsProgressBar";
this.c = 1;
this.d = 20;
this.e = 10;
this.f = 1;
this.g = -1711276033;
this.h = -1;
this.i = new ArrayList();
this.l = false;
}
@RequiresApi(api = 21)
public MBridgeSegmentsProgressBar(Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.a = "MBridgeSegmentsProgressBar";
this.c = 1;
this.d = 20;
this.e = 10;
this.f = 1;
this.g = -1711276033;
this.h = -1;
this.i = new ArrayList();
this.l = false;
}
public void init(int i, int i2) {
this.b = i;
this.c = i2;
a();
}
public void init(int i, int i2, int i3, int i4) {
this.b = i;
this.c = i2;
this.h = i3;
this.g = i4;
a();
}
public void init(int i, int i2, int i3, int i4, int i5, int i6) {
this.b = i;
this.c = i2;
this.h = i3;
this.g = i4;
this.d = i5;
this.e = i6;
a();
}
private void a() {
Drawable drawable;
try {
this.l = getContext().getResources().getConfiguration().locale.getLanguage().contains("zh");
} catch (Throwable th) {
af.b("MBridgeSegmentsProgressBar", th.getMessage());
}
try {
if (this.c == 1) {
setOrientation(1);
if (TextUtils.isEmpty(this.k)) {
this.k = this.l ? "正在播放第%s个共%s个视频" : "The %s is playing, %s videos.";
}
}
if (this.c == 2) {
setOrientation(0);
if (TextUtils.isEmpty(this.k)) {
this.k = this.l ? "广告 %s/%s" : "ADS %s/%s";
}
}
this.i.clear();
removeAllViews();
setBackground(c());
TextView textView = new TextView(getContext());
this.j = textView;
textView.setTextColor(-1);
this.j.setTextSize(12.0f);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
this.j.setLayoutParams(layoutParams);
if (this.c == 1) {
layoutParams.gravity = 5;
TextView textView2 = this.j;
int i = this.d;
textView2.setPadding(i / 2, 15, i / 2, 5);
}
if (this.c == 2) {
this.j.setGravity(16);
TextView textView3 = this.j;
int i2 = this.d;
textView3.setPadding(i2 / 2, 0, i2 / 2, 0);
}
try {
int a = x.a(getContext(), "mbridge_reward_video_icon", "drawable");
if (a != 0 && (drawable = getContext().getResources().getDrawable(a)) != null) {
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
this.j.setCompoundDrawables(drawable, null, null, null);
this.j.setCompoundDrawablePadding(5);
}
} catch (Throwable th2) {
af.b("MBridgeSegmentsProgressBar", th2.getMessage());
}
this.j.setText(a(this.f));
LinearLayout linearLayout = new LinearLayout(getContext());
linearLayout.setOrientation(0);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, 25);
linearLayout.setLayoutParams(layoutParams2);
for (int i3 = 0; i3 < this.b; i3++) {
ProgressBar progressBar = new ProgressBar(getContext(), null, R.attr.progressBarStyleHorizontal);
progressBar.setMax(100);
progressBar.setProgress(0);
progressBar.setProgressDrawable(b());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(0, 20, 1.0f);
int i4 = this.d;
layoutParams3.leftMargin = i4 / 2;
layoutParams3.rightMargin = i4 / 2;
progressBar.setLayoutParams(layoutParams3);
linearLayout.addView(progressBar);
this.i.add(progressBar);
}
int i5 = this.c;
if (i5 == 1) {
setPadding(15, 10, 15, 25);
addView(this.j);
addView(linearLayout);
} else {
if (i5 == 2) {
setPadding(15, 0, 15, 25);
layoutParams2.gravity = 16;
layoutParams2.weight = 1.0f;
addView(linearLayout);
addView(this.j);
return;
}
addView(linearLayout);
}
} catch (Throwable th3) {
af.b("MBridgeSegmentsProgressBar", th3.getMessage());
}
}
public void setProgress(int i, int i2) {
try {
if (this.i.size() == 0) {
return;
}
if (i2 < this.i.size()) {
this.i.get(i2).setProgress(i);
}
int i3 = i2 + 1;
if (i3 > this.f) {
this.f = i3;
TextView textView = this.j;
if (textView != null) {
textView.setText(a(i3));
}
}
} catch (Throwable th) {
af.b("MBridgeSegmentsProgressBar", th.getMessage());
}
}
private StringBuilder a(int i) {
StringBuilder sb = new StringBuilder();
try {
sb.append(String.format(this.k, Integer.valueOf(i), Integer.valueOf(this.b)));
} catch (Throwable th) {
sb.append(this.b);
sb.append("videos, the");
sb.append(i);
sb.append(" is playing.");
af.b("MBridgeSegmentsProgressBar", th.getMessage());
}
return sb;
}
public void dismiss() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(1000L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.cusview.MBridgeSegmentsProgressBar.1
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
MBridgeSegmentsProgressBar.this.setVisibility(8);
}
});
startAnimation(alphaAnimation);
}
private LayerDrawable b() {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(0);
gradientDrawable.setCornerRadius(this.e);
gradientDrawable.setColor(this.g);
GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setShape(0);
gradientDrawable2.setCornerRadius(this.e);
gradientDrawable2.setColor(this.h);
LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{gradientDrawable, new ScaleDrawable(gradientDrawable2, 3, 1.0f, -1.0f)});
layerDrawable.setId(0, R.id.background);
layerDrawable.setId(1, R.id.progress);
return layerDrawable;
}
private GradientDrawable c() {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setGradientType(0);
gradientDrawable.setOrientation(GradientDrawable.Orientation.TOP_BOTTOM);
gradientDrawable.setDither(true);
gradientDrawable.setColors(new int[]{0, 1291845632});
return gradientDrawable;
}
}

View File

@@ -0,0 +1,54 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import androidx.annotation.Nullable;
/* loaded from: classes4.dex */
public class MBridgeTextView extends TextView {
private ObjectAnimator a;
public void setObjectAnimator(ObjectAnimator objectAnimator) {
this.a = objectAnimator;
}
public MBridgeTextView(Context context) {
super(context);
}
public MBridgeTextView(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBridgeTextView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
@Override // android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
ObjectAnimator objectAnimator = this.a;
if (objectAnimator != null) {
try {
objectAnimator.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Override // android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
ObjectAnimator objectAnimator = this.a;
if (objectAnimator != null) {
try {
objectAnimator.cancel();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,39 @@
package com.mbridge.msdk.dycreator.baseview.cusview;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.mbridge.msdk.foundation.tools.x;
/* loaded from: classes4.dex */
public class SoundImageView extends ImageView {
private boolean a;
public boolean getStatus() {
return this.a;
}
public SoundImageView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = true;
}
public SoundImageView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = true;
}
public SoundImageView(Context context) {
super(context);
this.a = true;
}
public void setSoundStatus(boolean z) {
this.a = z;
if (z) {
setImageResource(x.a(getContext(), "mbridge_reward_sound_open", "drawable"));
} else {
setImageResource(x.a(getContext(), "mbridge_reward_sound_close", "drawable"));
}
}
}