- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
329 lines
15 KiB
Java
329 lines
15 KiB
Java
package com.mbridge.msdk.video.dynview.j;
|
|
|
|
import android.animation.Animator;
|
|
import android.animation.AnimatorSet;
|
|
import android.animation.ObjectAnimator;
|
|
import android.content.Context;
|
|
import android.graphics.Color;
|
|
import android.graphics.drawable.GradientDrawable;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.view.animation.AlphaAnimation;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.dycreator.baseview.MBFrameLayout;
|
|
import com.mbridge.msdk.dycreator.baseview.MBStarLevelLayoutView;
|
|
import com.mbridge.msdk.dycreator.baseview.MBTextView;
|
|
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeFramLayout;
|
|
import com.mbridge.msdk.dycreator.baseview.cusview.MBridgeTextView;
|
|
import com.mbridge.msdk.foundation.tools.ak;
|
|
import com.mbridge.msdk.foundation.tools.x;
|
|
import com.mbridge.msdk.video.dynview.widget.MBridgeLevelLayoutView;
|
|
import com.mbridge.msdk.video.dynview.widget.MBridgeRelativeLayout;
|
|
import com.mbridge.msdk.video.module.MBridgeClickCTAView;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class b {
|
|
private String a = "mbridge_top_play_bg";
|
|
private String b = "mbridge_top_finger_bg";
|
|
private String c = "mbridge_bottom_play_bg";
|
|
private String d = "mbridge_bottom_finger_bg";
|
|
private String e = "mbridge_tv_count";
|
|
private String f = "mbridge_sound_switch";
|
|
private String g = "mbridge_top_control";
|
|
private String h = "mbridge_tv_title";
|
|
private String i = "mbridge_tv_desc";
|
|
private String j = "mbridge_tv_install";
|
|
private String k = "mbridge_sv_starlevel";
|
|
private String l = "mbridge_sv_heat_count_level";
|
|
private String m = "mbridge_tv_cta";
|
|
private String n = "mbridge_native_ec_controller";
|
|
private String o = "mbridge_reward_shape_choice_rl";
|
|
private String p = "#FFFFFF";
|
|
private String q = "#FF000000";
|
|
private String r = "#40000000";
|
|
private String s = "#CAEF79";
|
|
private String t = "#2196F3";
|
|
private String u = "#402196F3";
|
|
private String v = "#8FC31F";
|
|
private String w = "#03A9F4";
|
|
private String x = "#FF89C120";
|
|
private String y = "#FF2BAE5D";
|
|
private boolean z = false;
|
|
|
|
public final void a(View view, Map<String, Object> map) {
|
|
ImageView imageView;
|
|
ImageView imageView2;
|
|
ImageView imageView3;
|
|
ImageView imageView4;
|
|
if (view == null || !(view instanceof MBridgeFramLayout)) {
|
|
return;
|
|
}
|
|
MBridgeFramLayout mBridgeFramLayout = (MBridgeFramLayout) view;
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
if (view.getContext() != null) {
|
|
if (map != null && map.containsKey("is_dy_success")) {
|
|
this.z = ((Boolean) map.get("is_dy_success")).booleanValue();
|
|
}
|
|
if (this.z) {
|
|
imageView = (ImageView) view.findViewById(b(this.a));
|
|
imageView2 = (ImageView) view.findViewById(b(this.b));
|
|
imageView3 = (ImageView) view.findViewById(b(this.c));
|
|
imageView4 = (ImageView) view.findViewById(b(this.d));
|
|
} else {
|
|
imageView = (ImageView) view.findViewById(a(this.a));
|
|
imageView2 = (ImageView) view.findViewById(a(this.b));
|
|
imageView3 = (ImageView) view.findViewById(a(this.c));
|
|
imageView4 = (ImageView) view.findViewById(a(this.d));
|
|
}
|
|
ObjectAnimator a = imageView != null ? new com.mbridge.msdk.video.dynview.h.b().a(imageView) : null;
|
|
ObjectAnimator b = imageView2 != null ? new com.mbridge.msdk.video.dynview.h.b().b(imageView2) : null;
|
|
ObjectAnimator a2 = imageView3 != null ? new com.mbridge.msdk.video.dynview.h.b().a(imageView3) : null;
|
|
ObjectAnimator b2 = imageView4 != null ? new com.mbridge.msdk.video.dynview.h.b().b(imageView4) : null;
|
|
if (a == null || a2 == null || b == null || b2 == null) {
|
|
return;
|
|
}
|
|
animatorSet.playTogether(a, a2, b, b2);
|
|
mBridgeFramLayout.setAnimatorSet(animatorSet);
|
|
}
|
|
}
|
|
|
|
public final void a(View view, com.mbridge.msdk.video.dynview.c cVar, Map<String, Object> map) {
|
|
TextView textView;
|
|
TextView textView2;
|
|
String str;
|
|
String str2;
|
|
RelativeLayout relativeLayout;
|
|
RelativeLayout.LayoutParams layoutParams;
|
|
Context context = view != null ? view.getContext() : null;
|
|
if (context == null || cVar == null) {
|
|
return;
|
|
}
|
|
if (map != null && map.containsKey("is_dy_success")) {
|
|
boolean booleanValue = ((Boolean) map.get("is_dy_success")).booleanValue();
|
|
this.z = booleanValue;
|
|
if (booleanValue) {
|
|
textView = (TextView) view.findViewById(b(this.e));
|
|
textView2 = (TextView) view.findViewById(b("mbridge_reward_click_tv"));
|
|
} else {
|
|
textView = (TextView) view.findViewById(a(this.e));
|
|
textView2 = (TextView) view.findViewById(a("mbridge_reward_click_tv"));
|
|
}
|
|
} else {
|
|
textView = (TextView) view.findViewById(a(this.e));
|
|
textView2 = (TextView) view.findViewById(a("mbridge_reward_click_tv"));
|
|
}
|
|
if (textView != null) {
|
|
textView.setBackgroundResource(x.a(context, "mbridge_reward_shape_progress", "drawable"));
|
|
textView.setTextColor(Color.parseColor(this.p));
|
|
textView.setTextSize(11.0f);
|
|
}
|
|
if (textView2 != null) {
|
|
textView2.setTextSize(20.0f);
|
|
if (textView2 instanceof MBridgeTextView) {
|
|
((MBridgeTextView) textView2).setObjectAnimator(new com.mbridge.msdk.video.dynview.h.b().c(textView2));
|
|
}
|
|
if (textView2 instanceof MBTextView) {
|
|
((MBTextView) textView2).setAnimator(new com.mbridge.msdk.video.dynview.h.b().c(textView2));
|
|
}
|
|
}
|
|
String str3 = this.q;
|
|
String str4 = this.s;
|
|
int i = cVar.i();
|
|
float f = 10.0f;
|
|
float f2 = 1.0f;
|
|
if (i == 302) {
|
|
str = this.t;
|
|
str2 = this.w;
|
|
str3 = this.p;
|
|
str4 = this.u;
|
|
} else if (i == 802) {
|
|
str = this.p;
|
|
str3 = this.q;
|
|
str4 = this.r;
|
|
f = 25.0f;
|
|
f2 = 0.5f;
|
|
str2 = str;
|
|
} else if (i != 5002010) {
|
|
str = this.v;
|
|
str2 = this.s;
|
|
f = 5.0f;
|
|
} else {
|
|
str = this.v;
|
|
str3 = this.p;
|
|
str4 = str;
|
|
str2 = str4;
|
|
}
|
|
if (textView2 != null) {
|
|
textView2.setTextColor(Color.parseColor(str3));
|
|
com.mbridge.msdk.video.dynview.i.b.a.a(textView2, f2, f, str4, new String[]{str, str2}, GradientDrawable.Orientation.LEFT_RIGHT);
|
|
}
|
|
if (cVar.f() != null && (layoutParams = (RelativeLayout.LayoutParams) cVar.f().getLayoutParams()) != null) {
|
|
layoutParams.setMargins(0, 0, 0, 0);
|
|
cVar.f().setLayoutParams(layoutParams);
|
|
}
|
|
if (this.z) {
|
|
relativeLayout = (RelativeLayout) view.findViewById(b(this.g));
|
|
} else {
|
|
relativeLayout = (RelativeLayout) view.findViewById(a(this.g));
|
|
}
|
|
if (relativeLayout != null) {
|
|
if (com.mbridge.msdk.video.dynview.a.a.a == 0 && com.mbridge.msdk.video.dynview.a.a.b == 0 && com.mbridge.msdk.video.dynview.a.a.c == 0 && com.mbridge.msdk.video.dynview.a.a.d == 0) {
|
|
return;
|
|
}
|
|
relativeLayout.setVisibility(4);
|
|
AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 100.0f);
|
|
alphaAnimation.setDuration(200L);
|
|
relativeLayout.startAnimation(alphaAnimation);
|
|
relativeLayout.setVisibility(0);
|
|
}
|
|
}
|
|
|
|
public final void a(View view, com.mbridge.msdk.video.dynview.c cVar) {
|
|
Context context;
|
|
int a;
|
|
if (view == null || cVar == null || (context = view.getContext()) == null) {
|
|
return;
|
|
}
|
|
if (cVar.e() == 1) {
|
|
view.setBackground(context.getResources().getDrawable(x.a(context, this.o, "drawable")));
|
|
TextView textView = (TextView) view.findViewById(a(this.h));
|
|
if (textView != null) {
|
|
textView.setTextColor(Color.parseColor(this.q));
|
|
}
|
|
TextView textView2 = (TextView) view.findViewById(a(this.i));
|
|
if (textView2 != null) {
|
|
textView2.setTextColor(Color.parseColor(this.q));
|
|
}
|
|
a = ak.a(context, 2.0f);
|
|
} else {
|
|
a = ak.a(context, 10.0f);
|
|
view.getBackground().setAlpha(100);
|
|
}
|
|
int a2 = ak.a(context, 8.0f);
|
|
View findViewById = view.findViewById(a(this.j));
|
|
if (findViewById != null) {
|
|
if (cVar.f() != null && (cVar.f() instanceof MBridgeClickCTAView)) {
|
|
((MBridgeClickCTAView) cVar.f()).setObjectAnimator(new com.mbridge.msdk.video.dynview.h.b().c(findViewById));
|
|
}
|
|
if (findViewById instanceof TextView) {
|
|
TextView textView3 = (TextView) findViewById;
|
|
textView3.setTextColor(Color.parseColor(this.p));
|
|
textView3.setTextSize(15.0f);
|
|
String str = this.v;
|
|
String str2 = this.s;
|
|
com.mbridge.msdk.video.dynview.i.b.a.a(textView3, 1.0f, 5.0f, str2, new String[]{str, str2}, GradientDrawable.Orientation.LEFT_RIGHT);
|
|
}
|
|
}
|
|
if (view.getLayoutParams() == null) {
|
|
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-2, -2);
|
|
layoutParams.setMargins(a, a, a, a2);
|
|
layoutParams.height = ak.a(context, 60.0f);
|
|
view.setLayoutParams(layoutParams);
|
|
}
|
|
}
|
|
|
|
public final void b(View view, com.mbridge.msdk.video.dynview.c cVar, Map<String, Object> map) {
|
|
LinearLayout linearLayout;
|
|
View findViewById;
|
|
if (view == null || cVar == null) {
|
|
return;
|
|
}
|
|
if (view.getContext() != null) {
|
|
if (map != null && map.containsKey("is_dy_success")) {
|
|
this.z = ((Boolean) map.get("is_dy_success")).booleanValue();
|
|
}
|
|
if (this.z) {
|
|
linearLayout = (LinearLayout) view.findViewById(b(this.k));
|
|
findViewById = view.findViewById(b(this.m));
|
|
} else {
|
|
linearLayout = (LinearLayout) view.findViewById(a(this.k));
|
|
findViewById = view.findViewById(a(this.m));
|
|
}
|
|
View view2 = findViewById;
|
|
if (linearLayout != null && (linearLayout instanceof MBridgeLevelLayoutView)) {
|
|
if (cVar.e() == 1) {
|
|
linearLayout.setOrientation(1);
|
|
} else {
|
|
linearLayout.setOrientation(0);
|
|
}
|
|
}
|
|
if (linearLayout != null && (linearLayout instanceof MBStarLevelLayoutView)) {
|
|
linearLayout.setOrientation(0);
|
|
}
|
|
RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(a(this.n));
|
|
if (relativeLayout != null) {
|
|
if (relativeLayout.getLayoutParams() instanceof RelativeLayout.LayoutParams) {
|
|
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) relativeLayout.getLayoutParams();
|
|
layoutParams.setMargins(layoutParams.leftMargin + com.mbridge.msdk.video.dynview.a.a.a, layoutParams.topMargin + com.mbridge.msdk.video.dynview.a.a.c, layoutParams.rightMargin + com.mbridge.msdk.video.dynview.a.a.b, layoutParams.bottomMargin + com.mbridge.msdk.video.dynview.a.a.d);
|
|
relativeLayout.setLayoutParams(layoutParams);
|
|
}
|
|
if (relativeLayout.getLayoutParams() instanceof FrameLayout.LayoutParams) {
|
|
FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) relativeLayout.getLayoutParams();
|
|
layoutParams2.setMargins(layoutParams2.leftMargin + com.mbridge.msdk.video.dynview.a.a.a, layoutParams2.topMargin + com.mbridge.msdk.video.dynview.a.a.c, layoutParams2.rightMargin + com.mbridge.msdk.video.dynview.a.a.b, layoutParams2.bottomMargin + com.mbridge.msdk.video.dynview.a.a.d);
|
|
relativeLayout.setLayoutParams(layoutParams2);
|
|
}
|
|
}
|
|
if (view2 != null) {
|
|
if (view2 instanceof TextView) {
|
|
TextView textView = (TextView) view2;
|
|
textView.setTextColor(Color.parseColor(this.p));
|
|
textView.setTextSize(22.0f);
|
|
com.mbridge.msdk.video.dynview.i.b.a.a(view2, 1.0f, cVar.i() == 1302 ? 25 : 5, this.s, new String[]{this.x, this.y}, GradientDrawable.Orientation.LEFT_RIGHT);
|
|
}
|
|
try {
|
|
AnimatorSet animatorSet = new AnimatorSet();
|
|
animatorSet.playTogether(new com.mbridge.msdk.video.dynview.h.b().c(view2));
|
|
animatorSet.addListener(new Animator.AnimatorListener() { // from class: com.mbridge.msdk.video.dynview.j.b.1
|
|
@Override // android.animation.Animator.AnimatorListener
|
|
public final void onAnimationCancel(Animator animator) {
|
|
}
|
|
|
|
@Override // android.animation.Animator.AnimatorListener
|
|
public final void onAnimationEnd(Animator animator) {
|
|
}
|
|
|
|
@Override // android.animation.Animator.AnimatorListener
|
|
public final void onAnimationRepeat(Animator animator) {
|
|
}
|
|
|
|
@Override // android.animation.Animator.AnimatorListener
|
|
public final void onAnimationStart(Animator animator) {
|
|
}
|
|
});
|
|
if (view instanceof MBFrameLayout) {
|
|
((MBFrameLayout) view).setAnimator(animatorSet);
|
|
}
|
|
if (view instanceof MBridgeFramLayout) {
|
|
((MBridgeFramLayout) view).setAnimatorSet(animatorSet);
|
|
}
|
|
if (view instanceof MBridgeRelativeLayout) {
|
|
((MBridgeRelativeLayout) view).setAnimatorSet(animatorSet);
|
|
}
|
|
} catch (Exception e) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
new com.mbridge.msdk.video.dynview.h.b().c(view, 500L);
|
|
}
|
|
|
|
private int a(String str) {
|
|
return x.a(com.mbridge.msdk.foundation.controller.c.m().c(), str, "id");
|
|
}
|
|
|
|
private int b(String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
return -1;
|
|
}
|
|
return str.hashCode();
|
|
}
|
|
}
|