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>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
package com.mbridge.msdk.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.widget.TextView;
import androidx.annotation.RequiresApi;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
@SuppressLint({"AppCompatCustomView"})
/* loaded from: classes4.dex */
public class FeedBackButton extends TextView {
public static String FEEDBACK_BTN_BACKGROUND_COLOR_STR = "#60000000";
public FeedBackButton(Context context) {
super(context);
a();
}
private void a() {
setText(x.a(getContext(), "mbridge_cm_feedback_btn_text", "string"));
int a = ak.a(getContext(), 13.0f);
setPadding(a, 0, a, 0);
setTextIsSelectable(false);
setGravity(17);
setBackgroundColor(Color.parseColor(FEEDBACK_BTN_BACKGROUND_COLOR_STR));
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setCornerRadius(ak.a(r0, 20.0f));
gradientDrawable.setColor(Color.parseColor(FEEDBACK_BTN_BACKGROUND_COLOR_STR));
setBackground(gradientDrawable);
setTextColor(-1);
}
public FeedBackButton(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
a();
}
public FeedBackButton(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
a();
}
@RequiresApi(api = 21)
public FeedBackButton(Context context, AttributeSet attributeSet, int i, int i2) {
super(context, attributeSet, i, i2);
a();
}
}

View File

@@ -0,0 +1,93 @@
package com.mbridge.msdk.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
/* loaded from: classes4.dex */
public class FeedbackRadioGroup extends RadioGroup {
public FeedbackRadioGroup(Context context) {
super(context);
}
public FeedbackRadioGroup(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
@Override // android.widget.LinearLayout, android.view.View
public void onMeasure(int i, int i2) {
int i3;
int size = View.MeasureSpec.getSize(i);
int mode = View.MeasureSpec.getMode(i);
int size2 = View.MeasureSpec.getSize(i2);
int mode2 = View.MeasureSpec.getMode(i2);
measureChildren(i, i2);
int childCount = getChildCount();
int i4 = 0;
int i5 = 0;
int i6 = 0;
int i7 = 0;
for (int i8 = 0; i8 < childCount; i8++) {
View childAt = getChildAt(i8);
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) childAt.getLayoutParams();
int measuredWidth = childAt.getMeasuredWidth() + marginLayoutParams.leftMargin + marginLayoutParams.rightMargin;
int i9 = i7 + measuredWidth;
if (getPaddingLeft() + i9 + getPaddingRight() > size) {
int max = Math.max(i7, i4);
i5 += i6;
i6 = childAt.getMeasuredHeight() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin;
StringBuilder sb = new StringBuilder();
sb.append("maxHeight:");
sb.append(i5);
sb.append("---maxWidth:");
sb.append(max);
i3 = max;
i7 = measuredWidth;
} else {
i6 = Math.max(i6, childAt.getMeasuredHeight() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin);
i3 = i4;
i7 = i9;
}
if (i8 == childCount - 1) {
i5 += i6;
i4 = Math.max(i7, i4);
} else {
i4 = i3;
}
}
int paddingLeft = i4 + getPaddingLeft() + getPaddingRight();
int paddingTop = i5 + getPaddingTop() + getPaddingBottom();
if (mode != 1073741824) {
size = paddingLeft;
}
if (mode2 != 1073741824) {
size2 = paddingTop;
}
setMeasuredDimension(size, size2);
}
@Override // android.widget.LinearLayout, android.view.ViewGroup, android.view.View
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
int childCount = getChildCount();
int paddingLeft = getPaddingLeft();
int paddingTop = getPaddingTop();
int i5 = 0;
for (int i6 = 0; i6 < childCount; i6++) {
View childAt = getChildAt(i6);
ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) childAt.getLayoutParams();
if (marginLayoutParams.leftMargin + paddingLeft + childAt.getMeasuredWidth() + marginLayoutParams.rightMargin + getPaddingRight() > i3 - i) {
paddingLeft = getPaddingLeft();
paddingTop += i5;
i5 = getChildAt(i6).getMeasuredHeight() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin;
} else {
i5 = Math.max(i5, childAt.getMeasuredHeight() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin);
}
int i7 = marginLayoutParams.leftMargin + paddingLeft;
int i8 = marginLayoutParams.topMargin + paddingTop;
childAt.layout(i7, i8, childAt.getMeasuredWidth() + i7, childAt.getMeasuredHeight() + i8);
paddingLeft += marginLayoutParams.leftMargin + childAt.getMeasuredWidth() + marginLayoutParams.rightMargin;
}
}
}

