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,41 @@
package com.mbridge.msdk.dycreator.baseview;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
/* loaded from: classes4.dex */
public class GradientOrientationUtils {
public static GradientDrawable.Orientation getOrientation(String str) {
try {
GradientDrawable.Orientation orientation = GradientDrawable.Orientation.TOP_BOTTOM;
if (TextUtils.equals(str, orientation.name())) {
return orientation;
}
GradientDrawable.Orientation orientation2 = GradientDrawable.Orientation.BL_TR;
if (!TextUtils.equals(str, orientation2.name())) {
orientation2 = GradientDrawable.Orientation.BOTTOM_TOP;
if (!TextUtils.equals(str, orientation2.name())) {
orientation2 = GradientDrawable.Orientation.BR_TL;
if (!TextUtils.equals(str, orientation2.name())) {
GradientDrawable.Orientation orientation3 = GradientDrawable.Orientation.LEFT_RIGHT;
if (!TextUtils.equals(str, orientation3.name())) {
orientation3 = GradientDrawable.Orientation.RIGHT_LEFT;
if (!TextUtils.equals(str, orientation3.name())) {
orientation3 = GradientDrawable.Orientation.TL_BR;
if (!TextUtils.equals(str, orientation3.name())) {
if (!TextUtils.equals(str, orientation2.name())) {
return orientation;
}
}
}
}
return orientation3;
}
}
}
return orientation2;
} catch (Exception unused) {
return GradientDrawable.Orientation.TOP_BOTTOM;
}
}
}

View File

@@ -0,0 +1,19 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBApkInfoView extends MBRelativeLayout {
public MBApkInfoView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public MBApkInfoView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBApkInfoView(Context context) {
super(context);
}
}

View File

@@ -0,0 +1,92 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBButton extends Button implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBButton(Context context) {
super(context);
this.c = "";
}
public MBButton(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
this.a = c.a(context, attributeSet);
a.a(this, attributeSet);
c.a(this.a, this);
}
public MBButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
@Override // android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,69 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import com.mbridge.msdk.dycreator.binding.response.SplashResData;
import com.mbridge.msdk.dycreator.bus.EventBus;
import com.mbridge.msdk.dycreator.listener.action.EAction;
import com.mbridge.msdk.e.a.a;
import com.mbridge.msdk.e.a.b;
/* loaded from: classes4.dex */
public class MBCountDownView extends MBTextView {
private b a;
private MBCountDownView b;
public MBCountDownView(Context context) {
super(context);
this.b = this;
}
public MBCountDownView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.b = this;
}
public MBCountDownView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.b = this;
}
@Override // com.mbridge.msdk.dycreator.baseview.MBTextView, android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
b bVar = this.a;
if (bVar != null) {
bVar.b();
}
}
@Override // com.mbridge.msdk.dycreator.baseview.MBTextView, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
b bVar = this.a;
if (bVar != null) {
bVar.a();
}
}
public void initView(final String str, final String str2, int i) {
this.a = new b().b(i * 1000).a(1000L).a(new a() { // from class: com.mbridge.msdk.dycreator.baseview.MBCountDownView.1
@Override // com.mbridge.msdk.e.a.a
public void onTick(long j) {
if (str2.startsWith("zh")) {
MBCountDownView.this.b.setText((j / 1000) + "s" + str);
return;
}
MBCountDownView.this.b.setText(MBCountDownView.this.b + " " + (j / 1000) + "s");
}
@Override // com.mbridge.msdk.e.a.a
public void onFinish() {
MBCountDownView.this.a.a();
SplashResData splashResData = new SplashResData();
splashResData.seteAction(EAction.CLOSE);
EventBus.getDefault().post(splashResData);
}
});
}
}

View File

@@ -0,0 +1,43 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.widget.FeedBackButton;
/* loaded from: classes4.dex */
public class MBFeedBack extends MBTextView {
public static String FEEDBACK_BTN_BACKGROUND_COLOR_STR = "#60000000";
public MBFeedBack(Context context) {
super(context);
a();
}
public MBFeedBack(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
a();
}
public MBFeedBack(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
a();
}
private void a() {
setText(x.a(getContext(), "mbridge_cm_feedback_btn_text", "string"));
int a = ak.a(getContext(), 13.0f);
setPadding(a, 0, a, 0);
setTextIsSelectable(false);
setGravity(17);
setBackgroundColor(Color.parseColor(FEEDBACK_BTN_BACKGROUND_COLOR_STR));
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setCornerRadius(ak.a(r0, 20.0f));
gradientDrawable.setColor(Color.parseColor(FeedBackButton.FEEDBACK_BTN_BACKGROUND_COLOR_STR));
setBackground(gradientDrawable);
setTextColor(-1);
}
}

View File

@@ -0,0 +1,194 @@
package com.mbridge.msdk.dycreator.baseview;
import android.animation.Animator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.baseview.inter.InterEffect;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBFrameLayout extends FrameLayout implements InterBase, InterEffect {
private Animator a;
private Map<String, String> b;
private Map<String, Boolean> c;
private String d;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterEffect
public void setAnimator(Animator animator) {
this.a = animator;
}
public MBFrameLayout(Context context, AttributeSet attributeSet) {
super(context);
this.d = "";
try {
this.b = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.b, this);
} catch (Exception e) {
af.b("MBFrameLayout", e.getMessage());
}
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
try {
Animator animator = this.a;
if (animator != null) {
animator.start();
}
} catch (Exception e) {
af.b("MBFrameLayout", e.getMessage());
}
Map<String, Boolean> map = this.c;
if (map != null && map.containsKey("mbridgeAttached") && this.c.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.d);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
try {
Animator animator = this.a;
if (animator != null) {
animator.cancel();
}
} catch (Exception e) {
af.b("MBFrameLayout", e.getMessage());
}
Map<String, Boolean> map = this.c;
if (map != null && map.containsKey("mbridgeDetached") && this.c.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.d);
}
}
@Override // android.view.View
public void setOnClickListener(@Nullable View.OnClickListener onClickListener) {
super.setOnClickListener(onClickListener);
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
layoutParams.width = -2;
layoutParams.height = -2;
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue2.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
layoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
} else if (i2 == 4) {
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
} else if (i2 == 5) {
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBFrameLayout$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.b.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.b.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.b.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.b.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.b.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.c = c.a(str);
if (campaignEx != null) {
this.d = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,163 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.AbsListView;
import android.widget.GridView;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBGridView extends GridView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBGridView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBGridView", e.getMessage());
}
}
@Override // android.widget.AbsListView, android.view.ViewGroup
public AbsListView.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
AbsListView.LayoutParams layoutParams = (AbsListView.LayoutParams) generateDefaultLayoutParams();
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
setHorizontalFadingEdgeEnabled(attributeSet.getAttributeBooleanValue(i, false));
} else if (i2 == 4) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBGridView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.fadingEdge.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
@Override // android.widget.AbsListView, android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.widget.AbsListView, android.widget.AdapterView, android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,42 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.x;
/* loaded from: classes4.dex */
public class MBHeatLevelLayoutView extends MBLinearLayout {
public MBHeatLevelLayoutView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public void setHeatCount(int i) {
try {
removeAllViews();
double a = c.a(i, 10000.0d, 2);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, c.a(getContext(), 30.0f));
layoutParams.setMargins(15, 0, 0, 0);
TextView textView = new TextView(getContext());
textView.setTypeface(Typeface.defaultFromStyle(1));
textView.setGravity(17);
textView.setTextColor(Color.parseColor("#FF000000"));
textView.setTextSize(10.0f);
Drawable drawable = getResources().getDrawable(x.a(getContext(), "mbridge_reward_user", "drawable"));
if (drawable != null) {
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
}
textView.setCompoundDrawables(null, null, drawable, null);
textView.setText(a + getResources().getString(getResources().getIdentifier("mbridge_reward_heat_count_unit", "string", com.mbridge.msdk.foundation.controller.c.m().g())));
addView(textView, layoutParams);
} catch (Exception e) {
af.b("MBHeatLevelLayoutView", e.getMessage());
}
}
}

View File

@@ -0,0 +1,174 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.HorizontalScrollView;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBHorizontalScrollView extends HorizontalScrollView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBHorizontalScrollView(Context context) {
super(context);
this.c = "";
}
public MBHorizontalScrollView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBHorizontalScrollView", e.getMessage());
}
}
public MBHorizontalScrollView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
layoutParams.width = -2;
layoutParams.height = -2;
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue2.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
layoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
} else if (i2 == 4) {
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
} else if (i2 == 5) {
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBHorizontalScrollView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,159 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBImageView extends ImageView implements InterBase {
private Map<String, Boolean> a;
private String b;
private Map<String, String> c;
public MBImageView(Context context, AttributeSet attributeSet) {
super(context);
this.b = "";
if (context != null && attributeSet != null) {
try {
this.c = c.a(context, attributeSet);
} catch (Exception e) {
af.b("MBImageView", e.getMessage());
return;
}
}
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(context, attributeSet));
c.a(this.c, this);
}
public ViewGroup.LayoutParams generateLayoutParams(Context context, AttributeSet attributeSet) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-1, -1);
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBImageView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
}
}
@Override // android.widget.ImageView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.a;
if (map != null && map.containsKey("mbridgeAttached") && this.a.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.b);
}
}
@Override // android.widget.ImageView, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.a;
if (map != null && map.containsKey("mbridgeDetached") && this.a.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.b);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.c.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.c.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.c.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.c.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.c.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.a = c.a(str);
if (campaignEx != null) {
this.b = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,184 @@
package com.mbridge.msdk.dycreator.baseview;
import android.animation.Animator;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.baseview.inter.InterEffect;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBInduceClickView extends FrameLayout implements InterBase, InterEffect {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterEffect
public void setAnimator(Animator animator) {
}
public MBInduceClickView(@NonNull Context context) {
super(context);
this.c = "";
}
public MBInduceClickView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context);
this.c = "";
if (context != null && attributeSet != null) {
try {
this.a = c.a(context, attributeSet);
} catch (Exception e) {
af.b("MBInduceClickView", e.getMessage());
return;
}
}
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
}
public MBInduceClickView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
layoutParams.width = -2;
layoutParams.height = -2;
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue2.startsWith("w")) {
layoutParams.width = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
layoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
} else if (i2 == 4) {
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
} else if (i2 == 5) {
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBInduceClickView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
}
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,252 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBLinearLayout extends LinearLayout implements InterBase {
private float a;
private float b;
private Map<String, String> c;
private Map<String, Boolean> d;
private String e;
public float getxInScreen() {
return this.a;
}
public float getyInScreen() {
return this.b;
}
public MBLinearLayout(Context context) {
super(context);
this.e = "";
}
public MBLinearLayout(Context context, AttributeSet attributeSet) {
super(context);
this.e = "";
this.c = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.c, this);
}
public MBLinearLayout(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.e = "";
}
@Override // android.widget.LinearLayout, android.view.ViewGroup
public LinearLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
LinearLayout.LayoutParams generateDefaultLayoutParams = generateDefaultLayoutParams();
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.width = -1;
break;
} else if (attributeValue.startsWith("wrap")) {
generateDefaultLayoutParams.width = -2;
break;
} else {
generateDefaultLayoutParams.width = b.a().b(attributeValue);
break;
}
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.height = -1;
break;
} else if (attributeValue2.startsWith("wrap")) {
generateDefaultLayoutParams.height = -2;
break;
} else {
generateDefaultLayoutParams.height = b.a().b(attributeValue2);
break;
}
break;
case 3:
generateDefaultLayoutParams.gravity = 1;
break;
case 4:
generateDefaultLayoutParams.gravity = 16;
break;
case 5:
generateDefaultLayoutParams.weight = attributeSet.getAttributeFloatValue(i, 0.0f);
break;
case 6:
setGravity(b.a().c(attributeSet.getAttributeValue(i)));
break;
case 7:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
generateDefaultLayoutParams.bottomMargin = b2;
generateDefaultLayoutParams.leftMargin = b2;
generateDefaultLayoutParams.rightMargin = b2;
generateDefaultLayoutParams.topMargin = b2;
break;
case 8:
generateDefaultLayoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 9:
generateDefaultLayoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 10:
generateDefaultLayoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 11:
generateDefaultLayoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 12:
generateDefaultLayoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
break;
}
}
}
return generateDefaultLayoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBLinearLayout$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_weight.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
}
}
@Override // android.view.ViewGroup
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
this.a = motionEvent.getRawX();
this.b = motionEvent.getRawY();
return super.onInterceptTouchEvent(motionEvent);
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeAttached") && this.d.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.e);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeDetached") && this.d.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.e);
}
}
@Override // android.widget.LinearLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.c.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.c.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.c.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.c.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.c.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.d = c.a(str);
if (campaignEx != null) {
this.e = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,163 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.AbsListView;
import android.widget.ListView;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBListView extends ListView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBListView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBListView", e.getMessage());
}
}
@Override // android.widget.AbsListView, android.view.ViewGroup
public AbsListView.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
AbsListView.LayoutParams layoutParams = (AbsListView.LayoutParams) generateDefaultLayoutParams();
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
} else if (i2 == 3) {
setHorizontalFadingEdgeEnabled(attributeSet.getAttributeBooleanValue(i, false));
} else if (i2 == 4) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBListView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.fadingEdge.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
}
}
@Override // android.widget.AbsListView, android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.widget.ListView, android.widget.AbsListView, android.widget.AdapterView, android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,19 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBLogoTextView extends MBTextView {
public MBLogoTextView(Context context) {
super(context);
}
public MBLogoTextView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBLogoTextView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
}

View File

