- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
306 lines
12 KiB
Java
306 lines
12 KiB
Java
package com.fyber.inneractive.sdk.player.ui;
|
|
|
|
import android.animation.ObjectAnimator;
|
|
import android.animation.PropertyValuesHolder;
|
|
import android.content.Context;
|
|
import android.content.res.Configuration;
|
|
import android.graphics.Color;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.graphics.drawable.GradientDrawable;
|
|
import android.graphics.drawable.RotateDrawable;
|
|
import android.util.DisplayMetrics;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.ViewParent;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import com.fyber.inneractive.sdk.R;
|
|
import com.fyber.inneractive.sdk.config.global.features.r;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class o extends k {
|
|
public TextView a0;
|
|
public ImageView b0;
|
|
public View c0;
|
|
public ViewGroup d0;
|
|
|
|
public o(Context context, com.fyber.inneractive.sdk.flow.e eVar, a aVar, com.fyber.inneractive.sdk.config.global.s sVar, boolean z, String str) {
|
|
super(context, eVar, aVar, sVar, z, str);
|
|
}
|
|
|
|
private void setProgressBarTint(com.fyber.inneractive.sdk.config.global.features.r rVar) {
|
|
String a = rVar.a("new_video_design_skip_progress_bar_start_color", "#9000D691");
|
|
String a2 = rVar.a("new_video_design_skip_progress_bar_end_color", "#00D691");
|
|
try {
|
|
int[] iArr = {Color.parseColor(a), Color.parseColor(a2)};
|
|
Drawable progressDrawable = this.T.getProgressDrawable();
|
|
if (progressDrawable instanceof RotateDrawable) {
|
|
Drawable drawable = ((RotateDrawable) progressDrawable).getDrawable();
|
|
if (drawable instanceof GradientDrawable) {
|
|
((GradientDrawable) drawable).setColors(iArr);
|
|
this.T.setProgressDrawable(progressDrawable);
|
|
}
|
|
}
|
|
} catch (Exception unused) {
|
|
IAlog.a("could not parse colors %s %s", a, a2);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.i, com.fyber.inneractive.sdk.player.ui.s, com.fyber.inneractive.sdk.player.ui.l
|
|
public final void a(b bVar) {
|
|
View view = bVar.e;
|
|
setEndCardView(view);
|
|
if (view == null || this.u == null) {
|
|
return;
|
|
}
|
|
ViewParent parent = view.getParent();
|
|
if (parent instanceof ViewGroup) {
|
|
((ViewGroup) parent).removeView(view);
|
|
}
|
|
c(false);
|
|
TextView textView = this.a0;
|
|
if (textView != null) {
|
|
textView.setVisibility(4);
|
|
}
|
|
if (this.u != null) {
|
|
if (com.fyber.inneractive.sdk.model.vast.h.Static == bVar.f && (!r.c.NONE.equals(bVar.k))) {
|
|
a(this.u, bVar.k, bVar.l);
|
|
} else {
|
|
this.u.setVisibility(0);
|
|
}
|
|
}
|
|
this.u.addView(view, 0);
|
|
b(bVar);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.k
|
|
public int getMuteUnMuteButtonResourceId() {
|
|
return R.id.ia_iv_mute_button_new;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public View[] getTrackingFriendlyView() {
|
|
return new View[]{this.d0, this.U, this.l, this.x};
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.k
|
|
public int getVideoProgressBarResourceId() {
|
|
return R.id.ia_video_progressbar_new;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.k
|
|
public int getVideoViewLayoutId() {
|
|
return R.layout.ia_layout_video_view_new_design;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.k, com.fyber.inneractive.sdk.player.ui.s
|
|
public final void h() {
|
|
super.h();
|
|
TextView textView = this.a0;
|
|
if (textView != null) {
|
|
textView.setVisibility(4);
|
|
}
|
|
View view = this.c0;
|
|
if (view != null) {
|
|
view.setVisibility(8);
|
|
}
|
|
b(false);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void h(boolean z) {
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.i
|
|
public final void i(boolean z) {
|
|
String string;
|
|
com.fyber.inneractive.sdk.config.global.s sVar = this.y;
|
|
if (sVar != null) {
|
|
string = ((com.fyber.inneractive.sdk.config.global.features.n) sVar.a(com.fyber.inneractive.sdk.config.global.features.n.class)).a("app_info_button_text", "App Info");
|
|
if (string != null && string.length() > 30) {
|
|
string = string.substring(0, 30);
|
|
}
|
|
} else {
|
|
string = getContext().getString(R.string.ia_video_app_info_text);
|
|
}
|
|
if (!z) {
|
|
a(false, (String) null);
|
|
} else {
|
|
b(false);
|
|
a(true, string);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final boolean n() {
|
|
return this.T == null;
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public final void onConfigurationChanged(Configuration configuration) {
|
|
super.onConfigurationChanged(configuration);
|
|
if (i()) {
|
|
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
|
ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(this.c0, PropertyValuesHolder.ofFloat("x", (displayMetrics.widthPixels / 2.0f) - (r0.getWidth() / 2.0f)), PropertyValuesHolder.ofFloat("y", displayMetrics.heightPixels / 1.3f), PropertyValuesHolder.ofFloat("scaleX", 1.4f), PropertyValuesHolder.ofFloat("scaleY", 1.4f));
|
|
ofPropertyValuesHolder.setDuration(750L);
|
|
ofPropertyValuesHolder.start();
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.k
|
|
public final void s() {
|
|
super.s();
|
|
this.d0 = (ViewGroup) findViewById(R.id.ia_video_controls_overlay);
|
|
this.c0 = findViewById(R.id.ia_cta_container);
|
|
ImageView imageView = (ImageView) findViewById(R.id.ia_iv_skip);
|
|
this.b0 = imageView;
|
|
imageView.setEnabled(false);
|
|
this.a0 = (TextView) findViewById(R.id.ia_tv_skip_left);
|
|
a(this.b0, 6);
|
|
com.fyber.inneractive.sdk.config.global.s sVar = this.y;
|
|
if (sVar != null) {
|
|
setSizesAndTint((com.fyber.inneractive.sdk.config.global.features.r) sVar.a(com.fyber.inneractive.sdk.config.global.features.r.class));
|
|
setProgressBarTint((com.fyber.inneractive.sdk.config.global.features.r) this.y.a(com.fyber.inneractive.sdk.config.global.features.r.class));
|
|
}
|
|
}
|
|
|
|
private void setSizesAndTint(com.fyber.inneractive.sdk.config.global.features.r rVar) {
|
|
com.fyber.inneractive.sdk.util.o.a(this.R, rVar.a("new_video_design_mute_btn_size_w", 30), rVar.a("new_video_design_mute_btn_size_h", 30));
|
|
com.fyber.inneractive.sdk.util.o.a(this.T, rVar.a("new_video_design_skip_progress_bar_size_w", 46), rVar.a("new_video_design_skip_progress_bar_size_h", 46));
|
|
com.fyber.inneractive.sdk.util.o.a(this.b0, rVar.a("new_video_design_skip_btn_size_w", 30), rVar.a("new_video_design_skip_btn_size_h", 30));
|
|
com.fyber.inneractive.sdk.util.o.a(this.a0, rVar.a("new_video_design_skip_btn_size_w", 30), rVar.a("new_video_design_skip_btn_size_h", 30));
|
|
ImageView imageView = this.b0;
|
|
int a = rVar.a("new_video_design_skip_btn_margin", 12);
|
|
if (imageView != null && (imageView.getLayoutParams() instanceof ViewGroup.MarginLayoutParams)) {
|
|
int a2 = com.fyber.inneractive.sdk.util.o.a(a);
|
|
((ViewGroup.MarginLayoutParams) imageView.getLayoutParams()).setMargins(a2, a2, a2, a2);
|
|
imageView.requestLayout();
|
|
}
|
|
TextView textView = this.a0;
|
|
int a3 = rVar.a("new_video_design_skip_btn_margin", 12);
|
|
if (textView != null && (textView.getLayoutParams() instanceof ViewGroup.MarginLayoutParams)) {
|
|
int a4 = com.fyber.inneractive.sdk.util.o.a(a3);
|
|
((ViewGroup.MarginLayoutParams) textView.getLayoutParams()).setMargins(a4, a4, a4, a4);
|
|
textView.requestLayout();
|
|
}
|
|
com.fyber.inneractive.sdk.util.o.a(this.c0, rVar.a("new_video_design_action_btn_size_w", 120), rVar.a("new_video_design_action_btn_size_h", 48));
|
|
View view = this.c0;
|
|
String a5 = rVar.a("new_video_design_tint_color", "#00D691");
|
|
if (view != null) {
|
|
try {
|
|
view.setBackgroundColor(Color.parseColor(a5));
|
|
} catch (Exception unused) {
|
|
IAlog.a("could not parse color %s", a5);
|
|
}
|
|
}
|
|
TextView textView2 = this.Q;
|
|
String a6 = rVar.a("new_video_design_action_btn_text_color", "#ffffff");
|
|
if (textView2 != null) {
|
|
try {
|
|
textView2.setTextColor(Color.parseColor(a6));
|
|
} catch (Exception unused2) {
|
|
IAlog.a("could not parse color %s", a6);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void d(boolean z) {
|
|
if (this.l != null) {
|
|
ViewGroup viewGroup = this.u;
|
|
if (viewGroup == null || viewGroup.getVisibility() != 0) {
|
|
if (z) {
|
|
this.l.setAlpha(0.0f);
|
|
}
|
|
this.l.setVisibility(z ? 0 : 8);
|
|
if (z) {
|
|
this.l.animate().alpha(1.0f).setDuration(500L).start();
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
IAlog.a("end card is visible and requested to show last frame image with value of %s", Boolean.valueOf(z));
|
|
ImageView imageView = this.l;
|
|
if (this.p == com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card && z) {
|
|
r1 = 0;
|
|
}
|
|
imageView.setVisibility(r1);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void g() {
|
|
ImageView imageView = this.b0;
|
|
if (imageView != null) {
|
|
imageView.setVisibility(0);
|
|
this.b0.setEnabled(true);
|
|
TextView textView = this.a0;
|
|
if (textView != null) {
|
|
textView.setVisibility(4);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final boolean j() {
|
|
ImageView imageView = this.b0;
|
|
return imageView != null && imageView.getVisibility() == 0 && this.b0.isEnabled();
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void m() {
|
|
com.fyber.inneractive.sdk.config.global.s sVar;
|
|
if (this.c0 == null || (sVar = this.y) == null) {
|
|
return;
|
|
}
|
|
com.fyber.inneractive.sdk.config.global.features.r rVar = (com.fyber.inneractive.sdk.config.global.features.r) sVar.a(com.fyber.inneractive.sdk.config.global.features.r.class);
|
|
TextView textView = this.Q;
|
|
if (textView != null) {
|
|
textView.setTextSize(0, getResources().getDimension(R.dimen.ia_video_overlay_text_large_for_cta));
|
|
com.fyber.inneractive.sdk.util.o.a(this.c0, rVar.a("new_video_design_action_btn_size_w_large", 180), rVar.a("new_video_design_action_btn_size_h", 48));
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public void setRemainingTime(String str) {
|
|
TextView textView = this.a0;
|
|
if (textView != null) {
|
|
textView.setVisibility(0);
|
|
this.a0.setText(str);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public void setSkipText(String str) {
|
|
TextView textView = this.a0;
|
|
if (textView != null) {
|
|
textView.setVisibility(0);
|
|
this.a0.setText(str);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void b(boolean z) {
|
|
ImageView imageView = this.b0;
|
|
if (imageView == null || this.a0 == null) {
|
|
return;
|
|
}
|
|
if (imageView.isEnabled()) {
|
|
this.b0.setVisibility(z ? 0 : 4);
|
|
this.a0.setVisibility(4);
|
|
} else {
|
|
this.b0.setVisibility(4);
|
|
this.a0.setVisibility(z ? 0 : 4);
|
|
}
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.s
|
|
public final void g(boolean z) {
|
|
if (this.T == null || i()) {
|
|
return;
|
|
}
|
|
this.T.setVisibility(z ? 0 : 4);
|
|
}
|
|
}
|