View File

@@ -0,0 +1,150 @@
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);
}
});
}
}

View File

@@ -0,0 +1,74 @@
package com.mbridge.msdk.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mbridge.msdk.foundation.same.c.b;
import com.mbridge.msdk.foundation.same.c.c;
import com.mbridge.msdk.foundation.tools.af;
@SuppressLint({"AppCompatCustomView"})
/* loaded from: classes4.dex */
public class MBImageView extends ImageView {
private Bitmap a;
private String b;
public void setImageUrl(String str) {
this.b = str;
}
public MBImageView(Context context) {
super(context);
this.a = null;
}
public MBImageView(Context context, @Nullable AttributeSet attributeSet) {
super(context, attributeSet);
this.a = null;
}
public MBImageView(Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
this.a = null;
}
@Override // android.widget.ImageView, android.view.View
public void onDraw(Canvas canvas) {
Bitmap bitmap = this.a;
if (bitmap != null && bitmap.isRecycled()) {
af.b("mb-widget-imageview", "onDraw bitmap recycled");
if (getContext() != null) {
b.a(getContext()).a(this.b, new c() { // from class: com.mbridge.msdk.widget.MBImageView.1
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onSuccessLoad(Bitmap bitmap2, String str) {
MBImageView.this.setImageBitmap(bitmap2);
}
@Override // com.mbridge.msdk.foundation.same.c.c
public final void onFailedLoad(String str, String str2) {
af.b("mb-widget-imageview", str2 + " load failed:" + str);
}
});
return;
}
return;
}
super.onDraw(canvas);
}
@Override // android.widget.ImageView
public void setImageBitmap(Bitmap bitmap) {
this.a = bitmap;
if (bitmap != null && bitmap.isRecycled()) {
this.a = null;
super.setImageBitmap(null);
af.b("mb-widget-imageview", "setImageBitmap recycled");
return;
}
super.setImageBitmap(bitmap);
}
}

View File

@@ -0,0 +1,21 @@
package com.mbridge.msdk.widget;
import android.view.View;
import java.util.Calendar;
/* loaded from: classes4.dex */
public abstract class a implements View.OnClickListener {
public static final int MIN_CLICK_DELAY_TIME = 2000;
private long lastClickTime = 0;
public abstract void onNoDoubleClick(View view);
@Override // android.view.View.OnClickListener
public void onClick(View view) {
long timeInMillis = Calendar.getInstance().getTimeInMillis();
if (timeInMillis - this.lastClickTime > 2000) {
this.lastClickTime = timeInMillis;
onNoDoubleClick(view);
}
}
}

View File