@@ -0,0 +1,256 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.playercommon.PlayerView;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBPlayerView extends PlayerView implements InterBase {
private float a;
private float b;
private Map<String, String> c;
private Map<String, Boolean> d;
private String e;
public float getxInScreen() {
return this.a;
}
public float getyInScreen() {
return this.b;
}
public MBPlayerView(Context context) {
super(context);
this.e = "";
}
public MBPlayerView(Context context, AttributeSet attributeSet) {
super(context);
this.e = "";
try {
this.c = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.c, this);
} catch (Exception e) {
af.b("MBLinearLayout", e.getMessage());
}
}
@Override // android.widget.LinearLayout, android.view.ViewGroup
public LinearLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i);
if (!attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) && !attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
break;
} else {
layoutParams.width = b.a().b(attributeValue);
break;
}
} else {
layoutParams.width = -1;
break;
}
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (!attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) && !attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
break;
} else {
layoutParams.height = b.a().b(attributeValue2);
break;
}
} else {
layoutParams.height = -1;
break;
}
break;
case 3:
layoutParams.gravity = 1;
break;
case 4:
layoutParams.gravity = 16;
break;
case 5:
layoutParams.weight = attributeSet.getAttributeFloatValue(i, 0.0f);
break;
case 6:
setGravity(b.a().c(attributeSet.getAttributeValue(i)));
break;
case 7:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.bottomMargin = b2;
layoutParams.leftMargin = b2;
layoutParams.rightMargin = b2;
layoutParams.topMargin = b2;
break;
case 8:
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 9:
layoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 10:
layoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 11:
layoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 12:
layoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
break;
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBPlayerView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_weight.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
}
}
@Override // com.mbridge.msdk.playercommon.PlayerView, android.view.ViewGroup
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
this.a = motionEvent.getRawX();
this.b = motionEvent.getRawY();
return super.onInterceptTouchEvent(motionEvent);
}
@Override // android.widget.LinearLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeAttached") && this.d.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.e);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeDetached") && this.d.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.e);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.c.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.c.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.c.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.c.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.c.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.d = c.a(str);
if (campaignEx != null) {
this.e = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,431 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.RelativeLayout;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBRelativeLayout extends RelativeLayout implements InterBase {
private float a;
private float b;
private Map<String, String> c;
private Map<String, Boolean> d;
private String e;
public float getxInScreen() {
return this.a;
}
public float getyInScreen() {
return this.b;
}
public MBRelativeLayout(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.e = "";
}
public MBRelativeLayout(Context context, AttributeSet attributeSet) {
super(context);
this.e = "";
try {
this.c = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.c, this);
} catch (Exception e) {
af.b("MBRelativeLayouts", e.getMessage());
}
}
public MBRelativeLayout(Context context) {
super(context);
this.e = "";
}
@Override // android.widget.RelativeLayout, android.view.ViewGroup
public RelativeLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i);
if (!attributeValue.startsWith("fill") && !attributeValue.startsWith("match")) {
if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
break;
} else {
layoutParams.width = b.a().b(attributeValue);
break;
}
} else {
layoutParams.width = -1;
break;
}
break;
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (!attributeValue2.startsWith("fill") && !attributeValue2.startsWith("match")) {
if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
break;
} else {
layoutParams.height = b.a().b(attributeValue2);
break;
}
} else {
layoutParams.height = -1;
break;
}
break;
case 3:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(14, -1);
break;
} else {
break;
}
case 4:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(12, -1);
break;
} else {
break;
}
case 5:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(10, -1);
break;
} else {
break;
}
case 6:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(15, -1);
break;
} else {
break;
}
case 7:
String attributeValue3 = attributeSet.getAttributeValue(i);
if (attributeValue3.startsWith("@+id")) {
layoutParams.addRule(3, attributeValue3.substring(5).hashCode());
break;
} else {
break;
}
case 8:
String attributeValue4 = attributeSet.getAttributeValue(i);
if (attributeValue4.startsWith("@+id")) {
layoutParams.addRule(2, attributeValue4.substring(5).hashCode());
break;
} else {
break;
}
case 9:
String attributeValue5 = attributeSet.getAttributeValue(i);
if (attributeValue5.startsWith("@+id")) {
layoutParams.addRule(0, attributeValue5.substring(5).hashCode());
break;
} else {
break;
}
case 10:
String attributeValue6 = attributeSet.getAttributeValue(i);
if (attributeValue6.startsWith("@+id")) {
layoutParams.addRule(1, attributeValue6.substring(5).hashCode());
break;
} else {
break;
}
case 11:
String attributeValue7 = attributeSet.getAttributeValue(i);
if (attributeValue7.startsWith("@+id")) {
layoutParams.addRule(17, attributeValue7.substring(5).hashCode());
break;
} else {
break;
}
case 12:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
break;
case 13:
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 14:
layoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 15:
layoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 16:
layoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 17:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(11, -1);
break;
} else {
break;
}
case 18:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(9, -1);
break;
} else {
break;
}
case 19:
String attributeValue8 = attributeSet.getAttributeValue(i);
if (attributeValue8.startsWith("@+id")) {
layoutParams.addRule(6, attributeValue8.substring(5).hashCode());
break;
} else {
break;
}
case 20:
String attributeValue9 = attributeSet.getAttributeValue(i);
if (attributeValue9.startsWith("@+id")) {
layoutParams.addRule(5, attributeValue9.substring(5).hashCode());
break;
} else {
break;
}
case 21:
String attributeValue10 = attributeSet.getAttributeValue(i);
if (attributeValue10.startsWith("@+id")) {
layoutParams.addRule(7, attributeValue10.substring(5).hashCode());
break;
} else {
break;
}
case 22:
String attributeValue11 = attributeSet.getAttributeValue(i);
if (attributeValue11.startsWith("@+id")) {
layoutParams.addRule(8, attributeValue11.substring(5).hashCode());
break;
} else {
break;
}
case 23:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(13, -1);
break;
} else {
break;
}
case 24:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(21, -1);
break;
} else {
break;
}
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBRelativeLayout$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentBottom.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentTop.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_below.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_above.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toLeftOf.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toRightOf.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toEndOf.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentRight.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentLeft.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignTop.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignLeft.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignRight.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignBottom.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerInParent.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentEnd.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
}
}
@Override // android.widget.RelativeLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
for (int i5 = 0; i5 < getChildCount(); i5++) {
try {
View childAt = getChildAt(i5);
if (childAt instanceof MBLinearLayout) {
MBLinearLayout mBLinearLayout = (MBLinearLayout) childAt;
for (int i6 = 0; i6 < mBLinearLayout.getChildCount(); i6++) {
}
}
} catch (Exception e) {
af.b("MBRelativeLayouts", e.getMessage());
}
}
super.onLayout(z, i, i2, i3, i4);
}
@Override // android.view.ViewGroup
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
this.a = motionEvent.getRawX();
this.b = motionEvent.getRawY();
return super.onInterceptTouchEvent(motionEvent);
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeAttached") && this.d.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.e);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeDetached") && this.d.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.e);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.c.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.c.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.c.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.c.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.c.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.d = c.a(str);
if (campaignEx != null) {
this.e = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,86 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import com.mbridge.msdk.foundation.tools.af;
/* loaded from: classes4.dex */
public class MBRoundRectImageViewC extends MBImageView {
private Paint a;
public MBRoundRectImageViewC(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = new Paint();
}
@Override // android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas) {
try {
Drawable drawable = getDrawable();
if (drawable == null) {
super.onDraw(canvas);
return;
}
Bitmap a = a(((BitmapDrawable) drawable).getBitmap());
if (a != null && !a.isRecycled()) {
Bitmap a2 = a(a, 30);
if (a2 != null && !a2.isRecycled()) {
Rect rect = new Rect(0, 0, a2.getWidth(), a2.getHeight());
this.a.reset();
canvas.drawBitmap(a2, rect, rect, this.a);
return;
}
super.onDraw(canvas);
return;
}
super.onDraw(canvas);
} catch (Exception e) {
af.b("MBRoundRectImageViewC", e.getMessage());
}
}
private Bitmap a(Bitmap bitmap) {
if (bitmap != null && !bitmap.isRecycled()) {
try {
int width = getWidth();
float height = getHeight() / bitmap.getHeight();
Matrix matrix = new Matrix();
matrix.postScale(width / bitmap.getWidth(), height);
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
} catch (Exception e) {
af.b("MBRoundRectImageViewC", e.getMessage());
}
}
return bitmap;
}
private Bitmap a(Bitmap bitmap, int i) {
if (bitmap != null && !bitmap.isRecycled()) {
try {
Shader.TileMode tileMode = Shader.TileMode.CLAMP;
BitmapShader bitmapShader = new BitmapShader(bitmap, tileMode, tileMode);
Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(createBitmap);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setShader(bitmapShader);
float f = i;
canvas.drawRoundRect(new RectF(0.0f, 0.0f, bitmap.getWidth(), bitmap.getHeight()), f, f, paint);
return createBitmap;
} catch (Exception e) {
af.b("MBRoundRectImageViewC", e.getMessage());
}
}
return bitmap;
}
}

View File

@@ -0,0 +1,183 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.ScrollView;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBScrollView extends ScrollView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBScrollView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
}
public void setAttributeSet(AttributeSet attributeSet) {
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith("#")) {
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundDrawable(new BitmapDrawable(BitmapFactory.decodeFile(getContext().getFilesDir().toString() + "/" + attributeValue2 + ".png")));
}
} else if (i2 == 3) {
setContentDescription(attributeSet.getAttributeValue(i));
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBScrollView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.contentDescription.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.fadingEdge.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
}
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams generateDefaultLayoutParams = generateDefaultLayoutParams();
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
Log.e("MBscrollviewparam", cVar.toString());
}
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 4) {
setHorizontalFadingEdgeEnabled(attributeSet.getAttributeBooleanValue(i, false));
} else if (i2 == 5) {
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 == 6) {
generateDefaultLayoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
}
}
}
return generateDefaultLayoutParams;
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.widget.ScrollView, android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,429 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
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;
/* loaded from: classes4.dex */
public class MBSplashClickView extends MBRelativeLayout {
public final int TYPE_SPLASH_BTN_CLICK;
public final int TYPE_SPLASH_BTN_GO;
public final int TYPE_SPLASH_BTN_OPEN;
private final String a;
private final String b;
private final String c;
private final String d;
private final String e;
private final String f;
private final String g;
private final String h;
private final String i;
private final String j;
private final String k;
private final String l;
private String m;
private int n;
private ImageView o;
private ImageView p;
private final RectF q;
private final Paint r;
private final Paint s;
public MBSplashClickView(Context context) {
super(context);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
this.g = "mbridge_splash_btn_arrow_right";
this.h = "mbridge_splash_btn_circle";
this.i = "mbridge_splash_btn_finger";
this.j = "mbridge_splash_btn_go";
this.k = "mbridge_splash_btn_light";
this.l = "mbridge_expand_data";
this.TYPE_SPLASH_BTN_OPEN = 1;
this.TYPE_SPLASH_BTN_GO = 2;
this.TYPE_SPLASH_BTN_CLICK = 3;
this.q = new RectF();
this.r = new Paint();
this.s = new Paint();
a();
}
public MBSplashClickView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
this.g = "mbridge_splash_btn_arrow_right";
this.h = "mbridge_splash_btn_circle";
this.i = "mbridge_splash_btn_finger";
this.j = "mbridge_splash_btn_go";
this.k = "mbridge_splash_btn_light";
this.l = "mbridge_expand_data";
this.TYPE_SPLASH_BTN_OPEN = 1;
this.TYPE_SPLASH_BTN_GO = 2;
this.TYPE_SPLASH_BTN_CLICK = 3;
this.q = new RectF();
this.r = new Paint();
this.s = new Paint();
a();
}
public MBSplashClickView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
this.g = "mbridge_splash_btn_arrow_right";
this.h = "mbridge_splash_btn_circle";
this.i = "mbridge_splash_btn_finger";
this.j = "mbridge_splash_btn_go";
this.k = "mbridge_splash_btn_light";
this.l = "mbridge_expand_data";
this.TYPE_SPLASH_BTN_OPEN = 1;
this.TYPE_SPLASH_BTN_GO = 2;
this.TYPE_SPLASH_BTN_CLICK = 3;
this.q = new RectF();
this.r = new Paint();
this.s = new Paint();
a();
}
private void a() {
this.r.setAntiAlias(true);
this.r.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
this.s.setAntiAlias(true);
this.s.setColor(-1);
}
@Override // com.mbridge.msdk.dycreator.baseview.MBRelativeLayout, android.widget.RelativeLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
this.q.set(0.0f, 0.0f, getWidth(), getHeight());
}
@Override // android.view.View
public void draw(Canvas canvas) {
canvas.saveLayer(this.q, this.s, 31);
canvas.drawRoundRect(this.q, 200.0f, 200.0f, this.s);
canvas.saveLayer(this.q, this.r, 31);
super.draw(canvas);
canvas.restore();
}
@Override // com.mbridge.msdk.dycreator.baseview.MBRelativeLayout, android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
int i = this.n;
if (i == 2) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.8f, 1.0f, 0.8f, 1.0f, 1, 0.5f, 1, 0.5f);
scaleAnimation.setDuration(500L);
scaleAnimation.setRepeatCount(-1);
scaleAnimation.setRepeatMode(2);
this.o.startAnimation(scaleAnimation);
return;
}
if (i == 1) {
TranslateAnimation translateAnimation = new TranslateAnimation(0, -100.0f, 0, 1000.0f, 0, 0.0f, 0, 0.0f);
translateAnimation.setDuration(1000L);
translateAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.3
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
MBSplashClickView.this.o.setVisibility(0);
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(final Animation animation) {
MBSplashClickView.this.o.setVisibility(4);
MBSplashClickView.this.o.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.3.1
@Override // java.lang.Runnable
public void run() {
MBSplashClickView.this.o.startAnimation(animation);
}
}, 2000L);
}
});
this.o.startAnimation(translateAnimation);
return;
}
if (i == 3) {
ScaleAnimation scaleAnimation2 = new ScaleAnimation(1.0f, 0.7f, 1.0f, 0.7f, 1, 0.5f, 1, 0.5f);
scaleAnimation2.setDuration(1000L);
scaleAnimation2.setRepeatCount(-1);
scaleAnimation2.setRepeatMode(2);
final ScaleAnimation scaleAnimation3 = new ScaleAnimation(0.0f, 0.5f, 0.0f, 0.5f, 1, 0.5f, 1, 0.5f);
scaleAnimation3.setDuration(400L);
scaleAnimation3.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.1
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationRepeat(Animation animation) {
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationStart(Animation animation) {
MBSplashClickView.this.p.setVisibility(0);
}
@Override // android.view.animation.Animation.AnimationListener
public void onAnimationEnd(Animation animation) {
MBSplashClickView.this.p.setVisibility(4);
MBSplashClickView.this.p.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.1.1
@Override // java.lang.Runnable
public void run() {
MBSplashClickView.this.p.startAnimation(scaleAnimation3);
}
}, 1600L);
}
});
this.p.setVisibility(4);
this.o.startAnimation(scaleAnimation2);
this.p.postDelayed(new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.2
@Override // java.lang.Runnable
public void run() {
MBSplashClickView.this.p.startAnimation(scaleAnimation3);
}
}, 800L);
}
}
private View a(ViewGroup viewGroup, String str) {
if (viewGroup != null) {
try {
if (!TextUtils.isEmpty(str)) {
if (viewGroup.getId() == str.hashCode()) {
return viewGroup;
}
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
if (childAt.getId() == str.hashCode()) {
return childAt;
}
if (childAt instanceof ViewGroup) {
a((ViewGroup) childAt, str);
}
}
return null;
}
} catch (Exception e) {
af.b("MBSplashClickView", e.getMessage());
}
}
return null;
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
public void initView(String str) {
char c;
RelativeLayout.LayoutParams layoutParams;
View a;
this.m = str;
str.hashCode();
final int i = 0;
switch (str.hashCode()) {
case -672744069:
if (str.equals("Install")) {
c = 0;
break;
}
c = 65535;
break;
case 2464362:
if (str.equals("Open")) {
c = 1;
break;
}
c = 65535;
break;
case 2666181:
if (str.equals("View")) {
c = 2;
break;
}
c = 65535;
break;
case 855294846:
if (str.equals("下载第三方应用")) {
c = 3;
break;
}
c = 65535;
break;
case 1383132195:
if (str.equals("打开第三方应用")) {
c = 4;
break;
}
c = 65535;
break;
case 1681333335:
if (str.equals("浏览第三方应用")) {
c = 5;
break;
}
c = 65535;
break;
default:
c = 65535;
break;
}
switch (c) {
case 0:
case 3:
this.n = 3;
break;
case 1:
case 4:
this.n = 1;
break;
case 2:
case 5:
this.n = 2;
break;
default:
boolean contains = getContext().getResources().getConfiguration().locale.getLanguage().contains("zh");
if (TextUtils.isEmpty(this.m)) {
this.m = contains ? "浏览第三方应用" : "View";
}
this.n = 2;
break;
}
ViewGroup viewGroup = (ViewGroup) getParent();
String charSequence = (viewGroup == null || (a = a(viewGroup, "mbridge_expand_data")) == null || !(a instanceof TextView)) ? "" : ((TextView) a).getText().toString();
int i2 = this.n;
int parseColor = Color.parseColor("#666666");
int parseColor2 = Color.parseColor("#8FC31F");
int parseColor3 = Color.parseColor("#000000");
GradientDrawable gradientDrawable = new GradientDrawable();
if (i2 == 2) {
gradientDrawable.setColor(parseColor2);
} else {
gradientDrawable.setColor(parseColor3);
gradientDrawable.setStroke(2, parseColor);
}
gradientDrawable.setCornerRadius(200);
setBackground(gradientDrawable);
TextView textView = new TextView(getContext());
RelativeLayout.LayoutParams layoutParams2 = new RelativeLayout.LayoutParams(-1, -1);
layoutParams2.addRule(15);
textView.setLayoutParams(layoutParams2);
textView.setGravity(17);
textView.setTextSize(20.0f);
textView.setTextColor(-1);
textView.setText(this.m);
this.o = new ImageView(getContext());
int i3 = this.n;
if (i3 == 2) {
i = getResources().getIdentifier("mbridge_splash_btn_go", "drawable", c.m().g());
layoutParams = new RelativeLayout.LayoutParams(ak.a(getContext(), 35.0f), ak.a(getContext(), 35.0f));
layoutParams.addRule(11);
layoutParams.addRule(15);
layoutParams.rightMargin = ak.a(getContext(), 10.0f);
} else if (i3 == 1) {
i = getResources().getIdentifier("mbridge_splash_btn_light", "drawable", c.m().g());
layoutParams = new RelativeLayout.LayoutParams(-2, -1);
layoutParams.leftMargin = 20;
layoutParams.rightMargin = 20;
ImageView imageView = new ImageView(getContext());
RelativeLayout.LayoutParams layoutParams3 = new RelativeLayout.LayoutParams(-2, -1);
layoutParams3.addRule(11);
layoutParams3.addRule(15);
layoutParams3.rightMargin = ak.a(getContext(), 50.0f);
imageView.setImageResource(getResources().getIdentifier("mbridge_splash_btn_arrow_right", "drawable", c.m().g()));
imageView.setScaleType(ImageView.ScaleType.CENTER);
imageView.setLayoutParams(layoutParams3);
addView(imageView);
} else if (i3 == 3) {
i = getResources().getIdentifier("mbridge_splash_btn_finger", "drawable", c.m().g());
layoutParams = new RelativeLayout.LayoutParams(ak.a(getContext(), 25.0f), ak.a(getContext(), 25.0f));
layoutParams.addRule(11);
layoutParams.rightMargin = ak.a(getContext(), 50.0f);
layoutParams.topMargin = ak.a(getContext(), 18.0f);
this.p = new ImageView(getContext());
RelativeLayout.LayoutParams layoutParams4 = new RelativeLayout.LayoutParams(ak.a(getContext(), 30.0f), ak.a(getContext(), 30.0f));
layoutParams4.addRule(11);
layoutParams4.rightMargin = ak.a(getContext(), 50.0f);
layoutParams4.topMargin = ak.a(getContext(), 5.0f);
this.p.setLayoutParams(layoutParams4);
this.p.setImageResource(getResources().getIdentifier("mbridge_splash_btn_circle", "drawable", c.m().g()));
addView(this.p);
} else {
layoutParams = null;
}
this.o.setLayoutParams(layoutParams);
if (TextUtils.isEmpty(charSequence)) {
this.o.setImageResource(i);
} else {
final ImageView imageView2 = this.o;
if (imageView2 != null) {
try {
if (TextUtils.isEmpty(charSequence)) {
imageView2.setBackgroundResource(i);
}
b.a(c.m().c()).a(charSequence, new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.dycreator.baseview.MBSplashClickView.4
@Override // com.mbridge.msdk.foundation.same.c.c
public void onSuccessLoad(Bitmap bitmap, String str2) {
if (imageView2 != null) {
if (bitmap != null && !bitmap.isRecycled()) {
if (MBSplashClickView.this.p != null) {
MBSplashClickView mBSplashClickView = MBSplashClickView.this;
mBSplashClickView.removeView(mBSplashClickView.p);
}
imageView2.setImageBitmap(bitmap);
return;
}
imageView2.setBackgroundResource(i);
}
}
@Override // com.mbridge.msdk.foundation.same.c.c
public void onFailedLoad(String str2, String str3) {
ImageView imageView3 = imageView2;
if (imageView3 != null) {
imageView3.setBackgroundResource(i);
}
}
});
} catch (Exception e) {
af.a("MBSplashClickView", e.getMessage());
imageView2.setBackgroundResource(i);
}
}
}
addView(textView);
addView(this.o);
invalidate();
}
}

