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,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;
}
}