package com.mbridge.msdk.widget; import android.content.Context; import android.graphics.Bitmap; import android.text.TextUtils; import android.util.AttributeSet; import android.widget.ImageView; import com.mbridge.msdk.c.g; import com.mbridge.msdk.c.h; import com.mbridge.msdk.foundation.controller.c; import com.mbridge.msdk.foundation.entity.CampaignEx; import com.mbridge.msdk.foundation.same.c.b; import com.mbridge.msdk.foundation.same.net.e.d; import com.mbridge.msdk.foundation.tools.ak; import com.mbridge.msdk.out.Campaign; /* loaded from: classes4.dex */ public class MBAdChoice extends MBImageView { private final Context a; private String b; private String c; private String d; private CampaignEx e; private com.mbridge.msdk.foundation.d.a f; public void setFeedbackDialogEventListener(com.mbridge.msdk.foundation.d.a aVar) { this.f = aVar; } public MBAdChoice(Context context) { super(context); this.b = ""; this.c = ""; this.d = ""; this.a = context; a(); } private void a() { setScaleType(ImageView.ScaleType.FIT_CENTER); setClickable(true); } public MBAdChoice(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.b = ""; this.c = ""; this.d = ""; this.a = context; a(); } public MBAdChoice(Context context, AttributeSet attributeSet, int i) { super(context, attributeSet, i); this.b = ""; this.c = ""; this.d = ""; this.a = context; a(); } @Override // android.view.View public boolean performClick() { if (this.f == null) { this.f = new com.mbridge.msdk.foundation.d.a() { // from class: com.mbridge.msdk.widget.MBAdChoice.1 @Override // com.mbridge.msdk.foundation.d.a public final void close() { } @Override // com.mbridge.msdk.foundation.d.a public final void showed() { } @Override // com.mbridge.msdk.foundation.d.a public final void summit(String str) { } }; } ak.a(this.e, this.f, 4, ""); return true; } public void setCampaign(Campaign campaign) { if (!(campaign instanceof CampaignEx)) { this.e = null; return; } CampaignEx campaignEx = (CampaignEx) campaign; this.e = campaignEx; g b = h.a().b(c.m().k()); this.e = campaignEx; if (campaignEx != null) { String privacyUrl = campaignEx.getPrivacyUrl(); this.c = privacyUrl; if (TextUtils.isEmpty(privacyUrl)) { CampaignEx.a adchoice = campaignEx.getAdchoice(); if (adchoice != null) { this.c = adchoice.c(); } if (TextUtils.isEmpty(this.c) && b != null) { this.c = b.j(); } if (TextUtils.isEmpty(this.c)) { this.c = d.f().f; } } } else if (b != null) { this.c = b.j(); } this.e = campaignEx; if (campaignEx != null) { CampaignEx.a adchoice2 = campaignEx.getAdchoice(); if (adchoice2 != null) { this.b = adchoice2.b(); } if (TextUtils.isEmpty(this.b) && b != null) { this.b = b.i(); } } else if (b != null) { this.b = b.i(); } this.e = campaignEx; if (campaignEx != null) { CampaignEx.a adchoice3 = campaignEx.getAdchoice(); if (adchoice3 != null) { this.d = adchoice3.d(); } if (TextUtils.isEmpty(this.d) && b != null) { this.d = b.k(); } } else if (b != null) { this.d = b.k(); } boolean z = (TextUtils.isEmpty(this.b) || TextUtils.isEmpty(this.c) || TextUtils.isEmpty(this.d)) ? false : true; setImageUrl(this.b); if (!z || this.a == null) { return; } b.a(c.m().c()).a(this.b, new com.mbridge.msdk.foundation.same.c.c() { // from class: com.mbridge.msdk.widget.MBAdChoice.2 @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) { MBAdChoice.this.setImageBitmap(bitmap); } }); } }