View File

@@ -0,0 +1,11 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBSplashImageBgView extends MBImageView {
public MBSplashImageBgView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
}

View File

@@ -0,0 +1,19 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBSplashLandView extends MBRelativeLayout {
public MBSplashLandView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public MBSplashLandView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public MBSplashLandView(Context context) {
super(context);
}
}

View File

@@ -0,0 +1,11 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBSplashPortRelateView extends MBRelativeLayout {
public MBSplashPortRelateView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
}

View File

@@ -0,0 +1,11 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
/* loaded from: classes4.dex */
public class MBSplashPortView extends MBImageView {
public MBSplashPortView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
}

View File

@@ -0,0 +1,79 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
/* loaded from: classes4.dex */
public class MBSplashShakeView extends MBLinearLayout {
private final String a;
private final String b;
private final String c;
private final String d;
private final String e;
private final String f;
private ImageView g;
private Animation h;
public MBSplashShakeView(Context context) {
super(context);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
}
public MBSplashShakeView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
}
public MBSplashShakeView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = "浏览第三方应用";
this.b = "View";
this.c = "打开第三方应用";
this.d = "Open";
this.e = "下载第三方应用";
this.f = "Install";
}
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARN: Code restructure failed: missing block: B:23:0x0111, code lost:
if (r10.equals("Open") == false) goto L6;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void initView(java.lang.String r10) {
/*
Method dump skipped, instructions count: 414
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.dycreator.baseview.MBSplashShakeView.initView(java.lang.String):void");
}
@Override // com.mbridge.msdk.dycreator.baseview.MBLinearLayout, android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
if (this.g != null) {
RotateAnimation rotateAnimation = new RotateAnimation(-10.0f, 10.0f, 1, 0.5f, 1, 0.5f);
this.h = rotateAnimation;
rotateAnimation.setDuration(100L);
this.h.setRepeatMode(2);
this.h.setRepeatCount(-1);
this.g.startAnimation(this.h);
}
}
}

View File

@@ -0,0 +1,38 @@
package com.mbridge.msdk.dycreator.baseview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.x;
/* loaded from: classes4.dex */
public class MBStarLevelLayoutView extends MBLinearLayout {
public MBStarLevelLayoutView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public void setRating(int i) {
try {
removeAllViews();
if (i == 0) {
i = 5;
}
for (int i2 = 0; i2 < 5; i2++) {
ImageView imageView = new ImageView(getContext());
ViewGroup.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
if (i2 < i) {
imageView.setImageResource(x.a(c.m().c(), "mbridge_download_message_dialog_star_sel", "drawable"));
} else {
imageView.setImageResource(x.a(c.m().c(), "mbridge_download_message_dilaog_star_nor", "drawable"));
}
addView(imageView, layoutParams);
}
} catch (Exception e) {
af.b("MBStarLevelLayoutView", e.getMessage());
}
}
}

View File

@@ -0,0 +1,190 @@
package com.mbridge.msdk.dycreator.baseview;
import android.animation.Animator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.TextView;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.baseview.inter.InterEffect;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBTextView extends TextView implements InterBase, InterEffect {
private boolean a;
public AttributeSet attrs;
private Animator b;
private Map<String, String> c;
private Map<String, Boolean> d;
private String e;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterEffect
public void setAnimator(Animator animator) {
this.b = animator;
}
public MBTextView(Context context) {
super(context);
this.a = false;
this.e = "";
}
public MBTextView(Context context, AttributeSet attributeSet) {
super(context);
this.a = false;
this.e = "";
this.attrs = attributeSet;
try {
this.c = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.c, this);
} catch (Exception e) {
af.b("TextView", e.getMessage());
}
}
public MBTextView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = false;
this.e = "";
}
@Override // android.view.View
public boolean isFocused() {
if (this.a) {
return true;
}
return super.isFocused();
}
@Override // android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Animator animator = this.b;
if (animator != null) {
try {
animator.start();
} catch (Exception e) {
e.printStackTrace();
}
}
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeAttached") && this.d.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.e);
}
}
@Override // android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Animator animator = this.b;
if (animator != null) {
try {
animator.cancel();
} catch (Exception e) {
e.printStackTrace();
}
}
Map<String, Boolean> map = this.d;
if (map != null && map.containsKey("mbridgeDetached") && this.d.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.e);
}
}
public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-1, -1);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 2) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
}
}
}
return layoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.MBTextView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.c.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.c.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.c.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.c.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.c;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.c.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.d = c.a(str);
if (campaignEx != null) {
this.e = campaignEx.getCampaignUnitId();
}
}
}

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"));
}
}
}

View File

@@ -0,0 +1,451 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.x;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtAcquireRewardPopView extends MBAcquireRewardPopView implements InterBase {
private Map<String, String> a;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
}
public MBExtAcquireRewardPopView(Context context) {
super(context);
}
public MBExtAcquireRewardPopView(Context context, AttributeSet attributeSet) {
super(context);
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtAcquireRewardPopView", e.getMessage());
}
}
public MBExtAcquireRewardPopView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
}
} else if (i2 == 2) {
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)));
} 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);
} catch (Exception unused2) {
}
}
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
}
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), attributeValue2, "drawable"));
}
} else if (i2 == 3) {
int b = b.a().b(attributeSet.getAttributeValue(i));
setPadding(b, b, b, b);
} else if (i2 == 4) {
setGravity(b.a().c(attributeSet.getAttributeValue(i)));
} else if (i2 == 5) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtAcquireRewardPopView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentBottom.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentTop.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_below.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_above.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toLeftOf.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toRightOf.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toEndOf.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentRight.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentLeft.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignTop.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignLeft.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignRight.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignBottom.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerInParent.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentEnd.ordinal()] = 29;
} catch (NoSuchFieldError unused29) {
}
}
}
@Override // android.widget.RelativeLayout, android.view.ViewGroup
public RelativeLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 6:
String attributeValue = attributeSet.getAttributeValue(i);
if (!attributeValue.startsWith("fill") && !attributeValue.startsWith("match")) {
if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
break;
} else {
layoutParams.width = b.a().b(attributeValue);
break;
}
} else {
layoutParams.width = -1;
break;
}
break;
case 7:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (!attributeValue2.startsWith("fill") && !attributeValue2.startsWith("match")) {
if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
break;
} else {
layoutParams.height = b.a().b(attributeValue2);
break;
}
} else {
layoutParams.height = -1;
break;
}
break;
case 8:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(14, -1);
break;
} else {
break;
}
case 9:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(12, -1);
break;
} else {
break;
}
case 10:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(10, -1);
break;
} else {
break;
}
case 11:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(15, -1);
break;
} else {
break;
}
case 12:
String attributeValue3 = attributeSet.getAttributeValue(i);
if (attributeValue3.startsWith("@+id")) {
layoutParams.addRule(3, attributeValue3.substring(5).hashCode());
break;
} else {
break;
}
case 13:
String attributeValue4 = attributeSet.getAttributeValue(i);
if (attributeValue4.startsWith("@+id")) {
layoutParams.addRule(2, attributeValue4.substring(5).hashCode());
break;
} else {
break;
}
case 14:
String attributeValue5 = attributeSet.getAttributeValue(i);
if (attributeValue5.startsWith("@+id")) {
layoutParams.addRule(0, attributeValue5.substring(5).hashCode());
break;
} else {
break;
}
case 15:
String attributeValue6 = attributeSet.getAttributeValue(i);
if (attributeValue6.startsWith("@+id")) {
layoutParams.addRule(1, attributeValue6.substring(5).hashCode());
break;
} else {
break;
}
case 16:
String attributeValue7 = attributeSet.getAttributeValue(i);
if (attributeValue7.startsWith("@+id")) {
layoutParams.addRule(17, attributeValue7.substring(5).hashCode());
break;
} else {
break;
}
case 17:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
break;
case 18:
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 19:
layoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 20:
layoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 21:
layoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 22:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(11, -1);
break;
} else {
break;
}
case 23:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(9, -1);
break;
} else {
break;
}
case 24:
String attributeValue8 = attributeSet.getAttributeValue(i);
if (attributeValue8.startsWith("@+id")) {
layoutParams.addRule(6, attributeValue8.substring(5).hashCode());
break;
} else {
break;
}
case 25:
String attributeValue9 = attributeSet.getAttributeValue(i);
if (attributeValue9.startsWith("@+id")) {
layoutParams.addRule(5, attributeValue9.substring(5).hashCode());
break;
} else {
break;
}
case 26:
String attributeValue10 = attributeSet.getAttributeValue(i);
if (attributeValue10.startsWith("@+id")) {
layoutParams.addRule(7, attributeValue10.substring(5).hashCode());
break;
} else {
break;
}
case 27:
String attributeValue11 = attributeSet.getAttributeValue(i);
if (attributeValue11.startsWith("@+id")) {
layoutParams.addRule(8, attributeValue11.substring(5).hashCode());
break;
} else {
break;
}
case 28:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(13, -1);
break;
} else {
break;
}
case 29:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(21, -1);
break;
} else {
break;
}
}
}
}
return layoutParams;
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
}

View File

@@ -0,0 +1,443 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import com.mbridge.msdk.widget.FeedBackButton;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtFeedBackView extends FeedBackButton implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBExtFeedBackView(Context context) {
super(context);
this.c = "";
}
public MBExtFeedBackView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtFeedBackView", e.getMessage());
}
}
public MBExtFeedBackView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
public void setAttributeSet(AttributeSet attributeSet) {
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
int i = 0;
int i2 = 0;
int i3 = 0;
int i4 = 0;
for (int i5 = 0; i5 < attributeCount; i5++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i5));
if (cVar != null) {
cVar.toString();
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i5);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
break;
} else {
break;
}
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue2)) {
break;
} else if (attributeValue2.startsWith("@string/")) {
setText(b.a().e(attributeSet.getAttributeValue(i5)));
break;
} else {
setText(attributeValue2);
break;
}
case 3:
String attributeValue3 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue3)) {
break;
} else {
if (attributeValue3.equals(TtmlNode.END)) {
setEllipsize(TextUtils.TruncateAt.END);
}
if (attributeValue3.equals("start")) {
setEllipsize(TextUtils.TruncateAt.START);
}
if (attributeValue3.equals("middle")) {
setEllipsize(TextUtils.TruncateAt.MIDDLE);
}
if (attributeValue3.equals("marquee")) {
setEllipsize(TextUtils.TruncateAt.MARQUEE);
break;
} else {
break;
}
}
case 4:
setSingleLine(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 5:
setLines(attributeSet.getAttributeIntValue(i5, 1));
break;
case 6:
String attributeValue4 = attributeSet.getAttributeValue(i5);
String substring = attributeValue4.startsWith("@drawable/") ? attributeValue4.substring(10) : "";
if (TextUtils.isEmpty(substring)) {
break;
} else {
Drawable drawable = getResources().getDrawable(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), substring, "drawable"));
drawable.setBounds(0, 0, ak.a(getContext(), 14.0f), ak.a(getContext(), 14.0f));
setCompoundDrawables(drawable, null, null, null);
break;
}
case 7:
setCompoundDrawablePadding(b.a().b(attributeSet.getAttributeValue(i5)));
break;
case 8:
setHorizontalFadingEdgeEnabled(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 9:
setHorizontallyScrolling(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 10:
setTextColor(b.a().a(attributeSet.getAttributeValue(i5)));
break;
case 11:
if (TextUtils.isEmpty(attributeSet.getAttributeValue(i5))) {
break;
} else {
setTextSize(b.a().b(r8));
break;
}
case 12:
String attributeValue5 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue5)) {
break;
} else if (attributeValue5.equals("invisible")) {
setVisibility(4);
break;
} else if (attributeValue5.equalsIgnoreCase("gone")) {
setVisibility(8);
break;
} else {
break;
}
case 13:
String attributeValue6 = attributeSet.getAttributeValue(i5);
if (attributeValue6.startsWith("#")) {
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i5)));
break;
} else {
if (attributeValue6.startsWith("@drawable/")) {
attributeValue6 = attributeValue6.substring(10);
}
setBackgroundResource(getResources().getIdentifier(attributeValue6, "drawable", getContext().getPackageName()));
break;
}
case 14:
if (TtmlNode.BOLD.equalsIgnoreCase(attributeSet.getAttributeValue(i5))) {
setTypeface(Typeface.defaultFromStyle(1));
break;
} else {
break;
}
case 15:
String attributeValue7 = attributeSet.getAttributeValue(i5);
String substring2 = attributeValue7.substring(attributeValue7.indexOf("/") + 1);
setTextAppearance(getContext(), b.a().d("R.style." + substring2));
break;
case 16:
String attributeValue8 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue8)) {
break;
} else {
CharSequence charSequence = (String) com.mbridge.msdk.dycreator.e.b.a.get(attributeValue8.substring(8));
if (TextUtils.isEmpty(charSequence)) {
break;
} else {
setContentDescription(charSequence);
break;
}
}
case 17:
String attributeValue9 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue9)) {
break;
} else {
String str = com.mbridge.msdk.dycreator.e.b.a.get(attributeValue9.substring(8));
if (TextUtils.isEmpty(str)) {
break;
} else {
setTag(str);
break;
}
}
case 18:
setGravity(b.a().c(attributeSet.getAttributeValue(i5)));
break;
case 19:
int b = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(b, b, b, b);
break;
case 20:
i4 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 21:
i3 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 22:
i = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 23:
i2 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 24:
setPadding(b.a().b(attributeSet.getAttributeValue(i5)), i4, i2, i3);
break;
case 25:
setPadding(i, i4, b.a().b(attributeSet.getAttributeValue(i5)), i3);
break;
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtFeedBackView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.text.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.ellipsize.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.singleLine.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.lines.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.drawableLeft.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.drawablePadding.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.fadingEdge.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.scrollHorizontally.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textColor.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textSize.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textStyle.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.style.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.contentDescription.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.tag.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingTop.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingBottom.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingLeft.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingRight.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingStart.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingEnd.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
}
}
public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 26) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 27) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
}
}
}
return layoutParams;
}
@Override // android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,202 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeFramLayout;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.a;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtFrameLayout extends MBridgeFramLayout implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBExtFrameLayout(Context context) {
super(context);
this.c = "";
}
public MBExtFrameLayout(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
a.a(this, attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtFrameLayout", e.getMessage());
}
}
public MBExtFrameLayout(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams generateDefaultLayoutParams = generateDefaultLayoutParams();
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.width = -1;
break;
} else if (attributeValue.startsWith("w")) {
generateDefaultLayoutParams.width = -2;
break;
} else {
generateDefaultLayoutParams.width = b.a().b(attributeValue);
break;
}
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.width = -1;
break;
} else if (attributeValue2.startsWith("w")) {
generateDefaultLayoutParams.width = -2;
break;
} else {
generateDefaultLayoutParams.height = b.a().b(attributeValue2);
break;
}
case 3:
generateDefaultLayoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
break;
case 4:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
generateDefaultLayoutParams.setMargins(b2, b2, b2, b2);
break;
case 5:
generateDefaultLayoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 6:
generateDefaultLayoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 7:
generateDefaultLayoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 8:
generateDefaultLayoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
}
}
}
return generateDefaultLayoutParams;
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtFrameLayout$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
}
}
@Override // com.mbridge.msdk.dycreator.baseview.cusview.MBridgeFramLayout, android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.cusview.MBridgeFramLayout, android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,267 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.cusview.MBRotationView;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtMBRotationView extends MBRotationView implements InterBase {
private Map<String, String> b;
private Map<String, Boolean> c;
private String d;
public MBExtMBRotationView(Context context) {
super(context);
this.d = "";
}
public MBExtMBRotationView(Context context, AttributeSet attributeSet) {
super(context);
this.d = "";
try {
this.b = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.b, this);
} catch (Exception e) {
af.b("MBExtMBRotationView", e.getMessage());
}
}
public MBExtMBRotationView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.d = "";
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
}
} else if (i2 == 2) {
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)));
} 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);
} catch (Exception unused2) {
}
}
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
}
} else if (attributeValue2.startsWith("@color/")) {
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundDrawable(new BitmapDrawable(BitmapFactory.decodeFile(getContext().getFilesDir().toString() + "/" + attributeValue2 + ".png")));
}
} else if (i2 == 3) {
setContentDescription(attributeSet.getAttributeValue(i));
} else if (i2 == 4) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtMBRotationView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.contentDescription.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
}
}
@Override // android.widget.FrameLayout, android.view.ViewGroup
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
layoutParams.width = -2;
layoutParams.height = -2;
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 5:
String attributeValue = attributeSet.getAttributeValue(i);
if (!attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) && !attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
break;
} else {
layoutParams.width = b.a().b(attributeValue);
break;
}
} else {
layoutParams.width = -1;
break;
}
case 6:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (!attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) && !attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
if (attributeValue2.startsWith("w")) {
layoutParams.width = -2;
break;
} else {
layoutParams.height = b.a().b(attributeValue2);
break;
}
} else {
layoutParams.width = -1;
break;
}
break;
case 7:
layoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
break;
case 8:
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 9:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
break;
}
}
}
return layoutParams;
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.c;
if (map != null && map.containsKey("mbridgeAttached") && this.c.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.d);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.c;
if (map != null && map.containsKey("mbridgeDetached") && this.c.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.d);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.b.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.b.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.b.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.b.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.b;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.b.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.c = c.a(str);
if (campaignEx != null) {
this.d = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,453 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.x;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtMBridgeBaitClickView extends MBridgeBaitClickView implements InterBase {
private Map<String, String> a;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
}
public MBExtMBridgeBaitClickView(@NonNull Context context) {
super(context);
}
public MBExtMBridgeBaitClickView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context);
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtMBridgeBaitClickView", e.getMessage());
}
}
public MBExtMBridgeBaitClickView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
}
} else if (i2 == 2) {
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)));
} 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);
} catch (Exception unused2) {
}
}
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
}
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundResource(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), attributeValue2, "drawable"));
}
} else if (i2 == 3) {
int b = b.a().b(attributeSet.getAttributeValue(i));
setPadding(b, b, b, b);
} else if (i2 == 4) {
setGravity(b.a().c(attributeSet.getAttributeValue(i)));
} else if (i2 == 5) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtMBridgeBaitClickView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentBottom.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentTop.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_below.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_above.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toLeftOf.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toRightOf.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_toEndOf.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentRight.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentLeft.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignTop.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignLeft.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignRight.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignBottom.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerInParent.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_alignParentEnd.ordinal()] = 29;
} catch (NoSuchFieldError unused29) {
}
}
}
@Override // android.widget.RelativeLayout, android.view.ViewGroup
public RelativeLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(0, 0);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 6:
String attributeValue = attributeSet.getAttributeValue(i);
if (!attributeValue.startsWith("fill") && !attributeValue.startsWith("match")) {
if (attributeValue.startsWith("w")) {
layoutParams.width = -2;
break;
} else {
layoutParams.width = b.a().b(attributeValue);
break;
}
} else {
layoutParams.width = -1;
break;
}
break;
case 7:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (!attributeValue2.startsWith("fill") && !attributeValue2.startsWith("match")) {
if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
break;
} else {
layoutParams.height = b.a().b(attributeValue2);
break;
}
} else {
layoutParams.height = -1;
break;
}
break;
case 8:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(14, -1);
break;
} else {
break;
}
case 9:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(12, -1);
break;
} else {
break;
}
case 10:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(10, -1);
break;
} else {
break;
}
case 11:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(15, -1);
break;
} else {
break;
}
case 12:
String attributeValue3 = attributeSet.getAttributeValue(i);
if (attributeValue3.startsWith("@+id")) {
layoutParams.addRule(3, attributeValue3.substring(5).hashCode());
break;
} else {
break;
}
case 13:
String attributeValue4 = attributeSet.getAttributeValue(i);
if (attributeValue4.startsWith("@+id")) {
layoutParams.addRule(2, attributeValue4.substring(5).hashCode());
break;
} else {
break;
}
case 14:
String attributeValue5 = attributeSet.getAttributeValue(i);
if (attributeValue5.startsWith("@+id")) {
layoutParams.addRule(0, attributeValue5.substring(5).hashCode());
break;
} else {
break;
}
case 15:
String attributeValue6 = attributeSet.getAttributeValue(i);
if (attributeValue6.startsWith("@+id")) {
layoutParams.addRule(1, attributeValue6.substring(5).hashCode());
break;
} else {
break;
}
case 16:
String attributeValue7 = attributeSet.getAttributeValue(i);
if (attributeValue7.startsWith("@+id")) {
layoutParams.addRule(17, attributeValue7.substring(5).hashCode());
break;
} else {
break;
}
case 17:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
layoutParams.setMargins(b2, b2, b2, b2);
break;
case 18:
layoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 19:
layoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 20:
layoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 21:
layoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 22:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(11, -1);
break;
} else {
break;
}
case 23:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(9, -1);
break;
} else {
break;
}
case 24:
String attributeValue8 = attributeSet.getAttributeValue(i);
if (attributeValue8.startsWith("@+id")) {
layoutParams.addRule(6, attributeValue8.substring(5).hashCode());
break;
} else {
break;
}
case 25:
String attributeValue9 = attributeSet.getAttributeValue(i);
if (attributeValue9.startsWith("@+id")) {
layoutParams.addRule(5, attributeValue9.substring(5).hashCode());
break;
} else {
break;
}
case 26:
String attributeValue10 = attributeSet.getAttributeValue(i);
if (attributeValue10.startsWith("@+id")) {
layoutParams.addRule(7, attributeValue10.substring(5).hashCode());
break;
} else {
break;
}
case 27:
String attributeValue11 = attributeSet.getAttributeValue(i);
if (attributeValue11.startsWith("@+id")) {
layoutParams.addRule(8, attributeValue11.substring(5).hashCode());
break;
} else {
break;
}
case 28:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(13, -1);
break;
} else {
break;
}
case 29:
if (attributeSet.getAttributeBooleanValue(i, false)) {
layoutParams.addRule(21, -1);
break;
} else {
break;
}
}
}
}
return layoutParams;
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
}

