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