@@ -0,0 +1,289 @@
package com.mbridge.msdk.widget.dialog;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import androidx.core.view.InputDeviceCompat;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import com.mbridge.msdk.c.g;
import com.mbridge.msdk.c.h;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.an;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
import java.util.Locale;
import org.apache.http.protocol.HTTP;
/* loaded from: classes4.dex */
public class MBAlertDialog extends Dialog {
private Button a;
private Button b;
private TextView c;
private a d;
private TextView e;
public void clear() {
if (this.d != null) {
this.d = null;
}
}
public a getListener() {
return this.d;
}
public void makeDownloadAlert(String str) {
}
public void makeInsAlert(String str) {
}
public MBAlertDialog(Context context, final a aVar) {
super(context);
getWindow().setBackgroundDrawable(new ColorDrawable(0));
requestWindowFeature(1);
View inflate = LayoutInflater.from(context).inflate(x.a(context, "mbridge_cm_alertview", TtmlNode.TAG_LAYOUT), (ViewGroup) null);
this.d = aVar;
if (inflate != null) {
setContentView(inflate);
try {
this.e = (TextView) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_titleview", "id"));
} catch (Exception e) {
af.a("MBAlertDialog", e.getMessage());
}
try {
this.c = (TextView) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_contentview", "id"));
this.b = (Button) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_confirm_button", "id"));
this.a = (Button) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_cancel_button", "id"));
} catch (Exception e2) {
af.a("MBAlertDialog", e2.getMessage());
}
}
Button button = this.a;
if (button != null) {
button.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.widget.dialog.MBAlertDialog.1
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.a();
}
MBAlertDialog.this.cancel();
MBAlertDialog.this.clear();
}
});
}
Button button2 = this.b;
if (button2 != null) {
button2.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.widget.dialog.MBAlertDialog.2
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
a aVar2 = aVar;
if (aVar2 != null) {
aVar2.b();
}
MBAlertDialog.this.cancel();
MBAlertDialog.this.clear();
}
});
}
setCanceledOnTouchOutside(false);
setCancelable(false);
}
public void makeIVAlertView(int i, String str) {
try {
String obj = an.a(getContext(), "MBridge_ConfirmTitle" + str, "").toString();
String obj2 = an.a(getContext(), "MBridge_ConfirmContent" + str, "").toString();
String obj3 = an.a(getContext(), "MBridge_CancelText" + str, "").toString();
String obj4 = an.a(getContext(), "MBridge_ConfirmText" + str, "").toString();
if (!TextUtils.isEmpty(obj) || !TextUtils.isEmpty(obj2) || !TextUtils.isEmpty(obj3) || !TextUtils.isEmpty(obj4)) {
a(obj, obj2, obj3, obj4);
} else {
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
setTitle(i == com.mbridge.msdk.foundation.same.a.H ? "确认关闭?" : "提示");
setContent(i == com.mbridge.msdk.foundation.same.a.H ? "如果你选择继续,结束后将会获得奖励。确认关闭吗?" : "如果你选择继续,结束后将会获得奖励。是否继续?");
setConfirmText(i == com.mbridge.msdk.foundation.same.a.H ? "确认关闭" : "取消");
setCancelText("继续");
} else {
setTitle(i == com.mbridge.msdk.foundation.same.a.H ? "Confirm" : "Tips");
setContent(i == com.mbridge.msdk.foundation.same.a.H ? "If you choose to continue, you will receive a reward after the end. Confirm closed?" : "If you choose to continue, you will receive a reward after the end. Whether to continue?");
setConfirmText(i == com.mbridge.msdk.foundation.same.a.H ? HTTP.CONN_CLOSE : "Cancel");
setCancelText("Continue");
}
}
} catch (Exception e) {
af.a("MBAlertDialog", e.getMessage());
}
}
private void a(String str, String str2, String str3, String str4) {
setTitle(str);
setContent(str2);
setConfirmText(str3);
setCancelText(str4);
}
public void setTitle(String str) {
TextView textView = this.e;
if (textView != null) {
textView.setText(str);
}
}
public void setContent(String str) {
TextView textView = this.c;
if (textView != null) {
textView.setText(str);
}
}
public void setConfirmText(String str) {
Button button = this.b;
if (button != null) {
button.setText(str);
}
}
public void setCancelText(String str) {
Button button = this.a;
if (button != null) {
button.setText(str);
}
}
public void makePlayableAlertView() {
g b = h.a().b(c.m().k());
if (b != null) {
a(b.z(), b.x(), b.y(), b.v());
return;
}
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
setTitle("确认关闭?");
setContent("关闭后您将不会获得任何奖励噢~ ");
setConfirmText("确认关闭");
setCancelText("继续试玩");
return;
}
setTitle("Confirm to close? ");
setContent("You will not be rewarded after closing the window");
setConfirmText("Close it");
setCancelText("Continue");
}
public void makeRVAlertView(String str) {
try {
String obj = an.a(getContext(), "MBridge_ConfirmTitle" + str, "").toString();
String obj2 = an.a(getContext(), "MBridge_ConfirmContent" + str, "").toString();
String obj3 = an.a(getContext(), "MBridge_CancelText" + str, "").toString();
String obj4 = an.a(getContext(), "MBridge_ConfirmText" + str, "").toString();
g b = h.a().b(c.m().k());
if (TextUtils.isEmpty(obj) && TextUtils.isEmpty(obj2) && TextUtils.isEmpty(obj3) && TextUtils.isEmpty(obj4)) {
if (b != null) {
a(b.z(), b.x(), b.y(), b.w());
return;
}
String language = Locale.getDefault().getLanguage();
if (!TextUtils.isEmpty(language) && language.equals("zh")) {
setTitle("确认关闭?");
setContent("关闭后您将不会获得任何奖励噢~ ");
setConfirmText("确认关闭");
setCancelText("继续观看");
return;
}
setTitle("Confirm to close? ");
setContent("You will not be rewarded after closing the window");
setConfirmText("Close it");
setCancelText("Continue");
return;
}
String language2 = Locale.getDefault().getLanguage();
if (TextUtils.isEmpty(obj)) {
if (b != null) {
obj = b.z();
} else if (!TextUtils.isEmpty(language2) && language2.equals("zh")) {
setTitle("确认关闭?");
} else {
setTitle("Confirm to close? ");
}
}
if (TextUtils.isEmpty(obj2)) {
if (b != null) {
obj2 = b.x();
} else if (!TextUtils.isEmpty(language2) && language2.equals("zh")) {
setContent("关闭后您将不会获得任何奖励噢~ ");
} else {
setContent("You will not be rewarded after closing the window");
}
}
if (TextUtils.isEmpty(obj4)) {
if (b != null) {
obj4 = b.y();
} else if (!TextUtils.isEmpty(language2) && language2.equals("zh")) {
setConfirmText("确认关闭");
} else {
setConfirmText("Close it");
}
}
if (TextUtils.isEmpty(obj3)) {
if (b != null) {
obj3 = b.w();
} else if (!TextUtils.isEmpty(language2) && language2.equals("zh")) {
setCancelText("继续观看");
} else {
setCancelText("Continue");
}
}
a(obj, obj2, obj4, obj3);
} catch (Exception e) {
af.a("MBAlertDialog", e.getMessage());
}
}
public void onlyShow() {
super.show();
}
@Override // android.app.Dialog
public void show() {
super.show();
try {
getWindow().setFlags(8, 8);
super.show();
hideNavigationBar(getWindow());
getWindow().clearFlags(8);
} catch (Exception e) {
af.b("MBAlertDialog", e.getMessage());
super.show();
}
}
public void hideNavigationBar(Window window) {
if (window != null) {
window.setFlags(1024, 1024);
int i = Build.VERSION.SDK_INT;
window.addFlags(AccessibilityEventCompat.TYPE_VIEW_TARGETED_BY_SCROLL);
window.getDecorView().setSystemUiVisibility(InputDeviceCompat.SOURCE_TOUCHSCREEN);
if (i >= 28) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.layoutInDisplayCutoutMode = 1;
window.setAttributes(attributes);
}
window.setBackgroundDrawable(new ColorDrawable(0));
window.setLayout(-1, -1);
window.setGravity(17);
}
}
}