View File

@@ -0,0 +1,365 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Color;
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 com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeImageView;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtMBridgeImageView extends MBridgeImageView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
private int d;
private int e;
private int f;
private int g;
public MBExtMBridgeImageView(Context context) {
super(context);
this.c = "";
}
public MBExtMBridgeImageView(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(context, attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtMBridgeImageView", e.getMessage());
}
}
public MBExtMBridgeImageView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.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.g = b;
this.f = b;
this.e = b;
this.d = b;
setPadding(b, b, b, b);
break;
case 9:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
this.e = b2;
setPadding(this.d, b2, this.f, this.g);
break;
case 10:
int b3 = b.a().b(attributeSet.getAttributeValue(i));
this.g = b3;
setPadding(this.d, this.e, this.f, b3);
break;
case 11:
int b4 = b.a().b(attributeSet.getAttributeValue(i));
this.d = b4;
setPadding(b4, this.e, this.f, this.g);
break;
case 12:
int b5 = b.a().b(attributeSet.getAttributeValue(i));
this.f = b5;
setPadding(this.d, this.e, b5, this.g);
break;
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtMBridgeImageView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.src.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.contentDescription.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.tag.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.scaleType.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingTop.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingBottom.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingLeft.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingRight.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.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, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.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;
}
@Override // android.widget.ImageView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.widget.ImageView, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,317 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.GradientDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import com.fyber.inneractive.sdk.external.InneractiveMediationDefs;
import com.mbridge.msdk.dycreator.a.b;
import com.mbridge.msdk.dycreator.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeSegmentsProgressBar;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtMBridgeSegmentsProgressBar extends MBridgeSegmentsProgressBar implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
}
public MBExtMBridgeSegmentsProgressBar(Context context) {
super(context);
this.c = "";
}
public MBExtMBridgeSegmentsProgressBar(Context context, AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
e.printStackTrace();
}
}
public MBExtMBridgeSegmentsProgressBar(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 1) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
}
} else if (i2 == 2) {
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)));
} 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);
} catch (Exception unused2) {
}
}
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i)));
}
} else {
if (attributeValue2.startsWith("@drawable/")) {
attributeValue2 = attributeValue2.substring(10);
}
setBackgroundDrawable(new BitmapDrawable(BitmapFactory.decodeFile(getContext().getFilesDir().toString() + "/" + attributeValue2 + ".png")));
}
} else if (i2 != 3) {
if (i2 == 4) {
String attributeValue3 = attributeSet.getAttributeValue(i);
if (!TextUtils.isEmpty(attributeValue3)) {
if (attributeValue3.equals("invisible")) {
setVisibility(4);
} else if (attributeValue3.equalsIgnoreCase("gone")) {
setVisibility(8);
}
}
} else if (i2 == 5) {
int b = b.a().b(attributeSet.getAttributeValue(i));
setPadding(b, b, b, b);
}
} else if ("horizontal".equalsIgnoreCase(attributeSet.getAttributeValue(i))) {
setOrientation(0);
} else {
setOrientation(1);
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtMBridgeSegmentsProgressBar$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.orientation.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerHorizontal.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_centerVertical.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_weight.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_margin.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginLeft.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginRight.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginTop.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_marginBottom.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_gravity.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
}
}
@Override // android.widget.LinearLayout, android.view.ViewGroup
public LinearLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
LinearLayout.LayoutParams generateDefaultLayoutParams = generateDefaultLayoutParams();
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 6:
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.width = -1;
break;
} else if (attributeValue.startsWith("wrap")) {
generateDefaultLayoutParams.width = -2;
break;
} else {
generateDefaultLayoutParams.width = b.a().b(attributeValue);
break;
}
case 7:
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
generateDefaultLayoutParams.height = -1;
break;
} else if (attributeValue2.startsWith("wrap")) {
generateDefaultLayoutParams.height = -2;
break;
} else {
generateDefaultLayoutParams.height = b.a().b(attributeValue2);
break;
}
break;
case 8:
generateDefaultLayoutParams.gravity = 1;
break;
case 9:
generateDefaultLayoutParams.gravity = 16;
break;
case 10:
generateDefaultLayoutParams.weight = attributeSet.getAttributeFloatValue(i, 0.0f);
break;
case 11:
setGravity(b.a().c(attributeSet.getAttributeValue(i)));
break;
case 12:
int b2 = b.a().b(attributeSet.getAttributeValue(i));
generateDefaultLayoutParams.bottomMargin = b2;
generateDefaultLayoutParams.leftMargin = b2;
generateDefaultLayoutParams.rightMargin = b2;
generateDefaultLayoutParams.topMargin = b2;
break;
case 13:
generateDefaultLayoutParams.leftMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 14:
generateDefaultLayoutParams.rightMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 15:
generateDefaultLayoutParams.topMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 16:
generateDefaultLayoutParams.bottomMargin = b.a().b(attributeSet.getAttributeValue(i));
break;
case 17:
generateDefaultLayoutParams.gravity = b.a().c(attributeSet.getAttributeValue(i));
break;
}
}
}
return generateDefaultLayoutParams;
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
}

View File

@@ -0,0 +1,476 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.ViewGroup;
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.baseview.GradientOrientationUtils;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeTextView;
import com.mbridge.msdk.dycreator.baseview.inter.InterBase;
import com.mbridge.msdk.dycreator.e.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.same.report.k;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes4.dex */
public class MBExtMBridgeTextView extends MBridgeTextView implements InterBase {
private Map<String, String> a;
private Map<String, Boolean> b;
private String c;
public MBExtMBridgeTextView(Context context) {
super(context);
this.c = "";
}
public MBExtMBridgeTextView(Context context, @Nullable AttributeSet attributeSet) {
super(context);
this.c = "";
try {
this.a = c.a(context, attributeSet);
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(attributeSet));
c.a(this.a, this);
} catch (Exception e) {
af.b("MBExtMBridgeTextView", e.getMessage());
}
}
public MBExtMBridgeTextView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.c = "";
}
public void setAttributeSet(AttributeSet attributeSet) {
String[] strArr;
HashMap<String, com.mbridge.msdk.dycreator.a.c> c = b.a().c();
int attributeCount = attributeSet.getAttributeCount();
int i = 0;
int i2 = 0;
int i3 = 0;
int i4 = 0;
for (int i5 = 0; i5 < attributeCount; i5++) {
com.mbridge.msdk.dycreator.a.c cVar = c.get(attributeSet.getAttributeName(i5));
if (cVar != null) {
cVar.toString();
switch (AnonymousClass1.a[cVar.ordinal()]) {
case 1:
String attributeValue = attributeSet.getAttributeValue(i5);
if (attributeValue.startsWith("@+id/")) {
setId(attributeValue.substring(5).hashCode());
break;
} else {
break;
}
case 2:
String attributeValue2 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue2)) {
break;
} else if (attributeValue2.startsWith("@string/")) {
setText(b.a().e(attributeSet.getAttributeValue(i5)));
break;
} else {
setText(attributeValue2);
break;
}
case 3:
String attributeValue3 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue3)) {
break;
} else {
if (attributeValue3.equals(TtmlNode.END)) {
setEllipsize(TextUtils.TruncateAt.END);
}
if (attributeValue3.equals("start")) {
setEllipsize(TextUtils.TruncateAt.START);
}
if (attributeValue3.equals("middle")) {
setEllipsize(TextUtils.TruncateAt.MIDDLE);
}
if (attributeValue3.equals("marquee")) {
setEllipsize(TextUtils.TruncateAt.MARQUEE);
break;
} else {
break;
}
}
case 4:
setSingleLine(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 5:
setLines(attributeSet.getAttributeIntValue(i5, 1));
break;
case 6:
String attributeValue4 = attributeSet.getAttributeValue(i5);
String substring = attributeValue4.startsWith("@drawable/") ? attributeValue4.substring(10) : "";
if (TextUtils.isEmpty(substring)) {
break;
} else {
Drawable drawable = getResources().getDrawable(x.a(com.mbridge.msdk.foundation.controller.c.m().c(), substring, "drawable"));
drawable.setBounds(0, 0, ak.a(getContext(), 14.0f), ak.a(getContext(), 14.0f));
setCompoundDrawables(drawable, null, null, null);
break;
}
case 7:
setCompoundDrawablePadding(b.a().b(attributeSet.getAttributeValue(i5)));
break;
case 8:
setHorizontalFadingEdgeEnabled(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 9:
setHorizontallyScrolling(attributeSet.getAttributeBooleanValue(i5, false));
break;
case 10:
setTextColor(b.a().a(attributeSet.getAttributeValue(i5)));
break;
case 11:
if (TextUtils.isEmpty(attributeSet.getAttributeValue(i5))) {
break;
} else {
setTextSize(b.a().b(r10));
break;
}
case 12:
String attributeValue5 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue5)) {
break;
} else if (attributeValue5.equals("invisible")) {
setVisibility(4);
break;
} else if (attributeValue5.equalsIgnoreCase("gone")) {
setVisibility(8);
break;
} else {
break;
}
case 13:
String attributeValue6 = attributeSet.getAttributeValue(i5);
if (attributeValue6.startsWith("#")) {
try {
strArr = attributeValue6.split("-");
} catch (Exception unused) {
strArr = null;
}
if (strArr != null && strArr.length <= 2) {
setBackgroundColor(b.a().a(attributeSet.getAttributeValue(i5)));
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(i5)));
break;
}
} else {
if (attributeValue6.startsWith("@drawable/")) {
attributeValue6 = attributeValue6.substring(10);
}
setBackgroundResource(getResources().getIdentifier(attributeValue6, "drawable", getContext().getPackageName()));
break;
}
break;
case 14:
if (TtmlNode.BOLD.equalsIgnoreCase(attributeSet.getAttributeValue(i5))) {
setTypeface(Typeface.defaultFromStyle(1));
break;
} else {
break;
}
case 15:
String attributeValue7 = attributeSet.getAttributeValue(i5);
String substring2 = attributeValue7.substring(attributeValue7.indexOf("/") + 1);
setTextAppearance(getContext(), b.a().d("R.style." + substring2));
break;
case 16:
String attributeValue8 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue8)) {
break;
} else {
CharSequence charSequence = (String) com.mbridge.msdk.dycreator.e.b.a.get(attributeValue8.substring(8));
if (TextUtils.isEmpty(charSequence)) {
break;
} else {
setContentDescription(charSequence);
break;
}
}
case 17:
String attributeValue9 = attributeSet.getAttributeValue(i5);
if (TextUtils.isEmpty(attributeValue9)) {
break;
} else {
String str = com.mbridge.msdk.dycreator.e.b.a.get(attributeValue9.substring(8));
if (TextUtils.isEmpty(str)) {
break;
} else {
setTag(str);
break;
}
}
case 18:
setGravity(b.a().c(attributeSet.getAttributeValue(i5)));
break;
case 19:
int b = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(b, b, b, b);
break;
case 20:
i4 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 21:
i3 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 22:
i = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 23:
i2 = b.a().b(attributeSet.getAttributeValue(i5));
setPadding(i, i4, i2, i3);
break;
case 24:
setPadding(b.a().b(attributeSet.getAttributeValue(i5)), i4, i2, i3);
break;
case 25:
setPadding(i, i4, b.a().b(attributeSet.getAttributeValue(i5)), i3);
break;
case 26:
setFilters(new InputFilter[]{new InputFilter.LengthFilter(b.a().b(attributeSet.getAttributeValue(i5)))});
break;
}
}
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.extview.MBExtMBridgeTextView$1, reason: invalid class name */
public static /* synthetic */ class AnonymousClass1 {
static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.mbridge.msdk.dycreator.a.c.values().length];
a = iArr;
try {
iArr[com.mbridge.msdk.dycreator.a.c.id.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.text.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.ellipsize.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.singleLine.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.lines.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.drawableLeft.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.drawablePadding.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.fadingEdge.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.scrollHorizontally.ordinal()] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textColor.ordinal()] = 10;
} catch (NoSuchFieldError unused10) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textSize.ordinal()] = 11;
} catch (NoSuchFieldError unused11) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.visibility.ordinal()] = 12;
} catch (NoSuchFieldError unused12) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.background.ordinal()] = 13;
} catch (NoSuchFieldError unused13) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.textStyle.ordinal()] = 14;
} catch (NoSuchFieldError unused14) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.style.ordinal()] = 15;
} catch (NoSuchFieldError unused15) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.contentDescription.ordinal()] = 16;
} catch (NoSuchFieldError unused16) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.tag.ordinal()] = 17;
} catch (NoSuchFieldError unused17) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.gravity.ordinal()] = 18;
} catch (NoSuchFieldError unused18) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.padding.ordinal()] = 19;
} catch (NoSuchFieldError unused19) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingTop.ordinal()] = 20;
} catch (NoSuchFieldError unused20) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingBottom.ordinal()] = 21;
} catch (NoSuchFieldError unused21) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingLeft.ordinal()] = 22;
} catch (NoSuchFieldError unused22) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingRight.ordinal()] = 23;
} catch (NoSuchFieldError unused23) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingStart.ordinal()] = 24;
} catch (NoSuchFieldError unused24) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.paddingEnd.ordinal()] = 25;
} catch (NoSuchFieldError unused25) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.maxLength.ordinal()] = 26;
} catch (NoSuchFieldError unused26) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_width.ordinal()] = 27;
} catch (NoSuchFieldError unused27) {
}
try {
a[com.mbridge.msdk.dycreator.a.c.layout_height.ordinal()] = 28;
} catch (NoSuchFieldError unused28) {
}
}
}
public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
HashMap b = b.a().b();
int attributeCount = attributeSet.getAttributeCount();
for (int i = 0; i < attributeCount; i++) {
com.mbridge.msdk.dycreator.a.c cVar = (com.mbridge.msdk.dycreator.a.c) b.get(attributeSet.getAttributeName(i));
if (cVar != null) {
int i2 = AnonymousClass1.a[cVar.ordinal()];
if (i2 == 27) {
String attributeValue = attributeSet.getAttributeValue(i);
if (attributeValue.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.width = -1;
} else if (attributeValue.startsWith("wrap")) {
layoutParams.width = -2;
} else {
layoutParams.width = b.a().b(attributeValue);
}
} else if (i2 == 28) {
String attributeValue2 = attributeSet.getAttributeValue(i);
if (attributeValue2.startsWith(InneractiveMediationDefs.GENDER_FEMALE) || attributeValue2.startsWith(InneractiveMediationDefs.GENDER_MALE)) {
layoutParams.height = -1;
} else if (attributeValue2.startsWith("wrap")) {
layoutParams.height = -2;
} else {
layoutParams.height = b.a().b(attributeValue2);
}
}
}
}
return layoutParams;
}
@Override // com.mbridge.msdk.dycreator.baseview.cusview.MBridgeTextView, android.widget.TextView, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeAttached") && this.b.get("mbridgeAttached").booleanValue()) {
new k.a("mbridgeAttached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.cusview.MBridgeTextView, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Map<String, Boolean> map = this.b;
if (map != null && map.containsKey("mbridgeDetached") && this.b.get("mbridgeDetached").booleanValue()) {
new k.a("mbridgeDetached").a().a(this.c);
}
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getBindDataDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeData")) ? "" : this.a.get("mbridgeData");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getActionDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeAction")) ? "" : this.a.get("mbridgeAction");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getStrategyDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeStrategy")) ? "" : this.a.get("mbridgeStrategy");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getEffectDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeEffect")) ? "" : this.a.get("mbridgeEffect");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public String getReportDes() {
Map<String, String> map = this.a;
return (map == null || !map.containsKey("mbridgeReport")) ? "" : this.a.get("mbridgeReport");
}
@Override // com.mbridge.msdk.dycreator.baseview.inter.InterBase
public void setDynamicReport(String str, CampaignEx campaignEx) {
this.b = c.a(str);
if (campaignEx != null) {
this.c = campaignEx.getCampaignUnitId();
}
}
}

