- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
258 lines
10 KiB
Java
258 lines
10 KiB
Java
package com.mbridge.msdk.video.module;
|
|
|
|
import android.animation.ObjectAnimator;
|
|
import android.content.Context;
|
|
import android.content.res.Configuration;
|
|
import android.text.TextUtils;
|
|
import android.util.AttributeSet;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import com.mbridge.msdk.foundation.entity.CampaignEx;
|
|
import com.mbridge.msdk.foundation.same.report.i;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.video.dynview.e.h;
|
|
import com.mbridge.msdk.video.dynview.j.c;
|
|
import com.mbridge.msdk.video.module.a.a.e;
|
|
import com.mbridge.msdk.video.signal.factory.b;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class MBridgeClickCTAView extends MBridgeClickCTAViewDiff {
|
|
public a ctaClickCallBack;
|
|
private ViewGroup m;
|
|
private ImageView n;
|
|
private TextView o;
|
|
private TextView p;
|
|
private String q;
|
|
private float r;
|
|
private float s;
|
|
private int t;
|
|
private ObjectAnimator u;
|
|
|
|
public interface a {
|
|
void ctaClick();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.module.MBridgeClickCTAViewDiff, com.mbridge.msdk.video.module.MBridgeBaseView
|
|
public void init(Context context) {
|
|
}
|
|
|
|
public void setCtaClickCallBack(a aVar) {
|
|
this.ctaClickCallBack = aVar;
|
|
}
|
|
|
|
public void setObjectAnimator(ObjectAnimator objectAnimator) {
|
|
this.u = objectAnimator;
|
|
}
|
|
|
|
public void setUnitId(String str) {
|
|
this.q = str;
|
|
}
|
|
|
|
public MBridgeClickCTAView(Context context) {
|
|
super(context);
|
|
}
|
|
|
|
public MBridgeClickCTAView(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
|
|
public final void c() {
|
|
super.c();
|
|
if (this.e) {
|
|
CampaignEx campaignEx = this.b;
|
|
if (campaignEx != null && campaignEx.isDynamicView()) {
|
|
setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeClickCTAView.2
|
|
@Override // com.mbridge.msdk.widget.a
|
|
public final void onNoDoubleClick(View view) {
|
|
MBridgeClickCTAView mBridgeClickCTAView = MBridgeClickCTAView.this;
|
|
a aVar = mBridgeClickCTAView.ctaClickCallBack;
|
|
if (aVar != null) {
|
|
aVar.ctaClick();
|
|
} else {
|
|
MBridgeClickCTAView.b(mBridgeClickCTAView);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
this.ctaTv.setOnClickListener(new com.mbridge.msdk.widget.a() { // from class: com.mbridge.msdk.video.module.MBridgeClickCTAView.3
|
|
@Override // com.mbridge.msdk.widget.a
|
|
public final void onNoDoubleClick(View view) {
|
|
MBridgeClickCTAView mBridgeClickCTAView = MBridgeClickCTAView.this;
|
|
a aVar = mBridgeClickCTAView.ctaClickCallBack;
|
|
if (aVar != null) {
|
|
aVar.ctaClick();
|
|
} else {
|
|
MBridgeClickCTAView.b(mBridgeClickCTAView);
|
|
}
|
|
}
|
|
});
|
|
ImageView imageView = this.n;
|
|
if (imageView != null) {
|
|
imageView.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.video.module.MBridgeClickCTAView.4
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.module.MBridgeClickCTAViewDiff
|
|
public void preLoadData(b bVar) {
|
|
CampaignEx campaignEx = this.b;
|
|
if (campaignEx != null) {
|
|
if (campaignEx.isDynamicView()) {
|
|
com.mbridge.msdk.video.dynview.b.a().a(new c().b(this, this.b), new h() { // from class: com.mbridge.msdk.video.module.MBridgeClickCTAView.1
|
|
@Override // com.mbridge.msdk.video.dynview.e.h
|
|
public final void viewInflaterSuccess(com.mbridge.msdk.video.dynview.a aVar) {
|
|
if (aVar != null) {
|
|
this.addView(aVar.a());
|
|
MBridgeClickCTAView mBridgeClickCTAView = MBridgeClickCTAView.this;
|
|
mBridgeClickCTAView.e = mBridgeClickCTAView.b();
|
|
MBridgeClickCTAView mBridgeClickCTAView2 = MBridgeClickCTAView.this;
|
|
mBridgeClickCTAView2.p = (TextView) mBridgeClickCTAView2.findViewById(mBridgeClickCTAView2.findID("mbridge_tv_desc"));
|
|
MBridgeClickCTAView.this.c();
|
|
}
|
|
}
|
|
|
|
@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());
|
|
}
|
|
});
|
|
} else {
|
|
int findLayout = findLayout("mbridge_reward_clickable_cta");
|
|
if (findLayout >= 0) {
|
|
this.c.inflate(findLayout, this);
|
|
this.e = b();
|
|
c();
|
|
setWrapContent();
|
|
}
|
|
}
|
|
if (this.e) {
|
|
if (com.mbridge.msdk.e.b.a()) {
|
|
setChinaCTAData();
|
|
}
|
|
this.ctaTv.setText(this.b.getAdCall());
|
|
if (!TextUtils.isEmpty(this.b.getIconUrl())) {
|
|
com.mbridge.msdk.foundation.same.c.b.a(this.a.getApplicationContext()).a(this.b.getIconUrl(), new e(this.n, this.b, this.q) { // from class: com.mbridge.msdk.video.module.MBridgeClickCTAView.5
|
|
@Override // com.mbridge.msdk.video.module.a.a.e, com.mbridge.msdk.foundation.same.c.c
|
|
public final void onFailedLoad(String str, String str2) {
|
|
super.onFailedLoad(str, str2);
|
|
MBridgeClickCTAView.this.a();
|
|
}
|
|
});
|
|
} else {
|
|
a();
|
|
}
|
|
if (this.o != null && !TextUtils.isEmpty(this.b.getAppName())) {
|
|
this.o.setText(this.b.getAppName());
|
|
}
|
|
if (this.p == null || TextUtils.isEmpty(this.b.getAppDesc())) {
|
|
return;
|
|
}
|
|
this.p.setText(this.b.getAppDesc());
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.module.MBridgeBaseView
|
|
public void onSelfConfigurationChanged(Configuration configuration) {
|
|
super.onSelfConfigurationChanged(configuration);
|
|
this.t = configuration.orientation;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void a() {
|
|
ImageView imageView = this.n;
|
|
if (imageView != null) {
|
|
imageView.setVisibility(8);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public boolean b() {
|
|
this.m = (ViewGroup) findViewById(findID("mbridge_viewgroup_ctaroot"));
|
|
this.n = (ImageView) findViewById(findID("mbridge_iv_appicon"));
|
|
this.o = (TextView) findViewById(findID("mbridge_tv_title"));
|
|
TextView textView = (TextView) findViewById(findID("mbridge_tv_install"));
|
|
this.ctaTv = textView;
|
|
return isNotNULL(this.m, this.n, this.o, textView);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.module.MBridgeBaseView, android.view.ViewGroup
|
|
public boolean onInterceptTouchEvent(MotionEvent motionEvent) {
|
|
this.r = motionEvent.getRawX();
|
|
this.s = motionEvent.getRawY();
|
|
return super.onInterceptTouchEvent(motionEvent);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void onAttachedToWindow() {
|
|
super.onAttachedToWindow();
|
|
ObjectAnimator objectAnimator = this.u;
|
|
if (objectAnimator != null) {
|
|
try {
|
|
objectAnimator.start();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
ObjectAnimator objectAnimator = this.u;
|
|
if (objectAnimator != null) {
|
|
try {
|
|
objectAnimator.cancel();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ void b(MBridgeClickCTAView mBridgeClickCTAView) {
|
|
JSONObject jSONObject;
|
|
JSONException e;
|
|
CampaignEx campaignEx = mBridgeClickCTAView.b;
|
|
if (campaignEx != null && campaignEx.isDynamicView()) {
|
|
try {
|
|
CampaignEx.c rewardTemplateMode = mBridgeClickCTAView.b.getRewardTemplateMode();
|
|
String str = "";
|
|
if (rewardTemplateMode != null) {
|
|
str = rewardTemplateMode.f() + "";
|
|
}
|
|
i.a(com.mbridge.msdk.foundation.controller.c.m().c(), "cta_click", mBridgeClickCTAView.b.getCampaignUnitId(), mBridgeClickCTAView.b.isBidCampaign(), mBridgeClickCTAView.b.getRequestId(), mBridgeClickCTAView.b.getRequestIdNotice(), mBridgeClickCTAView.b.getId(), str);
|
|
} catch (Exception e2) {
|
|
e2.printStackTrace();
|
|
}
|
|
}
|
|
try {
|
|
jSONObject = new JSONObject();
|
|
try {
|
|
jSONObject.put(com.mbridge.msdk.foundation.same.a.j, mBridgeClickCTAView.a(0));
|
|
} catch (JSONException e3) {
|
|
e = e3;
|
|
e.printStackTrace();
|
|
mBridgeClickCTAView.b.setTriggerClickSource(1);
|
|
mBridgeClickCTAView.b.setClickTempSource(1);
|
|
mBridgeClickCTAView.notifyListener.a(105, jSONObject);
|
|
}
|
|
} catch (JSONException e4) {
|
|
jSONObject = null;
|
|
e = e4;
|
|
}
|
|
mBridgeClickCTAView.b.setTriggerClickSource(1);
|
|
mBridgeClickCTAView.b.setClickTempSource(1);
|
|
mBridgeClickCTAView.notifyListener.a(105, jSONObject);
|
|
}
|
|
}
|