View File

@@ -0,0 +1,231 @@
package com.mbridge.msdk.widget.dialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.view.InputDeviceCompat;
import androidx.core.view.accessibility.AccessibilityEventCompat;
import com.mbridge.msdk.foundation.controller.c;
import com.mbridge.msdk.foundation.tools.af;
import com.mbridge.msdk.foundation.tools.ak;
import com.mbridge.msdk.foundation.tools.x;
import com.mbridge.msdk.playercommon.exoplayer2.text.ttml.TtmlNode;
/* loaded from: classes4.dex */
public class MBFeedBackDialog extends Dialog {
private Button a;
private Button b;
private LinearLayout c;
private a d;
private Button e;
private TextView f;
private int g;
private int h;
public void clear() {
if (this.d != null) {
this.d = null;
}
}
public a getListener() {
return this.d;
}
public void setConfirmText(String str) {
}
public void setListener(a aVar) {
this.d = aVar;
}
public MBFeedBackDialog(Context context, a aVar) {
super(context);
getWindow().setBackgroundDrawable(new ColorDrawable(0));
requestWindowFeature(1);
View inflate = LayoutInflater.from(context).inflate(x.a(context, "mbridge_cm_feedbackview", TtmlNode.TAG_LAYOUT), (ViewGroup) null);
setDialogWidthAndHeight(0.5f, 0.8f);
this.d = aVar;
if (inflate != null) {
setContentView(inflate);
try {
this.f = (TextView) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_titleview", "id"));
} catch (Exception e) {
af.a("MBAlertDialog", e.getMessage());
}
try {
this.c = (LinearLayout) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_contentview", "id"));
this.b = (Button) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_confirm_button", "id"));
this.a = (Button) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_cancel_button", "id"));
this.e = (Button) inflate.findViewById(x.a(context, "mbridge_video_common_alertview_private_action_button", "id"));
} catch (Exception e2) {
af.a("MBAlertDialog", e2.getMessage());
}
}
setCanceledOnTouchOutside(false);
setCancelable(false);
Button button = this.a;
if (button != null) {
button.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.widget.dialog.MBFeedBackDialog.1
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBFeedBackDialog.this.d != null) {
MBFeedBackDialog.this.d.a();
}
MBFeedBackDialog.this.dismiss();
}
});
}
Button button2 = this.b;
if (button2 != null) {
button2.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.widget.dialog.MBFeedBackDialog.2
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
if (MBFeedBackDialog.this.d != null) {
MBFeedBackDialog.this.d.b();
}
MBFeedBackDialog.this.dismiss();
}
});
}
Button button3 = this.e;
if (button3 != null) {
button3.setOnClickListener(new View.OnClickListener() { // from class: com.mbridge.msdk.widget.dialog.MBFeedBackDialog.3
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
MBFeedBackDialog.this.dismiss();
if (MBFeedBackDialog.this.d != null) {
MBFeedBackDialog.this.d.c();
}
}
});
}
setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.mbridge.msdk.widget.dialog.MBFeedBackDialog.4
@Override // android.content.DialogInterface.OnCancelListener
public final void onCancel(DialogInterface dialogInterface) {
if (MBFeedBackDialog.this.d != null) {
MBFeedBackDialog.this.d.b();
}
}
});
}
public void setDialogWidthAndHeight(float f, float f2) {
DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
if (isScreenOrientationPortrait(getContext())) {
this.h = displayMetrics.widthPixels;
this.g = displayMetrics.heightPixels;
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.width = -1;
attributes.height = (int) (this.g * f2);
attributes.gravity = 80;
getWindow().setAttributes(attributes);
return;
}
this.h = displayMetrics.heightPixels;
this.g = displayMetrics.widthPixels;
WindowManager.LayoutParams attributes2 = getWindow().getAttributes();
attributes2.width = (int) (this.g * f);
attributes2.height = -1;
attributes2.gravity = 17;
getWindow().setAttributes(attributes2);
}
public static boolean isScreenOrientationPortrait(Context context) {
return context.getResources().getConfiguration().orientation == 1;
}
public void setTitle(String str) {
TextView textView = this.f;
if (textView != null) {
textView.setText(str);
}
}
public void setContent(ViewGroup viewGroup) {
LinearLayout linearLayout = this.c;
if (linearLayout != null) {
linearLayout.removeAllViews();
ViewGroup viewGroup2 = (ViewGroup) viewGroup.getParent();
if (viewGroup2 != null) {
viewGroup2.removeView(viewGroup);
}
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
layoutParams.leftMargin = ak.a(c.m().c(), 16.0f);
layoutParams.rightMargin = ak.a(c.m().c(), 16.0f);
layoutParams.topMargin = ak.a(c.m().c(), 3.0f);
layoutParams.bottomMargin = ak.a(c.m().c(), 3.0f);
this.c.addView(viewGroup, layoutParams);
}
}
public void setCancelText(String str) {
Button button = this.a;
if (button != null) {
button.setText(str);
}
}
public void setCancelButtonClickable(boolean z) {
Button button = this.a;
if (button != null) {
button.setClickable(z);
if (z) {
this.a.setBackgroundResource(getContext().getResources().getIdentifier("mbridge_cm_feedback_choice_btn_bg_pressed", "drawable", c.m().g()));
this.a.setAlpha(1.0f);
} else {
this.a.setBackgroundResource(getContext().getResources().getIdentifier("mbridge_cm_feedback_choice_btn_bg_pressed", "drawable", c.m().g()));
this.a.setAlpha(0.4f);
}
}
}
public void setPrivacyText(String str) {
Button button = this.e;
if (button != null) {
button.setText(str);
}
}
@Override // android.app.Dialog
public void show() {
super.show();
try {
getWindow().setFlags(8, 8);
super.show();
hideNavigationBar(getWindow());
getWindow().clearFlags(8);
} catch (Exception e) {
af.b("MBAlertDialog", e.getMessage());
super.show();
}
}
public void hideNavigationBar(Window window) {
if (window != null) {
window.setFlags(1024, 1024);
int i = Build.VERSION.SDK_INT;
window.addFlags(AccessibilityEventCompat.TYPE_VIEW_TARGETED_BY_SCROLL);
window.getDecorView().setSystemUiVisibility(InputDeviceCompat.SOURCE_TOUCHSCREEN);
if (i >= 28) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.layoutInDisplayCutoutMode = 1;
window.setAttributes(attributes);
}
window.setBackgroundDrawable(new ColorDrawable(0));
window.setLayout(-1, -1);
window.setGravity(17);
}
}
}

View File

@@ -0,0 +1,10 @@
package com.mbridge.msdk.widget.dialog;
/* loaded from: classes4.dex */
public interface a {
void a();
void b();
void c();
}