View File

@@ -0,0 +1,297 @@
package com.mbridge.msdk.dycreator.baseview.extview;
import android.content.Context;
import android.graphics.Color;
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 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.dycreator.baseview.cusview.SoundImageView;
import com.mbridge.msdk.foundation.tools.af;
import java.util.HashMap;
/* loaded from: classes4.dex */
public class MBExtSoundImageView extends SoundImageView {
private int a;
private int b;
private int c;
private int d;
public MBExtSoundImageView(Context context) {
super(context);
}
public MBExtSoundImageView(Context context, AttributeSet attributeSet) {
super(context);
try {
setAttributeSet(attributeSet);
setLayoutParams(generateLayoutParams(context, attributeSet));
} catch (Exception e) {
af.b("MBExtSoundImageView", e.getMessage());
}
}
public MBExtSoundImageView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
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.extview.MBExtSoundImageView$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,18 @@
package com.mbridge.msdk.dycreator.baseview.inter;
import com.mbridge.msdk.foundation.entity.CampaignEx;
/* loaded from: classes4.dex */
public interface InterBase {
String getActionDes();
String getBindDataDes();
String getEffectDes();
String getReportDes();
String getStrategyDes();
void setDynamicReport(String str, CampaignEx campaignEx);
}

View File

@@ -0,0 +1,8 @@
package com.mbridge.msdk.dycreator.baseview.inter;
import android.animation.Animator;
/* loaded from: classes4.dex */
public interface InterEffect {
void setAnimator(Animator animator);
}

View File

@@ -0,0 +1,10 @@
package com.mbridge.msdk.dycreator.baseview.rewardpopview;
/* loaded from: classes4.dex */
public interface AcquireRewardPopViewBehaviourListener {
void onOutOfContentClicked(float f, float f2);
void onReceivedFail(String str);
void onReceivedSuccess(int i);
}

View File

@@ -0,0 +1,70 @@
package com.mbridge.msdk.dycreator.baseview.rewardpopview;
/* loaded from: classes4.dex */
public class AcquireRewardPopViewConst {
public static final int DEFAULT_COLOR_00B09A80 = 11573888;
public static final int DEFAULT_COLOR_00F3A850 = 15968336;
public static final int DEFAULT_COLOR_00FDB258 = 16626264;
public static final int DEFAULT_COLOR_33EF7601 = 871331329;
public static final int DEFAULT_COLOR_3B3127 = -12898009;
public static final int DEFAULT_COLOR_50000000 = -939524096;
public static final int DEFAULT_COLOR_89664C = -7772596;
public static final int DEFAULT_COLOR_8B6B45 = -7640251;
public static final int DEFAULT_COLOR_D26700 = -2988288;
public static final int DEFAULT_COLOR_E56F19 = -1741031;
public static final int DEFAULT_COLOR_EC7501 = -1280767;
public static final int DEFAULT_COLOR_FF8B00 = -29952;
public static final int DEFAULT_COLOR_FF932B = -27861;
public static final int DEFAULT_COLOR_FFB09A80 = -5203328;
public static final int DEFAULT_COLOR_FFBD6F = -17041;
public static final int DEFAULT_COLOR_FFC27A = -15750;
public static final int DEFAULT_COLOR_FFE0B5 = -8011;
public static final int DEFAULT_COLOR_FFE39E4A = -1860022;
public static final int DEFAULT_COLOR_FFFBE2 = -1054;
public static final int DEFAULT_COLOR_FFFBED = -1043;
public static final String DEFAULT_FAIL_TIP_TEXT_CN = "下次再接再厉";
public static final String DEFAULT_FAIL_TIP_TEXT_EN = "Try again next time";
public static final String DEFAULT_FAIL_TIP_TEXT_JP = "今度また挑戦してみてください";
public static final String DEFAULT_FAIL_TIP_TEXT_KR = "다음에 다시 도전해보세요";
public static final String DEFAULT_FAIL_TITLE_TEXT_CN = "回答错误!";
public static final String DEFAULT_FAIL_TITLE_TEXT_EN = "Wrong answer!";
public static final String DEFAULT_FAIL_TITLE_TEXT_JP = "間違えました!";
public static final String DEFAULT_FAIL_TITLE_TEXT_KR = "틀렸습니다!";
public static final String DEFAULT_QUESTION_TIP_TEXT_CN = "答对问题即可提前%1$s秒跳过视频播放并获得奖励";
public static final String DEFAULT_QUESTION_TIP_TEXT_EN = "Answer the question correctly to skip the video %1$ss early and get reward.";
public static final String DEFAULT_QUESTION_TIP_TEXT_JP = "質問に正しく答えますとビデオを%1$s秒早めにスキップできます。";
public static final String DEFAULT_QUESTION_TIP_TEXT_KR = "정답을 올리면 비디오를 %1$s초 일찍 건너뛸 수 있습니다.";
public static final String DEFAULT_QUESTION_TITLE_TEXT_CN = "现在播放的是以下何广告?";
public static final String DEFAULT_QUESTION_TITLE_TEXT_EN = "Which of the following ads is currently playing?";
public static final String DEFAULT_QUESTION_TITLE_TEXT_JP = "現在流れている広告はどれですか?";
public static final String DEFAULT_QUESTION_TITLE_TEXT_KR = "지금 재생 중인 광고는 어느것입니까?";
public static final String[] DEFAULT_RANDOM_ANSWERS_CN = {"花店", "星星", "动物园", "长颈鹿", "无尾熊", "夹心饼干", "薯片", "企鹅", "停车场", "零食大礼包"};
public static final String[] DEFAULT_RANDOM_ANSWERS_EN = {"Flower Shop", "Star", "Zoo", "Giraffe", "Koala", "Sandwich Cookies", "Potato Chips", "Penguin", "parking lot", "Snack Bundle"};
public static final String[] DEFAULT_RANDOM_ANSWERS_JP = {"フローリスト", "", "動物園", "ジラフ", "ノーテール・ベア", "サンドウィッチクッキー", "ポテトチップス", "ペンギン", "駐車場", "スナックパック"};
public static final String[] DEFAULT_RANDOM_ANSWERS_KR = {"꽃 가게", "", "동물원", "기린", "코알라", "샌드위치 쿠키", "감자 칩", "펭귄", "주차장", "스낵 번들"};
public static final String DEFAULT_REASON_AUTO_DISMISS = "Auto dismissed";
public static final String DEFAULT_REASON_CLICK_CLOSE = "Close view clicked";
public static final String DEFAULT_REASON_CLICK_WRONG_ANSWER = "Clicked wrong answer";
public static final String DEFAULT_SLIDE_SUCCESS_TEXT_CN = "完成滑动!";
public static final String DEFAULT_SLIDE_SUCCESS_TEXT_EN = "Finish scrolling!";
public static final String DEFAULT_SLIDE_SUCCESS_TEXT_JP = "スクロールㅈ完了!";
public static final String DEFAULT_SLIDE_SUCCESS_TEXT_KR = "스크롤 완성!";
public static final String DEFAULT_SLIDE_TIP_TEXT_CN = "完成滑动即可提前%1$s秒跳过视频播放";
public static final String DEFAULT_SLIDE_TIP_TEXT_EN = "Scroll the video to skip the video %1$ss early.";
public static final String DEFAULT_SLIDE_TIP_TEXT_JP = "スクロールしますとビデオを%1$s秒早めにスキップできます。";
public static final String DEFAULT_SLIDE_TIP_TEXT_KR = "스크롤하시면 비디오를 %1$s초 일찍 건너뛸 수 있습니다.";
public static final String DEFAULT_SLIDE_TITLE_TEXT_CN = "滑动视频 获得奖励";
public static final String DEFAULT_SLIDE_TITLE_TEXT_EN = "Scroll the video to get reward";
public static final String DEFAULT_SLIDE_TITLE_TEXT_JP = "動画をスクロールしてリワードを獲得しましょう";
public static final String DEFAULT_SLIDE_TITLE_TEXT_KR = "비디오를 스크롤해서 보상을 받으세요";
public static final String DEFAULT_SUCCESS_TIP_TEXT_CN = "恭喜您可提前%1$s秒跳过视频并获得奖励";
public static final String DEFAULT_SUCCESS_TIP_TEXT_EN = "Congrats!You can skip the video %1$ss earlier and get the reward";
public static final String DEFAULT_SUCCESS_TIP_TEXT_JP = "おめでとう!ビデオ%1$s秒を早くスキップしてリワードを得ることができます。";
public static final String DEFAULT_SUCCESS_TIP_TEXT_KR = "축하합니다! 비디오 %1$s초를 일찍 건너뛰고 보상을 받을 수 있습니다.";
public static final String DEFAULT_SUCCESS_TITLE_TEXT_CN = "回答正确!";
public static final String DEFAULT_SUCCESS_TITLE_TEXT_EN = "Correct!";
public static final String DEFAULT_SUCCESS_TITLE_TEXT_JP = "正解です!";
public static final String DEFAULT_SUCCESS_TITLE_TEXT_KR = "정답입니다!";
public static final int TYPE_POP_QUESTION = 1;
public static final int TYPE_POP_SLIDE = 2;
}

View File

@@ -0,0 +1,302 @@
package com.mbridge.msdk.dycreator.baseview.rewardpopview;
import android.text.TextUtils;
import com.mbridge.msdk.foundation.tools.af;
import java.util.ArrayList;
import java.util.List;
/* loaded from: classes4.dex */
public class AcquireRewardPopViewParameters {
public AcquireRewardPopViewBehaviourListener behaviourListener;
public String failTip;
public String failTitle;
public String language;
public String placementId;
public List<String> rightAnswerList;
public String slideSuccessTitle;
public String slideTip;
public String slideTitle;
public String successTip;
public String successTitle;
public String tips;
public String title;
public String unitId;
public int viewType;
public List<String> wrongAnswerList;
public int autoDismissTime = 5;
public int reduceTime = 0;
public boolean canClickMaskArea = true;
public int viewBackLayerTopColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FFC27A;
public int viewBackLayerBottomColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FF932B;
public int viewForegroundTopColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBE2;
public int viewForegroundBottomColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FFE0B5;
public int buttonBackgroundLightColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FF8B00;
public int buttonBackgroundDarkColor = AcquireRewardPopViewConst.DEFAULT_COLOR_33EF7601;
public int titleTextColor = AcquireRewardPopViewConst.DEFAULT_COLOR_E56F19;
public int tipTextColor = AcquireRewardPopViewConst.DEFAULT_COLOR_89664C;
public int buttonTextLightColor = -1;
public int buttonTextDarkColor = AcquireRewardPopViewConst.DEFAULT_COLOR_D26700;
public int successTipTextColor = -1;
public int failTipTextColor = -1;
public int containerBackgroundColor = AcquireRewardPopViewConst.DEFAULT_COLOR_50000000;
public int successTitleGradientStartColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
public int successTitleGradientEndColor = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
public int successTitleShadowColor = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
public int successTitleTextSize = 40;
public float successTitleShadowRadius = 3.0f;
public float successTitleShadowDx = 1.5f;
public float successTitleShadowDy = 1.8f;
public int failTitleGradientStartColor = -1;
public int failTitleGradientEndColor = AcquireRewardPopViewConst.DEFAULT_COLOR_8B6B45;
public int failTitleShadowColor = AcquireRewardPopViewConst.DEFAULT_COLOR_3B3127;
public int failTitleTextSize = 40;
public float failTitleShadowRadius = 3.0f;
public float failTitleShadowDx = 1.5f;
public float failTitleShadowDy = 1.8f;
public static Builder builder(String str, String str2, int i, String str3) {
if (TextUtils.isEmpty(str2)) {
af.b("AcquireRewardPopViewParameters", "Unit id must not null.");
return null;
}
if (i == 0) {
i = 1;
}
if (TextUtils.isEmpty(str3)) {
str3 = "EN";
}
return new Builder(str, str2, i, str3);
}
public static class Builder {
private AcquireRewardPopViewParameters a;
public AcquireRewardPopViewParameters build() {
return this.a;
}
/* JADX WARN: Removed duplicated region for block: B:11:0x007f */
/* JADX WARN: Removed duplicated region for block: B:8:0x004f */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public Builder(java.lang.String r3, java.lang.String r4, int r5, java.lang.String r6) {
/*
Method dump skipped, instructions count: 286
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.dycreator.baseview.rewardpopview.AcquireRewardPopViewParameters.Builder.<init>(java.lang.String, java.lang.String, int, java.lang.String):void");
}
public Builder setAutoDismissTime(int i) {
this.a.autoDismissTime = i;
return this;
}
public Builder setReduceTime(int i) {
this.a.reduceTime = i;
return this;
}
public Builder setCanClickMaskArea(boolean z) {
this.a.canClickMaskArea = z;
return this;
}
public Builder setTitle(String str) {
this.a.title = str;
return this;
}
public Builder setTips(String str) {
this.a.tips = str;
return this;
}
public Builder setSuccessTitle(String str) {
this.a.successTitle = str;
return this;
}
public Builder setSuccessTip(String str) {
this.a.successTip = str;
return this;
}
public Builder setFailTitle(String str) {
this.a.failTitle = str;
return this;
}
public Builder setFailTip(String str) {
this.a.failTip = str;
return this;
}
public Builder setSlideTitle(String str) {
this.a.slideTitle = str;
return this;
}
public Builder setSlideTip(String str) {
this.a.slideTip = str;
return this;
}
public Builder setSlideSuccessTitle(String str) {
this.a.slideSuccessTitle = str;
return this;
}
public Builder setRightAnswerList(ArrayList<String> arrayList) {
this.a.rightAnswerList = arrayList;
return this;
}
public Builder setWrongAnswerList(ArrayList<String> arrayList) {
this.a.wrongAnswerList = arrayList;
return this;
}
public Builder setViewBackLayerTopColor(int i) {
this.a.viewBackLayerTopColor = i;
return this;
}
public Builder setViewBackLayerBottomColor(int i) {
this.a.viewBackLayerBottomColor = i;
return this;
}
public Builder setViewForegroundTopColor(int i) {
this.a.viewForegroundTopColor = i;
return this;
}
public Builder setViewForegroundBottomColor(int i) {
this.a.viewForegroundBottomColor = i;
return this;
}
public Builder setButtonBackgroundLightColor(int i) {
this.a.buttonBackgroundLightColor = i;
return this;
}
public Builder setButtonBackgroundDarkColor(int i) {
this.a.buttonBackgroundDarkColor = i;
return this;
}
public Builder setTitleTextColor(int i) {
this.a.titleTextColor = i;
return this;
}
public Builder setTipTextColor(int i) {
this.a.tipTextColor = i;
return this;
}
public Builder setButtonTextLightColor(int i) {
this.a.buttonTextLightColor = i;
return this;
}
public Builder setButtonTextDarkColor(int i) {
this.a.buttonTextDarkColor = i;
return this;
}
public Builder setSuccessTipTextColor(int i) {
this.a.successTipTextColor = i;
return this;
}
public Builder setFailTipTextColor(int i) {
this.a.failTipTextColor = i;
return this;
}
public Builder setContainerBackgroundColor(int i) {
this.a.containerBackgroundColor = i;
return this;
}
public Builder setSuccessTitleGradientStartColor(int i) {
this.a.successTitleGradientStartColor = i;
return this;
}
public Builder setSuccessTitleGradientEndColor(int i) {
this.a.successTitleGradientEndColor = i;
return this;
}
public Builder setSuccessTitleShadowColor(int i) {
this.a.successTitleShadowColor = i;
return this;
}
public Builder setSuccessTitleTextSize(int i) {
this.a.successTitleTextSize = i;
return this;
}
public Builder setSuccessTitleShadowRadius(float f) {
this.a.successTitleShadowRadius = f;
return this;
}
public Builder setSuccessTitleShadowDx(float f) {
this.a.successTitleShadowDx = f;
return this;
}
public Builder setSuccessTitleShadowDy(float f) {
this.a.successTitleShadowDy = f;
return this;
}
public Builder setFailTitleGradientStartColor(int i) {
this.a.failTitleGradientStartColor = i;
return this;
}
public Builder setFailTitleGradientEndColor(int i) {
this.a.failTitleGradientEndColor = i;
return this;
}
public Builder setFailTitleShadowColor(int i) {
this.a.failTitleShadowColor = i;
return this;
}
public Builder setFailTitleTextSize(int i) {
this.a.failTitleTextSize = i;
return this;
}
public Builder setFailTitleShadowRadius(float f) {
this.a.failTitleShadowRadius = f;
return this;
}
public Builder setFailTitleShadowDx(float f) {
this.a.failTitleShadowDx = f;
return this;
}
public Builder setFailTitleShadowDy(float f) {
this.a.failTitleShadowDy = f;
return this;
}
public Builder setBehaviourListener(AcquireRewardPopViewBehaviourListener acquireRewardPopViewBehaviourListener) {
this.a.behaviourListener = acquireRewardPopViewBehaviourListener;
return this;
}
}
}

View File

@@ -0,0 +1,970 @@
package com.mbridge.msdk.dycreator.baseview.rewardpopview;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.LayerDrawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.core.view.GravityCompat;
import com.mbridge.msdk.dycreator.baseview.rewardpopview.MBGradientAndShadowTextView;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/* loaded from: classes4.dex */
public class MBAcquireRewardPopView extends RelativeLayout {
private final String a;
private AcquireRewardPopViewParameters b;
private AnimationSet c;
private float d;
private float e;
private float f;
private float g;
private int h;
private boolean i;
private boolean j;
private TextView k;
private final View.OnClickListener l;
private Runnable m;
private Runnable n;
private View.OnTouchListener o;
private final View.OnClickListener p;
private final View.OnClickListener q;
public static /* synthetic */ int i(MBAcquireRewardPopView mBAcquireRewardPopView) {
int i = mBAcquireRewardPopView.h;
mBAcquireRewardPopView.h = i - 1;
return i;
}
public MBAcquireRewardPopView(Context context) {
super(context);
this.a = "MBAcquireRewardPopView";
this.d = 0.0f;
this.e = 0.0f;
this.f = 0.0f;
this.g = 0.0f;
this.l = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.5
@Override // android.view.View.OnClickListener
public void onClick(View view) {
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
String str = (String) view.getTag();
if (TextUtils.isEmpty(str)) {
return;
}
boolean contains = MBAcquireRewardPopView.this.b.rightAnswerList.contains(str);
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
View e = contains ? MBAcquireRewardPopView.e(mBAcquireRewardPopView2) : MBAcquireRewardPopView.f(mBAcquireRewardPopView2);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
if (contains) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
} else {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_WRONG_ANSWER);
}
}
MBAcquireRewardPopView mBAcquireRewardPopView3 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView3.postDelayed(mBAcquireRewardPopView3.n, 2000L);
}
};
this.m = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.6
@Override // java.lang.Runnable
public void run() {
if (MBAcquireRewardPopView.this.h <= 0) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_AUTO_DISMISS);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
return;
}
MBAcquireRewardPopView.i(MBAcquireRewardPopView.this);
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.postDelayed(mBAcquireRewardPopView.m, 1000L);
}
};
this.n = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7
@Override // java.lang.Runnable
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7.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) {
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
});
MBAcquireRewardPopView.this.startAnimation(alphaAnimation);
}
};
this.o = new View.OnTouchListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.8
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action == 0) {
MBAcquireRewardPopView.this.d = motionEvent.getX();
MBAcquireRewardPopView.this.e = motionEvent.getY();
} else if (action != 1) {
if (action == 2) {
MBAcquireRewardPopView.this.f = motionEvent.getX();
MBAcquireRewardPopView.this.g = motionEvent.getY();
}
} else if (MBAcquireRewardPopView.this.f <= MBAcquireRewardPopView.this.d) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else if (Math.abs(MBAcquireRewardPopView.this.f - MBAcquireRewardPopView.this.d) <= 50.0f || Math.abs(MBAcquireRewardPopView.this.g - MBAcquireRewardPopView.this.e) >= 100.0f) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else {
if (MBAcquireRewardPopView.this.j) {
return false;
}
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
MBAcquireRewardPopView.this.j = true;
View e = MBAcquireRewardPopView.e(MBAcquireRewardPopView.this);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
}
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView2.postDelayed(mBAcquireRewardPopView2.n, 2000L);
}
return false;
}
};
this.p = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.9
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
}
}
};
this.q = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.10
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_CLOSE);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
};
}
public MBAcquireRewardPopView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.a = "MBAcquireRewardPopView";
this.d = 0.0f;
this.e = 0.0f;
this.f = 0.0f;
this.g = 0.0f;
this.l = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.5
@Override // android.view.View.OnClickListener
public void onClick(View view) {
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
String str = (String) view.getTag();
if (TextUtils.isEmpty(str)) {
return;
}
boolean contains = MBAcquireRewardPopView.this.b.rightAnswerList.contains(str);
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
View e = contains ? MBAcquireRewardPopView.e(mBAcquireRewardPopView2) : MBAcquireRewardPopView.f(mBAcquireRewardPopView2);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
if (contains) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
} else {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_WRONG_ANSWER);
}
}
MBAcquireRewardPopView mBAcquireRewardPopView3 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView3.postDelayed(mBAcquireRewardPopView3.n, 2000L);
}
};
this.m = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.6
@Override // java.lang.Runnable
public void run() {
if (MBAcquireRewardPopView.this.h <= 0) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_AUTO_DISMISS);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
return;
}
MBAcquireRewardPopView.i(MBAcquireRewardPopView.this);
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.postDelayed(mBAcquireRewardPopView.m, 1000L);
}
};
this.n = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7
@Override // java.lang.Runnable
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7.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) {
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
});
MBAcquireRewardPopView.this.startAnimation(alphaAnimation);
}
};
this.o = new View.OnTouchListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.8
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action == 0) {
MBAcquireRewardPopView.this.d = motionEvent.getX();
MBAcquireRewardPopView.this.e = motionEvent.getY();
} else if (action != 1) {
if (action == 2) {
MBAcquireRewardPopView.this.f = motionEvent.getX();
MBAcquireRewardPopView.this.g = motionEvent.getY();
}
} else if (MBAcquireRewardPopView.this.f <= MBAcquireRewardPopView.this.d) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else if (Math.abs(MBAcquireRewardPopView.this.f - MBAcquireRewardPopView.this.d) <= 50.0f || Math.abs(MBAcquireRewardPopView.this.g - MBAcquireRewardPopView.this.e) >= 100.0f) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else {
if (MBAcquireRewardPopView.this.j) {
return false;
}
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
MBAcquireRewardPopView.this.j = true;
View e = MBAcquireRewardPopView.e(MBAcquireRewardPopView.this);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
}
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView2.postDelayed(mBAcquireRewardPopView2.n, 2000L);
}
return false;
}
};
this.p = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.9
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
}
}
};
this.q = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.10
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_CLOSE);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
};
}
public MBAcquireRewardPopView(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = "MBAcquireRewardPopView";
this.d = 0.0f;
this.e = 0.0f;
this.f = 0.0f;
this.g = 0.0f;
this.l = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.5
@Override // android.view.View.OnClickListener
public void onClick(View view) {
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
String str = (String) view.getTag();
if (TextUtils.isEmpty(str)) {
return;
}
boolean contains = MBAcquireRewardPopView.this.b.rightAnswerList.contains(str);
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
View e = contains ? MBAcquireRewardPopView.e(mBAcquireRewardPopView2) : MBAcquireRewardPopView.f(mBAcquireRewardPopView2);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
if (contains) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
} else {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_WRONG_ANSWER);
}
}
MBAcquireRewardPopView mBAcquireRewardPopView3 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView3.postDelayed(mBAcquireRewardPopView3.n, 2000L);
}
};
this.m = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.6
@Override // java.lang.Runnable
public void run() {
if (MBAcquireRewardPopView.this.h <= 0) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_AUTO_DISMISS);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
return;
}
MBAcquireRewardPopView.i(MBAcquireRewardPopView.this);
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.postDelayed(mBAcquireRewardPopView.m, 1000L);
}
};
this.n = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7
@Override // java.lang.Runnable
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7.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) {
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
});
MBAcquireRewardPopView.this.startAnimation(alphaAnimation);
}
};
this.o = new View.OnTouchListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.8
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action == 0) {
MBAcquireRewardPopView.this.d = motionEvent.getX();
MBAcquireRewardPopView.this.e = motionEvent.getY();
} else if (action != 1) {
if (action == 2) {
MBAcquireRewardPopView.this.f = motionEvent.getX();
MBAcquireRewardPopView.this.g = motionEvent.getY();
}
} else if (MBAcquireRewardPopView.this.f <= MBAcquireRewardPopView.this.d) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else if (Math.abs(MBAcquireRewardPopView.this.f - MBAcquireRewardPopView.this.d) <= 50.0f || Math.abs(MBAcquireRewardPopView.this.g - MBAcquireRewardPopView.this.e) >= 100.0f) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else {
if (MBAcquireRewardPopView.this.j) {
return false;
}
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
MBAcquireRewardPopView.this.j = true;
View e = MBAcquireRewardPopView.e(MBAcquireRewardPopView.this);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
}
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView2.postDelayed(mBAcquireRewardPopView2.n, 2000L);
}
return false;
}
};
this.p = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.9
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
}
}
};
this.q = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.10
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_CLOSE);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
};
}
@RequiresApi(api = 21)
public MBAcquireRewardPopView(Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.a = "MBAcquireRewardPopView";
this.d = 0.0f;
this.e = 0.0f;
this.f = 0.0f;
this.g = 0.0f;
this.l = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.5
@Override // android.view.View.OnClickListener
public void onClick(View view) {
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
String str = (String) view.getTag();
if (TextUtils.isEmpty(str)) {
return;
}
boolean contains = MBAcquireRewardPopView.this.b.rightAnswerList.contains(str);
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
View e = contains ? MBAcquireRewardPopView.e(mBAcquireRewardPopView2) : MBAcquireRewardPopView.f(mBAcquireRewardPopView2);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
if (contains) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
} else {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_WRONG_ANSWER);
}
}
MBAcquireRewardPopView mBAcquireRewardPopView3 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView3.postDelayed(mBAcquireRewardPopView3.n, 2000L);
}
};
this.m = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.6
@Override // java.lang.Runnable
public void run() {
if (MBAcquireRewardPopView.this.h <= 0) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_AUTO_DISMISS);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
return;
}
MBAcquireRewardPopView.i(MBAcquireRewardPopView.this);
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.postDelayed(mBAcquireRewardPopView.m, 1000L);
}
};
this.n = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7
@Override // java.lang.Runnable
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(300L);
alphaAnimation.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.7.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) {
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
});
MBAcquireRewardPopView.this.startAnimation(alphaAnimation);
}
};
this.o = new View.OnTouchListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.8
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
if (action == 0) {
MBAcquireRewardPopView.this.d = motionEvent.getX();
MBAcquireRewardPopView.this.e = motionEvent.getY();
} else if (action != 1) {
if (action == 2) {
MBAcquireRewardPopView.this.f = motionEvent.getX();
MBAcquireRewardPopView.this.g = motionEvent.getY();
}
} else if (MBAcquireRewardPopView.this.f <= MBAcquireRewardPopView.this.d) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else if (Math.abs(MBAcquireRewardPopView.this.f - MBAcquireRewardPopView.this.d) <= 50.0f || Math.abs(MBAcquireRewardPopView.this.g - MBAcquireRewardPopView.this.e) >= 100.0f) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
} else {
if (MBAcquireRewardPopView.this.j) {
return false;
}
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.removeCallbacks(mBAcquireRewardPopView.m);
MBAcquireRewardPopView.this.j = true;
View e = MBAcquireRewardPopView.e(MBAcquireRewardPopView.this);
View childAt = MBAcquireRewardPopView.this.getChildAt(0);
if (childAt != null) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, childAt, e);
}
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedSuccess(MBAcquireRewardPopView.this.b.reduceTime);
}
MBAcquireRewardPopView mBAcquireRewardPopView2 = MBAcquireRewardPopView.this;
mBAcquireRewardPopView2.postDelayed(mBAcquireRewardPopView2.n, 2000L);
}
return false;
}
};
this.p = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.9
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onOutOfContentClicked(MBAcquireRewardPopView.this.d, MBAcquireRewardPopView.this.e);
}
}
};
this.q = new View.OnClickListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.10
@Override // android.view.View.OnClickListener
public void onClick(View view) {
if (MBAcquireRewardPopView.this.b.behaviourListener != null) {
MBAcquireRewardPopView.this.b.behaviourListener.onReceivedFail(AcquireRewardPopViewConst.DEFAULT_REASON_CLICK_CLOSE);
}
MBAcquireRewardPopView.this.i = false;
MBAcquireRewardPopView.this.setVisibility(8);
MBAcquireRewardPopView.this.removeAllViews();
}
};
}
public void init(AcquireRewardPopViewParameters acquireRewardPopViewParameters) {
View view;
if (acquireRewardPopViewParameters == null) {
af.b("MBAcquireRewardPopView", "Must generate parameters.");
return;
}
this.b = acquireRewardPopViewParameters;
if (acquireRewardPopViewParameters.viewType == 1) {
ArrayList<String> arrayList = new ArrayList<>();
AcquireRewardPopViewParameters acquireRewardPopViewParameters2 = this.b;
if (acquireRewardPopViewParameters2 != null) {
List<String> list = acquireRewardPopViewParameters2.rightAnswerList;
if (list != null) {
arrayList.addAll(list);
}
if (this.b.wrongAnswerList != null) {
int nextInt = new Random().nextInt(this.b.wrongAnswerList.size());
if (nextInt > this.b.wrongAnswerList.size() - 1) {
nextInt = 0;
}
arrayList.add(this.b.wrongAnswerList.get(nextInt));
}
}
view = a(arrayList);
if (this.b.canClickMaskArea) {
setOnClickListener(this.p);
}
} else {
view = null;
}
if (this.b.viewType == 2) {
int a = ak.a(getContext(), 290.0f);
LinearLayout linearLayout = new LinearLayout(getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(a, -2);
layoutParams.addRule(13);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setOrientation(1);
MBGradientAndShadowTextView.GradientAndShadowParameters gradientAndShadowParameters = new MBGradientAndShadowTextView.GradientAndShadowParameters();
AcquireRewardPopViewParameters acquireRewardPopViewParameters3 = this.b;
gradientAndShadowParameters.gradientStartColor = acquireRewardPopViewParameters3.successTitleGradientStartColor;
gradientAndShadowParameters.gradientEndColor = acquireRewardPopViewParameters3.successTitleGradientEndColor;
gradientAndShadowParameters.shadowColor = acquireRewardPopViewParameters3.successTitleShadowColor;
gradientAndShadowParameters.textSize = 30;
MBGradientAndShadowTextView mBGradientAndShadowTextView = new MBGradientAndShadowTextView(getContext(), gradientAndShadowParameters);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-2, -2);
layoutParams2.setMargins(0, 0, 0, ak.a(getContext(), 12.0f));
layoutParams2.gravity = 1;
mBGradientAndShadowTextView.setLayoutParams(layoutParams2);
mBGradientAndShadowTextView.setText(String.format(" %s ", this.b.slideTitle));
mBGradientAndShadowTextView.setGravity(17);
linearLayout.addView(mBGradientAndShadowTextView);
GradientDrawable a2 = a(new int[]{AcquireRewardPopViewConst.DEFAULT_COLOR_00FDB258, AcquireRewardPopViewConst.DEFAULT_COLOR_FFE39E4A, AcquireRewardPopViewConst.DEFAULT_COLOR_FFE39E4A, AcquireRewardPopViewConst.DEFAULT_COLOR_00F3A850}, GradientDrawable.Orientation.LEFT_RIGHT);
this.k = new TextView(getContext());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
layoutParams3.gravity = 1;
layoutParams3.setMargins(0, 0, 0, ak.a(getContext(), 25.0f));
this.k.setLayoutParams(layoutParams3);
this.k.setTextSize(12.0f);
this.k.setGravity(17);
this.k.setTextColor(this.b.successTipTextColor);
TextView textView = this.k;
AcquireRewardPopViewParameters acquireRewardPopViewParameters4 = this.b;
textView.setText(String.format(acquireRewardPopViewParameters4.slideTip, Integer.valueOf(acquireRewardPopViewParameters4.reduceTime)));
int a3 = ak.a(getContext(), 6.0f);
int a4 = ak.a(getContext(), 32.0f);
this.k.setPadding(a4, a3, a4, a3);
this.k.setBackground(a2);
linearLayout.addView(this.k);
View imageView = new ImageView(getContext());
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-2, -2);
layoutParams4.gravity = 1;
imageView.setLayoutParams(layoutParams4);
imageView.setBackgroundResource(getResources().getIdentifier("mbridge_slide_rightarrow", "drawable", c.m().g()));
linearLayout.addView(imageView);
View imageView2 = new ImageView(getContext());
imageView2.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
imageView2.setBackgroundResource(getResources().getIdentifier("mbridge_slide_hand", "drawable", c.m().g()));
linearLayout.addView(imageView2);
imageView2.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.1
@Override // android.view.View.OnAttachStateChangeListener
public void onViewAttachedToWindow(View view2) {
MBAcquireRewardPopView.a(MBAcquireRewardPopView.this, view2);
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewDetachedFromWindow(View view2) {
if (MBAcquireRewardPopView.this.c != null) {
MBAcquireRewardPopView.this.c.cancel();
}
}
});
linearLayout.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.2
@Override // android.view.View.OnAttachStateChangeListener
public void onViewDetachedFromWindow(View view2) {
}
@Override // android.view.View.OnAttachStateChangeListener
public void onViewAttachedToWindow(View view2) {
MBAcquireRewardPopView.this.setLongClickable(true);
MBAcquireRewardPopView mBAcquireRewardPopView = MBAcquireRewardPopView.this;
mBAcquireRewardPopView.setOnTouchListener(mBAcquireRewardPopView.o);
}
});
view = linearLayout;
}
if (view != null) {
setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
setBackgroundColor(this.b.containerBackgroundColor);
addView(view);
int i = this.b.autoDismissTime;
if (i > 0) {
this.h = i;
post(this.m);
this.i = true;
}
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
removeCallbacks(this.m);
}
private View a(ArrayList<String> arrayList) {
LinearLayout linearLayout = new LinearLayout(getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(ak.a(getContext(), 290.0f), -2);
layoutParams.addRule(13);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setOrientation(1);
linearLayout.setClickable(true);
AcquireRewardPopViewParameters acquireRewardPopViewParameters = this.b;
int i = acquireRewardPopViewParameters.viewBackLayerTopColor;
int i2 = acquireRewardPopViewParameters.viewBackLayerBottomColor;
int i3 = acquireRewardPopViewParameters.viewForegroundTopColor;
int i4 = acquireRewardPopViewParameters.viewForegroundBottomColor;
int[] iArr = {i, i2};
GradientDrawable.Orientation orientation = GradientDrawable.Orientation.TOP_BOTTOM;
GradientDrawable a = a(iArr, orientation);
a.setCornerRadius(ak.a(getContext(), 12.0f));
GradientDrawable a2 = a(new int[]{i3, i4}, orientation);
a2.setCornerRadius(ak.a(getContext(), 12.0f));
LayerDrawable layerDrawable = new LayerDrawable(new Drawable[]{a, a2});
layerDrawable.setLayerInset(1, 5, 5, 5, 5);
linearLayout.setBackground(layerDrawable);
ImageView imageView = new ImageView(getContext());
int a3 = ak.a(getContext(), 20.0f);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(a3, a3);
layoutParams2.gravity = GravityCompat.END;
layoutParams2.setMargins(0, 13, 13, 0);
imageView.setLayoutParams(layoutParams2);
imageView.setImageResource(getResources().getIdentifier("mbridge_reward_popview_close", "drawable", c.m().g()));
imageView.setOnClickListener(this.q);
linearLayout.addView(imageView);
TextView textView = new TextView(getContext());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
layoutParams3.gravity = 1;
int a4 = ak.a(getContext(), 18.0f);
layoutParams3.setMargins(a4, 5, a4, ak.a(getContext(), 12.0f));
textView.setLayoutParams(layoutParams3);
textView.setText(this.b.title);
textView.setTextColor(this.b.titleTextColor);
textView.setTextSize(18.0f);
textView.setGravity(17);
linearLayout.addView(textView);
if (arrayList != null && arrayList.size() > 1) {
int a5 = ak.a(getContext(), 8.0f);
int a6 = ak.a(getContext(), 24.0f);
int a7 = ak.a(getContext(), 30.0f);
int a8 = ak.a(getContext(), 12.0f);
int a9 = ak.a(getContext(), 40.0f);
for (int i5 = 0; i5 < arrayList.size(); i5++) {
boolean contains = this.b.rightAnswerList.contains(arrayList.get(i5));
TextView textView2 = new TextView(getContext());
LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-1, -2);
layoutParams4.gravity = 1;
layoutParams4.setMargins(a7, a8, a7, 0);
textView2.setPadding(a6, a5, a6, a5);
textView2.setLayoutParams(layoutParams4);
textView2.setText(arrayList.get(i5));
textView2.setSingleLine(true);
textView2.setEllipsize(TextUtils.TruncateAt.END);
textView2.setTag(arrayList.get(i5));
textView2.setTextSize(17.0f);
textView2.setGravity(17);
AcquireRewardPopViewParameters acquireRewardPopViewParameters2 = this.b;
textView2.setTextColor(contains ? acquireRewardPopViewParameters2.buttonTextLightColor : acquireRewardPopViewParameters2.buttonTextDarkColor);
AcquireRewardPopViewParameters acquireRewardPopViewParameters3 = this.b;
int i6 = contains ? acquireRewardPopViewParameters3.buttonBackgroundLightColor : acquireRewardPopViewParameters3.buttonBackgroundDarkColor;
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(i6);
gradientDrawable.setShape(0);
gradientDrawable.setCornerRadius(a9);
textView2.setBackground(gradientDrawable);
textView2.setOnClickListener(this.l);
linearLayout.addView(textView2);
}
}
this.k = new TextView(getContext());
LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(-2, -2);
int a10 = ak.a(getContext(), 16.0f);
int a11 = ak.a(getContext(), 18.0f);
layoutParams5.setMargins(a11, a10, a11, a10);
layoutParams5.gravity = 1;
this.k.setLayoutParams(layoutParams5);
TextView textView3 = this.k;
AcquireRewardPopViewParameters acquireRewardPopViewParameters4 = this.b;
textView3.setText(String.format(acquireRewardPopViewParameters4.tips, Integer.valueOf(acquireRewardPopViewParameters4.reduceTime)));
this.k.setTextColor(this.b.tipTextColor);
this.k.setGravity(17);
this.k.setTextSize(12.0f);
linearLayout.addView(this.k);
return linearLayout;
}
private GradientDrawable a(int[] iArr, GradientDrawable.Orientation orientation) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColors(iArr);
gradientDrawable.setGradientType(0);
gradientDrawable.setOrientation(orientation);
gradientDrawable.setShape(0);
return gradientDrawable;
}
public void onTimeLessThanReduce(int i) {
AcquireRewardPopViewParameters acquireRewardPopViewParameters = this.b;
acquireRewardPopViewParameters.reduceTime = i;
TextView textView = this.k;
if (textView != null) {
textView.setText(String.format(acquireRewardPopViewParameters.tips, Integer.valueOf(i)));
}
}
public void onResume() {
if (!this.i || this.h <= 0) {
return;
}
post(this.m);
}
public void onPause() {
if (!this.i || this.h <= 0) {
return;
}
removeCallbacks(this.m);
}
public void onStop() {
if (!this.i || this.h <= 0) {
return;
}
removeCallbacks(this.m);
}
public static /* synthetic */ void a(MBAcquireRewardPopView mBAcquireRewardPopView, final View view) {
TranslateAnimation translateAnimation = new TranslateAnimation(2, 0.0f, 2, 0.8f, 1, 0.0f, 1, 0.0f);
translateAnimation.setDuration(1000L);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);
alphaAnimation.setDuration(1000L);
AnimationSet animationSet = new AnimationSet(true);
mBAcquireRewardPopView.c = animationSet;
animationSet.addAnimation(translateAnimation);
mBAcquireRewardPopView.c.addAnimation(alphaAnimation);
final AlphaAnimation alphaAnimation2 = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation2.setDuration(1000L);
alphaAnimation2.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.3
@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) {
view.startAnimation(MBAcquireRewardPopView.this.c);
}
});
mBAcquireRewardPopView.c.setAnimationListener(new Animation.AnimationListener() { // from class: com.mbridge.msdk.dycreator.baseview.rewardpopview.MBAcquireRewardPopView.4
@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) {
view.startAnimation(alphaAnimation2);
}
});
view.startAnimation(mBAcquireRewardPopView.c);
}
public static /* synthetic */ View e(MBAcquireRewardPopView mBAcquireRewardPopView) {
String str;
LinearLayout linearLayout = new LinearLayout(mBAcquireRewardPopView.getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(13);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setOrientation(1);
MBGradientAndShadowTextView.GradientAndShadowParameters gradientAndShadowParameters = new MBGradientAndShadowTextView.GradientAndShadowParameters();
AcquireRewardPopViewParameters acquireRewardPopViewParameters = mBAcquireRewardPopView.b;
gradientAndShadowParameters.gradientStartColor = acquireRewardPopViewParameters.successTitleGradientStartColor;
gradientAndShadowParameters.gradientEndColor = acquireRewardPopViewParameters.successTitleGradientEndColor;
gradientAndShadowParameters.shadowColor = acquireRewardPopViewParameters.successTitleShadowColor;
MBGradientAndShadowTextView mBGradientAndShadowTextView = new MBGradientAndShadowTextView(mBAcquireRewardPopView.getContext(), gradientAndShadowParameters);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-2, -2);
layoutParams2.setMargins(0, 0, 0, ak.a(mBAcquireRewardPopView.getContext(), 12.0f));
layoutParams2.gravity = 1;
mBGradientAndShadowTextView.setLayoutParams(layoutParams2);
AcquireRewardPopViewParameters acquireRewardPopViewParameters2 = mBAcquireRewardPopView.b;
int i = acquireRewardPopViewParameters2.viewType;
if (i == 1) {
str = acquireRewardPopViewParameters2.successTitle;
} else {
str = i == 2 ? acquireRewardPopViewParameters2.slideSuccessTitle : "";
}
mBGradientAndShadowTextView.setGravity(17);
mBGradientAndShadowTextView.setText(String.format(" %s ", str));
linearLayout.addView(mBGradientAndShadowTextView);
GradientDrawable a = mBAcquireRewardPopView.a(new int[]{AcquireRewardPopViewConst.DEFAULT_COLOR_00FDB258, AcquireRewardPopViewConst.DEFAULT_COLOR_FFE39E4A, AcquireRewardPopViewConst.DEFAULT_COLOR_FFE39E4A, AcquireRewardPopViewConst.DEFAULT_COLOR_00F3A850}, GradientDrawable.Orientation.LEFT_RIGHT);
TextView textView = new TextView(mBAcquireRewardPopView.getContext());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
layoutParams3.gravity = 1;
textView.setLayoutParams(layoutParams3);
textView.setTextSize(12.0f);
textView.setGravity(17);
textView.setTextColor(mBAcquireRewardPopView.b.successTipTextColor);
AcquireRewardPopViewParameters acquireRewardPopViewParameters3 = mBAcquireRewardPopView.b;
textView.setText(String.format(acquireRewardPopViewParameters3.successTip, Integer.valueOf(acquireRewardPopViewParameters3.reduceTime)));
int a2 = ak.a(mBAcquireRewardPopView.getContext(), 6.0f);
int a3 = ak.a(mBAcquireRewardPopView.getContext(), 32.0f);
textView.setPadding(a3, a2, a3, a2);
textView.setBackground(a);
linearLayout.addView(textView);
return linearLayout;
}
public static /* synthetic */ View f(MBAcquireRewardPopView mBAcquireRewardPopView) {
LinearLayout linearLayout = new LinearLayout(mBAcquireRewardPopView.getContext());
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
layoutParams.addRule(13);
linearLayout.setLayoutParams(layoutParams);
linearLayout.setOrientation(1);
MBGradientAndShadowTextView.GradientAndShadowParameters gradientAndShadowParameters = new MBGradientAndShadowTextView.GradientAndShadowParameters();
AcquireRewardPopViewParameters acquireRewardPopViewParameters = mBAcquireRewardPopView.b;
gradientAndShadowParameters.gradientStartColor = acquireRewardPopViewParameters.failTitleGradientStartColor;
gradientAndShadowParameters.gradientEndColor = acquireRewardPopViewParameters.failTitleGradientEndColor;
gradientAndShadowParameters.shadowColor = acquireRewardPopViewParameters.failTitleShadowColor;
MBGradientAndShadowTextView mBGradientAndShadowTextView = new MBGradientAndShadowTextView(mBAcquireRewardPopView.getContext(), gradientAndShadowParameters);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-2, -2);
layoutParams2.setMargins(0, 0, 0, ak.a(mBAcquireRewardPopView.getContext(), 12.0f));
layoutParams2.gravity = 1;
mBGradientAndShadowTextView.setGravity(17);
mBGradientAndShadowTextView.setLayoutParams(layoutParams2);
mBGradientAndShadowTextView.setText(String.format(" %s ", mBAcquireRewardPopView.b.failTitle));
linearLayout.addView(mBGradientAndShadowTextView);
GradientDrawable a = mBAcquireRewardPopView.a(new int[]{AcquireRewardPopViewConst.DEFAULT_COLOR_00B09A80, AcquireRewardPopViewConst.DEFAULT_COLOR_FFB09A80, AcquireRewardPopViewConst.DEFAULT_COLOR_FFB09A80, AcquireRewardPopViewConst.DEFAULT_COLOR_00B09A80}, GradientDrawable.Orientation.LEFT_RIGHT);
TextView textView = new TextView(mBAcquireRewardPopView.getContext());
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
layoutParams3.gravity = 1;
textView.setLayoutParams(layoutParams3);
textView.setTextSize(12.0f);
textView.setGravity(17);
textView.setTextColor(mBAcquireRewardPopView.b.failTipTextColor);
textView.setText(String.format(mBAcquireRewardPopView.b.failTip, ""));
int a2 = ak.a(mBAcquireRewardPopView.getContext(), 6.0f);
int a3 = ak.a(mBAcquireRewardPopView.getContext(), 32.0f);
textView.setPadding(a3, a2, a3, a2);
textView.setBackground(a);
linearLayout.addView(textView);
return linearLayout;
}
public static /* synthetic */ void a(MBAcquireRewardPopView mBAcquireRewardPopView, View view, View view2) {
mBAcquireRewardPopView.removeView(view);
mBAcquireRewardPopView.addView(view2);
}
}

