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