Files
rr3-apk/decompiled/sources/com/mbridge/msdk/video/module/MBridgeNativeEndCardView.java
Daniel Elliott f9d20bb3fc 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>
2026-02-18 14:52:23 -08:00

968 lines
42 KiB
Java

package com.mbridge.msdk.video.module;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.drawable.GradientDrawable;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.core.internal.view.SupportMenu;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.dycreator.baseview.MBHeatLevelLayoutView;
import com.mbridge.msdk.dycreator.baseview.MBStarLevelLayoutView;
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeBaitClickView;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.entity.CampaignEx;
import com.mbridge.msdk.foundation.entity.CampaignUnit;
import com.mbridge.msdk.foundation.same.report.d.d;
import com.mbridge.msdk.foundation.same.report.d.e;
import com.mbridge.msdk.foundation.same.report.i;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.aq;
import com.mbridge.msdk.shake.MBShakeView;
import com.mbridge.msdk.shake.a;
import com.mbridge.msdk.video.dynview.e.h;
import com.mbridge.msdk.video.dynview.widget.MBridgeLevelLayoutView;
import com.mbridge.msdk.video.module.a.a.j;
import com.mbridge.msdk.video.signal.factory.b;
import com.mbridge.msdk.videocommon.view.RoundImageView;
import com.mbridge.msdk.videocommon.view.StarLevelView;
import com.mbridge.msdk.widget.FeedBackButton;
import java.util.Iterator;
import java.util.Locale;
import org.json.JSONException;
import org.json.JSONObject;
/* loaded from: classes4.dex */
public class MBridgeNativeEndCardView extends MBridgeNativeEndCardViewDiff {
private LinearLayout A;
private Runnable B;
private Runnable C;
private RelativeLayout D;
private b E;
private boolean F;
private boolean G;
private boolean H;
private boolean I;
private int J;
private AlphaAnimation K;
private int L;
private int M;
private int N;
private int O;
private Bitmap P;
private View Q;
private FeedBackButton R;
private String S;
private CampaignUnit T;
private MBShakeView U;
private com.mbridge.msdk.shake.b V;
private MBridgeBaitClickView W;
private boolean aa;
private int ab;
private String ac;
private ViewGroup m;
private ViewGroup n;
private RelativeLayout o;
private ImageView p;
private ImageView q;
private ImageView r;
private ImageView s;
private TextView t;
private ImageView u;
private ImageView v;
private TextView w;
private TextView x;
private TextView y;
private LinearLayout z;
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public void init(Context context) {
}
public boolean isDyXmlSuccess() {
return this.aa;
}
public void setCloseBtnDelay(int i) {
this.J = i;
}
public void setOnPause() {
this.H = false;
}
public void setOnResume() {
this.H = true;
}
public void setUnitId(String str) {
this.S = str;
}
public MBridgeNativeEndCardView(Context context) {
super(context);
this.F = false;
this.G = false;
this.H = false;
this.I = false;
this.J = 0;
this.aa = false;
this.ab = 1;
}
public MBridgeNativeEndCardView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
this.F = false;
this.G = false;
this.H = false;
this.I = false;
this.J = 0;
this.aa = false;
this.ab = 1;
}
public MBridgeNativeEndCardView(Context context, AttributeSet attributeSet, boolean z, int i, boolean z2, int i2, int i3) {
super(context, attributeSet, z, i, z2, i2, i3);
this.F = false;
this.G = false;
this.H = false;
this.I = false;
this.J = 0;
this.aa = false;
this.ab = 1;
}
@Override // android.view.ViewGroup, android.view.View
public void onAttachedToWindow() {
int parseInt;
int parseInt2;
int i;
MBridgeBaitClickView mBridgeBaitClickView;
super.onAttachedToWindow();
if (this.B == null) {
this.B = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.1
@Override // java.lang.Runnable
public final void run() {
MBridgeNativeEndCardView.this.G = true;
if (MBridgeNativeEndCardView.this.Q != null) {
MBridgeNativeEndCardView.this.Q.setVisibility(0);
}
}
};
}
Runnable runnable = this.B;
if (runnable != null) {
postDelayed(runnable, this.J * 1000);
if (!this.H) {
this.H = true;
}
try {
CampaignEx campaignEx = this.b;
if (campaignEx != null && campaignEx.isDynamicView()) {
String str = this.b.getendcard_url();
if (TextUtils.isEmpty(str)) {
str = this.b.getEndScreenUrl();
}
String a = aq.a(str, "alac");
if (!TextUtils.isEmpty(a) && a.equals("1") && this.b.getAutoShowStoreMiniCard() != 1) {
postDelayed(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.8
@Override // java.lang.Runnable
public final void run() {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.this.b.setClickType(1);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 2);
}
}, 1000L);
}
}
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage());
}
}
try {
CampaignEx campaignEx2 = this.b;
if (campaignEx2 != null && campaignEx2.isDynamicView()) {
String str2 = this.b.getendcard_url();
if (TextUtils.isEmpty(str2)) {
str2 = this.b.getEndScreenUrl();
}
String a2 = aq.a(str2, "bait_click");
try {
i = Integer.parseInt(a2);
} catch (Throwable th2) {
af.b(MBridgeBaseView.TAG, th2.getMessage());
i = 1;
}
if (!TextUtils.isEmpty(a2) && i != 0 && (mBridgeBaitClickView = this.W) != null) {
mBridgeBaitClickView.setVisibility(0);
this.W.init(1342177280, i);
if (this.b.getEcTemplateId() == 1302) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setShape(0);
gradientDrawable.setColor(1342177280);
gradientDrawable.setStroke(0, SupportMenu.CATEGORY_MASK);
gradientDrawable.setCornerRadius(25.0f);
this.W.setBackground(gradientDrawable);
}
this.W.startAnimation();
this.W.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.7
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 0);
}
});
}
}
} catch (Throwable th3) {
af.b(MBridgeBaseView.TAG, th3.getMessage());
}
try {
CampaignEx campaignEx3 = this.b;
if (campaignEx3 != null && campaignEx3.isDynamicView()) {
String str3 = this.b.getendcard_url();
if (TextUtils.isEmpty(str3)) {
str3 = this.b.getEndScreenUrl();
}
String a3 = aq.a(str3, "shake_show");
String a4 = aq.a(str3, "shake_strength");
String a5 = aq.a(str3, "shake_time");
if (!TextUtils.isEmpty(a3) && a3.equals("1") && this.U == null) {
MBridgeBaitClickView mBridgeBaitClickView2 = this.W;
if (mBridgeBaitClickView2 != null) {
mBridgeBaitClickView2.setVisibility(8);
}
MBShakeView mBShakeView = new MBShakeView(getContext());
this.U = mBShakeView;
mBShakeView.initView(this.b.getAdCall(), true);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
if (!isLandscape()) {
layoutParams.addRule(2, filterFindViewId(this.aa, "mbridge_iv_logo"));
layoutParams.addRule(14);
this.U.setPadding(0, 0, 0, ak.a(getContext(), 20.0f));
} else {
layoutParams.addRule(13);
}
this.U.setLayoutParams(layoutParams);
RelativeLayout relativeLayout = this.o;
if (relativeLayout != null && relativeLayout.isShown()) {
this.o.addView(this.U);
TextView textView = this.ctaView;
if (textView != null) {
textView.setVisibility(4);
}
this.U.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.5
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(5);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 0);
}
});
int i2 = 10;
if (!TextUtils.isEmpty(a4) && (parseInt2 = Integer.parseInt(a4)) > 0) {
i2 = parseInt2;
}
int i3 = 5000;
if (!TextUtils.isEmpty(a5) && (parseInt = Integer.parseInt(a5)) > 0) {
i3 = parseInt * 1000;
}
this.V = new com.mbridge.msdk.shake.b(i2, i3) { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.6
@Override // com.mbridge.msdk.shake.b
public final void a() {
if ((com.mbridge.msdk.e.b.a() && MBridgeNativeEndCardView.this.checkChinaShakeState()) || MBridgeNativeEndCardView.this.I || !MBridgeNativeEndCardView.this.H) {
return;
}
MBridgeNativeEndCardView mBridgeNativeEndCardView = MBridgeNativeEndCardView.this;
mBridgeNativeEndCardView.f = 0.0f;
mBridgeNativeEndCardView.g = 0.0f;
mBridgeNativeEndCardView.b.setTriggerClickSource(5);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 4);
}
};
a.a().a(this.V);
}
}
}
} catch (Throwable th4) {
af.b(MBridgeBaseView.TAG, th4.getMessage());
}
try {
CampaignEx campaignEx4 = this.b;
if (campaignEx4 != null && campaignEx4.getAutoShowStoreMiniCard() != 0 && !TextUtils.isEmpty(this.b.getDeepLinkURL())) {
long showStoreMiniCardDelayTime = this.b.getShowStoreMiniCardDelayTime();
if (showStoreMiniCardDelayTime == 0) {
showStoreMiniCardDelayTime = 1;
}
if (this.C == null) {
this.C = new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.9
@Override // java.lang.Runnable
public final void run() {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.this.b.setClickType(1);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 2);
}
};
}
postDelayed(this.C, showStoreMiniCardDelayTime * 1000);
}
} catch (Throwable th5) {
af.b(MBridgeBaseView.TAG, th5.getMessage());
}
}
@Override // android.view.ViewGroup, android.view.View
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
Runnable runnable = this.B;
if (runnable != null) {
removeCallbacks(runnable);
}
Runnable runnable2 = this.C;
if (runnable2 != null) {
removeCallbacks(runnable2);
}
if (this.V != null) {
a.a().b(this.V);
this.V = null;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a() {
int e = e();
if (e > 0) {
this.e = b(e);
b();
CampaignEx campaignEx = this.b;
if (campaignEx != null) {
campaignEx.setECTemplateRenderSucc(false);
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public void b() {
c();
if (!this.e) {
this.notifyListener.a(104, "");
}
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 100.0f);
this.K = alphaAnimation;
alphaAnimation.setDuration(200L);
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public void onSelfConfigurationChanged(Configuration configuration) {
super.onSelfConfigurationChanged(configuration);
CampaignEx campaignEx = this.b;
if (campaignEx == null || !campaignEx.isDynamicView()) {
RelativeLayout relativeLayout = this.D;
if (relativeLayout != null) {
relativeLayout.setVisibility(4);
}
int i = configuration.orientation;
this.d = i;
if (i == 2) {
removeView(this.m);
a(this.n);
} else {
removeView(this.n);
a(this.m);
}
}
}
public boolean canBackPress() {
View view = this.Q;
return view != null && view.getVisibility() == 0;
}
public void notifyShowListener() {
this.notifyListener.a(110, "");
}
private void a(View view) {
if (view == null) {
setLayout();
preLoadData(this.E);
} else {
if (view.getParent() != null) {
((ViewGroup) view.getParent()).removeView(view);
}
addView(view);
b(view);
c();
}
f();
}
private boolean b(int i) {
if (isLandscape()) {
ViewGroup viewGroup = (ViewGroup) this.c.inflate(i, (ViewGroup) null);
this.n = viewGroup;
addView(viewGroup);
return b(this.n);
}
ViewGroup viewGroup2 = (ViewGroup) this.c.inflate(i, (ViewGroup) null);
this.m = viewGroup2;
addView(viewGroup2);
return b(this.m);
}
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
public final void c() {
if (this.e) {
this.o.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.14
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBridgeNativeEndCardView.this.F) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 1);
}
}
});
this.Q.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.15
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBridgeNativeEndCardView.this.h) {
try {
com.mbridge.msdk.video.dynview.moffer.a.a().b();
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
try {
CampaignEx campaignEx = MBridgeNativeEndCardView.this.b;
if (campaignEx != null) {
String a = aq.a(campaignEx.getendcard_url(), "ecid");
String a2 = aq.a(MBridgeNativeEndCardView.this.b.getendcard_url(), "mof");
e eVar = new e();
eVar.a("type", "choseFromTwoClose");
eVar.a("endcard_id", a);
eVar.a("mof", a2);
com.mbridge.msdk.video.module.b.a.a("2000103", MBridgeNativeEndCardView.this.b, eVar);
}
} catch (Exception e2) {
if (MBridgeConstans.DEBUG) {
e2.printStackTrace();
}
}
}
try {
e eVar2 = new e();
eVar2.a("type", 2);
d.a().a("2000152", eVar2);
d.a().a("2000134", MBridgeNativeEndCardView.this.b);
} catch (Throwable th) {
if (MBridgeConstans.DEBUG) {
th.printStackTrace();
}
}
MBridgeNativeEndCardView.this.notifyListener.a(104, "");
}
});
TextView textView = this.ctaView;
if (textView != null) {
textView.setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.16
@Override // com.mbridge.msdk.widget.a
public final void onNoDoubleClick(View view) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(1);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 0);
}
});
}
this.r.setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.17
@Override // com.mbridge.msdk.widget.a
public final void onNoDoubleClick(View view) {
if (MBridgeNativeEndCardView.this.ctaView != null) {
if (!com.mbridge.msdk.e.b.a() || MBridgeNativeEndCardView.this.checkProgressBarIntercepted()) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 0);
}
}
}
});
this.q.setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.2
@Override // com.mbridge.msdk.widget.a
public final void onNoDoubleClick(View view) {
if (MBridgeNativeEndCardView.this.ctaView != null) {
if (!com.mbridge.msdk.e.b.a() || MBridgeNativeEndCardView.this.checkProgressBarIntercepted()) {
MBridgeNativeEndCardView.this.b.setTriggerClickSource(2);
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, 0);
}
}
}
});
}
}
/* JADX INFO: Access modifiers changed from: private */
public boolean b(View view) {
try {
this.o = (RelativeLayout) view.findViewById(filterFindViewId(this.aa, "mbridge_native_ec_layout"));
this.q = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_adbanner"));
this.r = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_icon"));
this.s = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_flag"));
this.t = (TextView) view.findViewById(filterFindViewId(this.aa, "mbridge_tv_flag"));
this.u = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_logo"));
this.v = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_link"));
this.w = (TextView) view.findViewById(filterFindViewId(this.aa, "mbridge_tv_apptitle"));
this.z = (LinearLayout) view.findViewById(filterFindViewId(this.aa, "mbridge_sv_starlevel"));
this.A = (LinearLayout) view.findViewById(filterFindViewId(this.aa, "mbridge_sv_heat_count_level"));
this.Q = view.findViewById(filterFindViewId(this.aa, "mbridge_iv_close"));
this.ctaView = (TextView) view.findViewById(filterFindViewId(this.aa, "mbridge_tv_cta"));
this.R = (FeedBackButton) view.findViewById(filterFindViewId(this.aa, "mbridge_native_endcard_feed_btn"));
this.D = (RelativeLayout) view.findViewById(filterFindViewId(this.aa, "mbridge_native_ec_controller"));
this.p = (ImageView) view.findViewById(filterFindViewId(this.aa, "mbridge_iv_adbanner_bg"));
this.W = (MBridgeBaitClickView) findViewById(filterFindViewId(this.aa, "mbridge_animation_click_view"));
this.x = (TextView) view.findViewById(filterFindViewId(this.aa, "mbridge_tv_appdesc"));
if (this.h) {
ImageView imageView = this.q;
if (imageView != null && (imageView instanceof RoundImageView)) {
((RoundImageView) imageView).setBorderRadius(10);
}
ImageView imageView2 = this.r;
if (imageView2 != null && (imageView2 instanceof RoundImageView)) {
((RoundImageView) imageView2).setBorderRadius(10);
}
return isNotNULL(this.q, this.r, this.w, this.z, this.Q, this.ctaView);
}
TextView textView = (TextView) view.findViewById(filterFindViewId(this.aa, "mbridge_tv_number"));
this.y = textView;
return isNotNULL(this.q, this.r, this.w, this.x, textView, this.z, this.Q, this.ctaView);
} catch (Throwable th) {
af.b(MBridgeBaseView.TAG, th.getMessage(), th);
return false;
}
}
/* JADX WARN: Code restructure failed: missing block: B:10:0x001b, code lost:
r1 = "mbridge_reward_endcard_native_half_landscape";
*/
/* JADX WARN: Code restructure failed: missing block: B:11:0x001c, code lost:
r3 = r1;
*/
/* JADX WARN: Code restructure failed: missing block: B:23:0x002e, code lost:
if (r6.j != false) goto L11;
*/
/* JADX WARN: Code restructure failed: missing block: B:9:0x0019, code lost:
if (r6.j != false) goto L11;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private int e() {
/*
r6 = this;
int r0 = r6.k
java.lang.String r1 = "mbridge_reward_endcard_native_land"
java.lang.String r2 = "mbridge_reward_endcard_native_half_landscape"
java.lang.String r3 = "mbridge_reward_endcard_native_hor"
java.lang.String r4 = "mbridge_reward_endcard_native_half_portrait"
if (r0 != 0) goto L1e
boolean r0 = r6.j
if (r0 == 0) goto L11
r3 = r4
L11:
boolean r0 = r6.isLandscape()
if (r0 == 0) goto L31
boolean r0 = r6.j
if (r0 == 0) goto L1c
L1b:
r1 = r2
L1c:
r3 = r1
goto L31
L1e:
r5 = 1
if (r0 != r5) goto L27
boolean r5 = r6.j
if (r5 == 0) goto L29
r3 = r4
goto L29
L27:
java.lang.String r3 = ""
L29:
r4 = 2
if (r0 != r4) goto L31
boolean r0 = r6.j
if (r0 == 0) goto L1c
goto L1b
L31:
int r0 = r6.findLayout(r3)
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.e():int");
}
@TargetApi(17)
public Bitmap blurBitmap(Bitmap bitmap) {
try {
Bitmap createBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_4444);
RenderScript create = RenderScript.create(this.a.getApplicationContext());
ScriptIntrinsicBlur create2 = ScriptIntrinsicBlur.create(create, Element.U8_4(create));
Allocation createFromBitmap = Allocation.createFromBitmap(create, bitmap);
Allocation createFromBitmap2 = Allocation.createFromBitmap(create, createBitmap);
create2.setRadius(25.0f);
create2.setInput(createFromBitmap);
create2.forEach(createFromBitmap2);
createFromBitmap2.copyTo(createBitmap);
create.destroy();
return createBitmap;
} catch (Throwable unused) {
return null;
}
}
public void setNotchPadding(int i, int i2, int i3, int i4) {
af.b(MBridgeBaseView.TAG, "NOTCH NativeEndCard " + String.format("%1s-%2s-%3s-%4s", Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(i4)));
this.L = i;
this.M = i2;
this.N = i3;
this.O = i4;
f();
}
private void f() {
RelativeLayout relativeLayout;
if (!this.e || (relativeLayout = this.D) == null) {
return;
}
relativeLayout.postDelayed(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.3
@Override // java.lang.Runnable
public final void run() {
if (MBridgeNativeEndCardView.this.D != null) {
CampaignEx campaignEx = MBridgeNativeEndCardView.this.b;
if (campaignEx != null && !campaignEx.isDynamicView() && MBridgeNativeEndCardView.this.b.getAdSpaceT() != 2) {
MBridgeNativeEndCardView.this.D.setPadding(MBridgeNativeEndCardView.this.L, MBridgeNativeEndCardView.this.N, MBridgeNativeEndCardView.this.M, MBridgeNativeEndCardView.this.O);
MBridgeNativeEndCardView.this.D.startAnimation(MBridgeNativeEndCardView.this.K);
}
MBridgeNativeEndCardView.this.D.setVisibility(0);
}
if (MBridgeNativeEndCardView.this.Q != null && MBridgeNativeEndCardView.this.Q.getVisibility() != 0 && MBridgeNativeEndCardView.this.G) {
MBridgeNativeEndCardView.this.Q.setVisibility(0);
}
MBridgeNativeEndCardView.p(MBridgeNativeEndCardView.this);
}
}, 200L);
}
public void setMoreOfferCampaignUnit(CampaignUnit campaignUnit) {
MBShakeView mBShakeView;
CampaignEx campaignEx = this.b;
if (campaignEx == null || !campaignEx.isDynamicView()) {
return;
}
this.T = campaignUnit;
if (campaignUnit == null || campaignUnit.getAds() == null || this.T.getAds().size() <= 5 || (mBShakeView = this.U) == null) {
return;
}
mBShakeView.setPadding(0, 0, 0, ak.a(getContext(), 5.0f));
}
public void clearMoreOfferBitmap() {
CampaignUnit campaignUnit;
CampaignEx campaignEx = this.b;
if (campaignEx == null || !campaignEx.isDynamicView() || (campaignUnit = this.T) == null || campaignUnit.getAds() == null || this.T.getAds().size() <= 0) {
return;
}
Iterator<CampaignEx> it = this.T.getAds().iterator();
while (it.hasNext()) {
CampaignEx next = it.next();
if (!TextUtils.isEmpty(next.getIconUrl())) {
com.mbridge.msdk.foundation.same.c.b.a(c.m().c());
next.getIconUrl();
}
}
}
public void release() {
try {
removeAllViews();
AlphaAnimation alphaAnimation = this.K;
if (alphaAnimation != null) {
alphaAnimation.cancel();
}
this.B = null;
} catch (Exception e) {
af.b(MBridgeBaseView.TAG, e.getMessage());
}
}
public void setLayout() {
if (!this.h) {
a();
return;
}
com.mbridge.msdk.video.dynview.c a = new com.mbridge.msdk.video.dynview.j.c().a(getContext(), this.b, this.i, com.mbridge.msdk.e.b.a() ? "cn_" : "en_");
this.ab = a.n();
com.mbridge.msdk.video.dynview.b.a().a(a, new h() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.10
@Override // com.mbridge.msdk.video.dynview.e.h
public final void viewInflaterSuccess(com.mbridge.msdk.video.dynview.a aVar) {
if (aVar != null) {
MBridgeNativeEndCardView.this.addView(aVar.a());
MBridgeNativeEndCardView.this.aa = aVar.c();
if (MBridgeNativeEndCardView.this.ctaViewCanGet(aVar.a(), MBridgeNativeEndCardView.this.aa)) {
MBridgeNativeEndCardView mBridgeNativeEndCardView = MBridgeNativeEndCardView.this;
mBridgeNativeEndCardView.e = mBridgeNativeEndCardView.b(aVar.a());
MBridgeNativeEndCardView.this.b();
} else {
MBridgeNativeEndCardView.this.aa = false;
MBridgeNativeEndCardView mBridgeNativeEndCardView2 = MBridgeNativeEndCardView.this;
mBridgeNativeEndCardView2.h = false;
mBridgeNativeEndCardView2.a();
}
MBridgeNativeEndCardView mBridgeNativeEndCardView3 = MBridgeNativeEndCardView.this;
CampaignEx campaignEx = mBridgeNativeEndCardView3.b;
if (campaignEx != null) {
campaignEx.setECTemplateRenderSucc(mBridgeNativeEndCardView3.aa);
}
}
}
@Override // com.mbridge.msdk.video.dynview.e.h
public final void viewInflaterFail(com.mbridge.msdk.video.dynview.c.a aVar) {
af.b(MBridgeBaseView.TAG, "errorMsg:" + aVar.b());
}
});
}
public void preLoadData(b bVar) {
this.E = bVar;
try {
if (this.b == null || !this.e) {
return;
}
com.mbridge.msdk.foundation.same.c.b.a(this.a.getApplicationContext()).a(this.b.getImageUrl(), new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.11
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onFailedLoad(String str, String str2) {
}
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onSuccessLoad(Bitmap bitmap, String str) {
if (bitmap == null || bitmap.isRecycled()) {
return;
}
try {
if (MBridgeNativeEndCardView.this.q != null) {
MBridgeNativeEndCardView mBridgeNativeEndCardView = MBridgeNativeEndCardView.this;
if (mBridgeNativeEndCardView.h) {
mBridgeNativeEndCardView.q.setBackground(null);
}
MBridgeNativeEndCardView.this.q.setImageBitmap(bitmap);
}
MBridgeNativeEndCardView.a(MBridgeNativeEndCardView.this, bitmap);
} catch (Throwable unused) {
if (MBridgeNativeEndCardView.this.p != null) {
MBridgeNativeEndCardView.this.p.setVisibility(4);
}
}
}
});
com.mbridge.msdk.foundation.same.c.b.a(this.a.getApplicationContext()).a(this.b.getIconUrl(), new j(this.r, ak.a(c.m().c(), 8.0f)));
this.w.setText(this.b.getAppName());
TextView textView = this.ctaView;
if (textView != null) {
textView.setText(this.b.getAdCall());
}
TextView textView2 = this.x;
if (textView2 != null) {
textView2.setText(this.b.getAppDesc());
}
TextView textView3 = this.y;
if (textView3 != null) {
textView3.setText(this.b.getNumberRating() + ")");
}
this.z.removeAllViews();
double rating = this.b.getRating();
if (rating <= 0.0d) {
rating = 5.0d;
}
LinearLayout linearLayout = this.z;
if (linearLayout instanceof StarLevelView) {
((StarLevelView) linearLayout).initScore(rating);
}
LinearLayout linearLayout2 = this.z;
if (linearLayout2 instanceof MBridgeLevelLayoutView) {
((MBridgeLevelLayoutView) linearLayout2).setRatingAndUser(rating, this.b.getNumberRating());
}
LinearLayout linearLayout3 = this.z;
if (linearLayout3 instanceof MBStarLevelLayoutView) {
((MBStarLevelLayoutView) linearLayout3).setRating((int) rating);
}
LinearLayout linearLayout4 = this.A;
if (linearLayout4 != null && (linearLayout4 instanceof MBHeatLevelLayoutView)) {
((MBHeatLevelLayoutView) linearLayout4).setHeatCount(this.b.getNumberRating());
}
if (!TextUtils.isEmpty(this.b.getendcard_url()) && this.b.getendcard_url().contains("alecfc=1")) {
this.F = true;
}
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
this.s.setImageDrawable(getResources().getDrawable(getResources().getIdentifier("mbridge_reward_flag_cn", "drawable", c.m().g())));
this.ac = "广告";
} else {
this.s.setImageDrawable(getResources().getDrawable(getResources().getIdentifier("mbridge_reward_flag_en", "drawable", c.m().g())));
this.ac = "AD";
}
if (this.ab == 0) {
ImageView imageView = this.s;
if (imageView != null) {
imageView.setVisibility(4);
}
ImageView imageView2 = this.u;
if (imageView2 != null) {
imageView2.setVisibility(4);
}
TextView textView4 = this.t;
if (textView4 != null) {
textView4.setVisibility(0);
this.t.setText(this.ac);
}
}
ak.a(2, this.v, this.b, this.a, true, new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.12
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
MBridgeNativeEndCardView.this.I = true;
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
MBridgeNativeEndCardView.this.I = false;
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
MBridgeNativeEndCardView.this.I = false;
}
});
if (this.G) {
return;
}
this.Q.setVisibility(8);
} catch (Throwable th) {
af.a(MBridgeBaseView.TAG, th.getMessage());
}
}
public static /* synthetic */ void a(MBridgeNativeEndCardView mBridgeNativeEndCardView, final Bitmap bitmap) {
try {
com.mbridge.msdk.foundation.same.f.a.d().execute(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.13
@Override // java.lang.Runnable
public final void run() {
MBridgeNativeEndCardView mBridgeNativeEndCardView2 = MBridgeNativeEndCardView.this;
mBridgeNativeEndCardView2.P = mBridgeNativeEndCardView2.blurBitmap(bitmap);
if (MBridgeNativeEndCardView.this.P == null || MBridgeNativeEndCardView.this.P.isRecycled() || MBridgeNativeEndCardView.this.p == null) {
return;
}
MBridgeNativeEndCardView.this.p.post(new Runnable() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.13.1
@Override // java.lang.Runnable
public final void run() {
MBridgeNativeEndCardView mBridgeNativeEndCardView3 = MBridgeNativeEndCardView.this;
if (mBridgeNativeEndCardView3.h) {
mBridgeNativeEndCardView3.p.setBackground(null);
}
af.b("async", "执行异步加载图");
MBridgeNativeEndCardView.this.p.setImageBitmap(MBridgeNativeEndCardView.this.P);
}
});
}
});
} catch (Exception e) {
af.a(MBridgeBaseView.TAG, e.getMessage());
}
}
public static /* synthetic */ void a(MBridgeNativeEndCardView mBridgeNativeEndCardView, int i) {
JSONObject jSONObject;
CampaignEx campaignEx = mBridgeNativeEndCardView.b;
if (campaignEx != null && campaignEx.isDynamicView()) {
try {
CampaignEx.c rewardTemplateMode = mBridgeNativeEndCardView.b.getRewardTemplateMode();
String str = "";
if (rewardTemplateMode != null) {
str = rewardTemplateMode.f() + "";
}
i.a(c.m().c(), "end_card_click", mBridgeNativeEndCardView.b.getCampaignUnitId(), mBridgeNativeEndCardView.b.isBidCampaign(), mBridgeNativeEndCardView.b.getRequestId(), mBridgeNativeEndCardView.b.getRequestIdNotice(), mBridgeNativeEndCardView.b.getId(), str);
} catch (Exception e) {
e.printStackTrace();
}
}
JSONObject jSONObject2 = null;
try {
jSONObject = new JSONObject();
try {
jSONObject.put(com.mbridge.msdk.foundation.same.a.j, mBridgeNativeEndCardView.a(i));
if (mBridgeNativeEndCardView.b.getDynamicTempCode() == 5) {
jSONObject.put("camp_position", 0);
}
} catch (JSONException e2) {
e = e2;
jSONObject2 = jSONObject;
e.printStackTrace();
jSONObject = jSONObject2;
mBridgeNativeEndCardView.b.setClickTempSource(2);
mBridgeNativeEndCardView.notifyListener.a(105, jSONObject);
}
} catch (JSONException e3) {
e = e3;
}
mBridgeNativeEndCardView.b.setClickTempSource(2);
mBridgeNativeEndCardView.notifyListener.a(105, jSONObject);
}
public static /* synthetic */ void p(MBridgeNativeEndCardView mBridgeNativeEndCardView) {
CampaignEx campaignEx = mBridgeNativeEndCardView.b;
if (campaignEx != null) {
campaignEx.setCampaignUnitId(mBridgeNativeEndCardView.S);
com.mbridge.msdk.foundation.d.b.a().a(mBridgeNativeEndCardView.S + "_2", mBridgeNativeEndCardView.b);
}
if (com.mbridge.msdk.foundation.d.b.a().b()) {
com.mbridge.msdk.foundation.d.b.a().a(mBridgeNativeEndCardView.S + "_2", new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.video.module.MBridgeNativeEndCardView.4
@Override // com.mbridge.msdk.foundation.d.a
public final void showed() {
MBridgeNativeEndCardView.this.I = true;
}
@Override // com.mbridge.msdk.foundation.d.a
public final void close() {
MBridgeNativeEndCardView.this.I = false;
}
@Override // com.mbridge.msdk.foundation.d.a
public final void summit(String str) {
MBridgeNativeEndCardView.this.I = false;
}
});
com.mbridge.msdk.foundation.d.b.a().c(mBridgeNativeEndCardView.S + "_1");
if (mBridgeNativeEndCardView.R != null) {
com.mbridge.msdk.foundation.d.b.a().a(mBridgeNativeEndCardView.S + "_2", mBridgeNativeEndCardView.R);
return;
}
return;
}
FeedBackButton feedBackButton = mBridgeNativeEndCardView.R;
if (feedBackButton != null) {
feedBackButton.setVisibility(8);
}
}
}