View File

@@ -0,0 +1,116 @@
package com.mbridge.msdk.dycreator.baseview.rewardpopview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
/* loaded from: classes4.dex */
public class MBGradientAndShadowTextView extends TextView {
private int a;
private int b;
private int c;
private int d;
private LinearGradient e;
public float mShadowDx;
public float mShadowDy;
public float mShadowRadius;
public static class GradientAndShadowParameters {
public int gradientEndColor;
public int gradientStartColor;
public int shadowColor;
public int textSize = 40;
public float shadowRadius = 3.0f;
public float shadowDx = 1.5f;
public float shadowDy = 1.8f;
}
public MBGradientAndShadowTextView(Context context) {
super(context);
this.a = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
this.b = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
this.c = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
this.d = 40;
this.mShadowRadius = 3.0f;
this.mShadowDx = 1.5f;
this.mShadowDy = 1.8f;
a();
}
public MBGradientAndShadowTextView(Context context, GradientAndShadowParameters gradientAndShadowParameters) {
super(context);
this.a = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
this.b = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
this.c = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
this.d = 40;
this.mShadowRadius = 3.0f;
this.mShadowDx = 1.5f;
this.mShadowDy = 1.8f;
if (gradientAndShadowParameters != null) {
this.a = gradientAndShadowParameters.gradientStartColor;
this.b = gradientAndShadowParameters.gradientEndColor;
this.c = gradientAndShadowParameters.shadowColor;
this.d = gradientAndShadowParameters.textSize;
this.mShadowRadius = gradientAndShadowParameters.shadowRadius;
this.mShadowDx = gradientAndShadowParameters.shadowDx;
this.mShadowDy = gradientAndShadowParameters.shadowDy;
}
a();
}
public MBGradientAndShadowTextView(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
this.a = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
this.b = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
this.c = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
this.d = 40;
this.mShadowRadius = 3.0f;
this.mShadowDx = 1.5f;
this.mShadowDy = 1.8f;
}
public MBGradientAndShadowTextView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
this.b = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
this.c = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
this.d = 40;
this.mShadowRadius = 3.0f;
this.mShadowDx = 1.5f;
this.mShadowDy = 1.8f;
}
@RequiresApi(api = 21)
public MBGradientAndShadowTextView(Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.a = AcquireRewardPopViewConst.DEFAULT_COLOR_FFFBED;
this.b = AcquireRewardPopViewConst.DEFAULT_COLOR_FFBD6F;
this.c = AcquireRewardPopViewConst.DEFAULT_COLOR_EC7501;
this.d = 40;
this.mShadowRadius = 3.0f;
this.mShadowDx = 1.5f;
this.mShadowDy = 1.8f;
}
private void a() {
setTextSize(this.d);
setTypeface(Typeface.defaultFromStyle(3));
this.e = new LinearGradient(0.0f, 0.0f, 0.0f, getTextSize(), this.a, this.b, Shader.TileMode.CLAMP);
}
@Override // android.widget.TextView, android.view.View
public void onDraw(Canvas canvas) {
getPaint().setShader(null);
getPaint().setShadowLayer(3.0f, 1.5f, 1.8f, this.c);
super.onDraw(canvas);
getPaint().clearShadowLayer();
getPaint().setShader(this.e);
super.onDraw(canvas);
}
}

View File

@@ -0,0 +1,437 @@
package com.mbridge.msdk.dycreator.baseview.videoview;
import android.content.Context;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.SurfaceHolder;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import com.mbridge.msdk.dycreator.baseview.videoview.listener.VideoViewEventListener;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultLoadControl;
import com.mbridge.msdk.playercommon.exoplayer2.DefaultRenderersFactory;
import com.mbridge.msdk.playercommon.exoplayer2.ExoPlayer;
import com.mbridge.msdk.playercommon.exoplayer2.ExoPlayerFactory;
import com.mbridge.msdk.playercommon.exoplayer2.PlaybackParameters;
import com.mbridge.msdk.playercommon.exoplayer2.Player;
import com.mbridge.msdk.playercommon.exoplayer2.Timeline;
import com.mbridge.msdk.playercommon.exoplayer2.source.ConcatenatingMediaSource;
import com.mbridge.msdk.playercommon.exoplayer2.source.ExtractorMediaSource;
import com.mbridge.msdk.playercommon.exoplayer2.source.TrackGroupArray;
import com.mbridge.msdk.playercommon.exoplayer2.trackselection.DefaultTrackSelector;
import com.mbridge.msdk.playercommon.exoplayer2.trackselection.TrackSelectionArray;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.DefaultDataSourceFactory;
/* loaded from: classes4.dex */
public class MBVideoView extends FrameLayout implements Player.EventListener {
private final String a;
private final int b;
private ExoPlayer c;
private long d;
private String[] e;
private VideoViewEventListener f;
private final SurfaceHolder.Callback g;
private final Runnable h;
private final Runnable i;
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onLoadingChanged(boolean z) {
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onRepeatModeChanged(int i) {
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onSeekProcessed() {
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onShuffleModeEnabledChanged(boolean z) {
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onTimelineChanged(Timeline timeline, @Nullable Object obj, int i) {
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onTracksChanged(TrackGroupArray trackGroupArray, TrackSelectionArray trackSelectionArray) {
}
public void pause() {
}
public void play() {
}
public void setVideoViewEventLister(VideoViewEventListener videoViewEventListener) {
this.f = videoViewEventListener;
}
public void stop() {
}
public MBVideoView(@NonNull Context context) {
super(context);
this.a = "MBVideoView";
this.b = 1000;
this.d = 5000L;
this.g = new SurfaceHolder.Callback() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.2
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(@NonNull SurfaceHolder surfaceHolder, int i, int i2, int i3) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(@NonNull SurfaceHolder surfaceHolder) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(@NonNull SurfaceHolder surfaceHolder) {
try {
Player.VideoComponent videoComponent = MBVideoView.this.c.getVideoComponent();
if (videoComponent != null) {
videoComponent.setVideoSurfaceHolder(surfaceHolder);
}
} catch (Throwable th) {
af.b("MBVideoView", th.getMessage());
}
}
};
this.h = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.3
@Override // java.lang.Runnable
public void run() {
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onBufferingFail("Buffering fail.");
}
}
};
this.i = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.4
@Override // java.lang.Runnable
public void run() {
try {
if (MBVideoView.this.c == null || !MBVideoView.this.isPlaying()) {
return;
}
long currentPosition = MBVideoView.this.c.getCurrentPosition();
long duration = MBVideoView.this.c.getDuration();
int round = Math.round(currentPosition / 1000.0f);
int round2 = Math.round(duration / 1000.0f);
af.c("MBVideoView", "currentPosition:" + round + " duration:" + duration);
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onPlayProgress(round, round2);
}
MBVideoView.this.getHandler().postDelayed(this, 1000L);
} catch (Exception e) {
af.b("MBVideoView", e.getMessage());
}
}
};
}
public MBVideoView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
this.a = "MBVideoView";
this.b = 1000;
this.d = 5000L;
this.g = new SurfaceHolder.Callback() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.2
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(@NonNull SurfaceHolder surfaceHolder, int i, int i2, int i3) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(@NonNull SurfaceHolder surfaceHolder) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(@NonNull SurfaceHolder surfaceHolder) {
try {
Player.VideoComponent videoComponent = MBVideoView.this.c.getVideoComponent();
if (videoComponent != null) {
videoComponent.setVideoSurfaceHolder(surfaceHolder);
}
} catch (Throwable th) {
af.b("MBVideoView", th.getMessage());
}
}
};
this.h = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.3
@Override // java.lang.Runnable
public void run() {
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onBufferingFail("Buffering fail.");
}
}
};
this.i = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.4
@Override // java.lang.Runnable
public void run() {
try {
if (MBVideoView.this.c == null || !MBVideoView.this.isPlaying()) {
return;
}
long currentPosition = MBVideoView.this.c.getCurrentPosition();
long duration = MBVideoView.this.c.getDuration();
int round = Math.round(currentPosition / 1000.0f);
int round2 = Math.round(duration / 1000.0f);
af.c("MBVideoView", "currentPosition:" + round + " duration:" + duration);
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onPlayProgress(round, round2);
}
MBVideoView.this.getHandler().postDelayed(this, 1000L);
} catch (Exception e) {
af.b("MBVideoView", e.getMessage());
}
}
};
}
public MBVideoView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = "MBVideoView";
this.b = 1000;
this.d = 5000L;
this.g = new SurfaceHolder.Callback() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.2
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(@NonNull SurfaceHolder surfaceHolder, int i2, int i22, int i3) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(@NonNull SurfaceHolder surfaceHolder) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(@NonNull SurfaceHolder surfaceHolder) {
try {
Player.VideoComponent videoComponent = MBVideoView.this.c.getVideoComponent();
if (videoComponent != null) {
videoComponent.setVideoSurfaceHolder(surfaceHolder);
}
} catch (Throwable th) {
af.b("MBVideoView", th.getMessage());
}
}
};
this.h = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.3
@Override // java.lang.Runnable
public void run() {
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onBufferingFail("Buffering fail.");
}
}
};
this.i = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.4
@Override // java.lang.Runnable
public void run() {
try {
if (MBVideoView.this.c == null || !MBVideoView.this.isPlaying()) {
return;
}
long currentPosition = MBVideoView.this.c.getCurrentPosition();
long duration = MBVideoView.this.c.getDuration();
int round = Math.round(currentPosition / 1000.0f);
int round2 = Math.round(duration / 1000.0f);
af.c("MBVideoView", "currentPosition:" + round + " duration:" + duration);
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onPlayProgress(round, round2);
}
MBVideoView.this.getHandler().postDelayed(this, 1000L);
} catch (Exception e) {
af.b("MBVideoView", e.getMessage());
}
}
};
}
@RequiresApi(api = 21)
public MBVideoView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
this.a = "MBVideoView";
this.b = 1000;
this.d = 5000L;
this.g = new SurfaceHolder.Callback() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.2
@Override // android.view.SurfaceHolder.Callback
public void surfaceChanged(@NonNull SurfaceHolder surfaceHolder, int i22, int i222, int i3) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceDestroyed(@NonNull SurfaceHolder surfaceHolder) {
}
@Override // android.view.SurfaceHolder.Callback
public void surfaceCreated(@NonNull SurfaceHolder surfaceHolder) {
try {
Player.VideoComponent videoComponent = MBVideoView.this.c.getVideoComponent();
if (videoComponent != null) {
videoComponent.setVideoSurfaceHolder(surfaceHolder);
}
} catch (Throwable th) {
af.b("MBVideoView", th.getMessage());
}
}
};
this.h = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.3
@Override // java.lang.Runnable
public void run() {
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onBufferingFail("Buffering fail.");
}
}
};
this.i = new Runnable() { // from class: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.4
@Override // java.lang.Runnable
public void run() {
try {
if (MBVideoView.this.c == null || !MBVideoView.this.isPlaying()) {
return;
}
long currentPosition = MBVideoView.this.c.getCurrentPosition();
long duration = MBVideoView.this.c.getDuration();
int round = Math.round(currentPosition / 1000.0f);
int round2 = Math.round(duration / 1000.0f);
af.c("MBVideoView", "currentPosition:" + round + " duration:" + duration);
if (MBVideoView.this.f != null) {
MBVideoView.this.f.onPlayProgress(round, round2);
}
MBVideoView.this.getHandler().postDelayed(this, 1000L);
} catch (Exception e) {
af.b("MBVideoView", e.getMessage());
}
}
};
}
public void setVideoUrl(String... strArr) {
if (strArr == null || strArr.length <= 0) {
return;
}
this.e = strArr;
try {
this.c = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(getContext()), new DefaultTrackSelector(), new DefaultLoadControl());
ConcatenatingMediaSource concatenatingMediaSource = new ConcatenatingMediaSource();
for (String str : this.e) {
concatenatingMediaSource.addMediaSource(new ExtractorMediaSource.Factory(new DefaultDataSourceFactory(getContext(), "MBridge_ExoPlayer")).createMediaSource(Uri.parse(str)));
}
this.c.setRepeatMode(0);
this.c.prepare(concatenatingMediaSource);
this.c.addListener(this);
} catch (Throwable th) {
af.b("MBVideoView", th.getMessage());
th.toString();
}
}
/* renamed from: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView$1, reason: invalid class name */
public class AnonymousClass1 implements Runnable {
final /* synthetic */ MBVideoView a;
@Override // java.lang.Runnable
public void run() {
if (this.a.f != null) {
this.a.f.onBufferingFail("Buffering timeout");
}
}
}
public boolean isPlaying() {
ExoPlayer exoPlayer = this.c;
return exoPlayer != null && exoPlayer.getPlaybackState() == 3 && this.c.getPlayWhenReady();
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
super.onAttachedToWindow();
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onPlayerStateChanged(boolean z, int i) {
af.b("MBVideoView", "onPlaybackStateChanged : " + i);
if (i == 1) {
af.b("MBVideoView", "onPlaybackStateChanged : IDLE");
return;
}
if (i == 2) {
af.b("MBVideoView", "onPlaybackStateChanged : Buffering");
} else if (i == 3) {
af.b("MBVideoView", "onPlaybackStateChanged : READY");
} else {
if (i != 4) {
return;
}
af.b("MBVideoView", "onPlaybackStateChanged : Ended : PLAY ENDED");
}
}
/* JADX WARN: Removed duplicated region for block: B:16:0x004e */
/* JADX WARN: Removed duplicated region for block: B:19:? A[RETURN, SYNTHETIC] */
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void onPlayerError(com.mbridge.msdk.playercommon.exoplayer2.ExoPlaybackException r4) {
/*
r3 = this;
if (r4 == 0) goto L16
int r0 = r4.type
if (r0 == 0) goto L13
r1 = 1
if (r0 == r1) goto L10
r1 = 2
if (r0 == r1) goto Ld
goto L16
Ld:
java.lang.String r0 = "Play error, because have a UnexpectedException."
goto L18
L10:
java.lang.String r0 = "Play error, because have a RendererException."
goto L18
L13:
java.lang.String r0 = "Play error, because have a SourceException."
goto L18
L16:
java.lang.String r0 = "Play error and ExoPlayer have not message."
L18:
java.lang.Throwable r1 = r4.getCause()
if (r1 == 0) goto L34
java.lang.Throwable r1 = r4.getCause()
java.lang.String r1 = r1.getMessage()
boolean r1 = android.text.TextUtils.isEmpty(r1)
if (r1 != 0) goto L34
java.lang.Throwable r0 = r4.getCause()
java.lang.String r0 = r0.getMessage()
L34:
java.lang.StringBuilder r1 = new java.lang.StringBuilder
r1.<init>()
java.lang.String r2 = "onPlayerError : "
r1.append(r2)
r1.append(r0)
java.lang.String r1 = r1.toString()
java.lang.String r2 = "MBVideoView"
com.mbridge.msdk.foundation.tools.af.b(r2, r1)
com.mbridge.msdk.dycreator.baseview.videoview.listener.VideoViewEventListener r1 = r3.f
if (r1 == 0) goto L53
int r4 = r4.type
r1.onPlayerError(r4, r0)
L53:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.dycreator.baseview.videoview.MBVideoView.onPlayerError(com.mbridge.msdk.playercommon.exoplayer2.ExoPlaybackException):void");
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onPositionDiscontinuity(int i) {
this.c.getCurrentWindowIndex();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.Player.EventListener
public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
af.b("MBVideoView", "onPlaybackParametersChanged : " + playbackParameters.speed);
}
}

View File

@@ -0,0 +1,18 @@
package com.mbridge.msdk.dycreator.baseview.videoview.listener;
/* loaded from: classes4.dex */
public interface VideoViewEventListener {
void onBufferingEnd();
void onBufferingFail(String str);
void onBufferingStart();
void onPlayCompleted();
void onPlayProgress(int i, int i2);
void onPlayStart(String str);
void onPlayerError(int i, String str);
}