- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
445 lines
15 KiB
Java
445 lines
15 KiB
Java
package com.fyber.inneractive.sdk.player.ui;
|
|
|
|
import android.animation.ObjectAnimator;
|
|
import android.animation.PropertyValuesHolder;
|
|
import android.content.Context;
|
|
import android.graphics.Bitmap;
|
|
import android.text.TextUtils;
|
|
import android.util.Property;
|
|
import android.view.GestureDetector;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import com.fyber.inneractive.sdk.R;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.config.e0;
|
|
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
|
|
import com.fyber.inneractive.sdk.config.global.features.r;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.util.p0;
|
|
import com.fyber.inneractive.sdk.util.q0;
|
|
import com.fyber.inneractive.sdk.util.t0;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class s extends d {
|
|
public boolean A;
|
|
public final String B;
|
|
public final q0 C;
|
|
public final int i;
|
|
public final int j;
|
|
public final int k;
|
|
public ImageView l;
|
|
public ViewGroup m;
|
|
public Button n;
|
|
public ImageView o;
|
|
public com.fyber.inneractive.sdk.model.vast.h p;
|
|
public int q;
|
|
public int r;
|
|
public boolean s;
|
|
public View t;
|
|
public ViewGroup u;
|
|
public final q0 v;
|
|
public q0 w;
|
|
public TextView x;
|
|
public final com.fyber.inneractive.sdk.config.global.s y;
|
|
public ObjectAnimator z;
|
|
|
|
public class a implements View.OnLayoutChangeListener {
|
|
public final /* synthetic */ Bitmap a;
|
|
|
|
public a(Bitmap bitmap) {
|
|
this.a = bitmap;
|
|
}
|
|
|
|
@Override // android.view.View.OnLayoutChangeListener
|
|
public final void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
|
|
if (s.this.getWidth() <= 0 || s.this.getHeight() <= 0) {
|
|
return;
|
|
}
|
|
s.this.d(true);
|
|
s.this.removeOnLayoutChangeListener(this);
|
|
s.this.a(this.a);
|
|
}
|
|
}
|
|
|
|
public class b extends GestureDetector.SimpleOnGestureListener {
|
|
public final /* synthetic */ View a;
|
|
public final /* synthetic */ int[] b;
|
|
public final /* synthetic */ int c;
|
|
|
|
public b(View view, int[] iArr, int i) {
|
|
this.a = view;
|
|
this.b = iArr;
|
|
this.c = i;
|
|
}
|
|
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnDoubleTapListener
|
|
public final boolean onDoubleTap(MotionEvent motionEvent) {
|
|
onSingleTapConfirmed(motionEvent);
|
|
return true;
|
|
}
|
|
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
|
|
public final boolean onDown(MotionEvent motionEvent) {
|
|
return true;
|
|
}
|
|
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
|
|
public final void onLongPress(MotionEvent motionEvent) {
|
|
onSingleTapConfirmed(motionEvent);
|
|
}
|
|
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnDoubleTapListener
|
|
public final boolean onSingleTapConfirmed(MotionEvent motionEvent) {
|
|
if (motionEvent.getAction() == 0) {
|
|
this.a.getRootView().getLocationOnScreen(this.b);
|
|
float rawX = motionEvent.getRawX() - this.b[0];
|
|
float rawY = motionEvent.getRawY() - this.b[1];
|
|
p0 p0Var = s.this.a;
|
|
p0Var.a = rawX;
|
|
p0Var.b = rawY;
|
|
}
|
|
s sVar = s.this;
|
|
m mVar = sVar.g;
|
|
if (mVar != null) {
|
|
((com.fyber.inneractive.sdk.player.controller.o) mVar).a(this.c, sVar.a);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override // android.view.GestureDetector.SimpleOnGestureListener, android.view.GestureDetector.OnGestureListener
|
|
public final boolean onSingleTapUp(MotionEvent motionEvent) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class c implements View.OnTouchListener {
|
|
public final /* synthetic */ GestureDetector a;
|
|
|
|
public c(GestureDetector gestureDetector) {
|
|
this.a = gestureDetector;
|
|
}
|
|
|
|
@Override // android.view.View.OnTouchListener
|
|
public final boolean onTouch(View view, MotionEvent motionEvent) {
|
|
return this.a.onTouchEvent(motionEvent);
|
|
}
|
|
}
|
|
|
|
public s(Context context, com.fyber.inneractive.sdk.config.global.s sVar, String str) {
|
|
this(context, sVar, str, 0);
|
|
}
|
|
|
|
public abstract void a(int i, int i2);
|
|
|
|
public abstract void a(com.fyber.inneractive.sdk.player.ui.b bVar);
|
|
|
|
public abstract void a(boolean z);
|
|
|
|
public void a(boolean z, int i, int i2) {
|
|
this.q = i;
|
|
this.r = i2;
|
|
this.s = z;
|
|
}
|
|
|
|
public abstract void a(boolean z, com.fyber.inneractive.sdk.ignite.l lVar);
|
|
|
|
public abstract void a(boolean z, String str);
|
|
|
|
public abstract void b(int i, int i2);
|
|
|
|
public final void b(com.fyber.inneractive.sdk.player.ui.b bVar) {
|
|
Integer num;
|
|
com.fyber.inneractive.sdk.model.vast.h hVar = bVar.f;
|
|
com.fyber.inneractive.sdk.model.vast.h hVar2 = com.fyber.inneractive.sdk.model.vast.h.Static;
|
|
if (hVar2 == hVar) {
|
|
a(getEndCardView(), 4);
|
|
}
|
|
if ((hVar2 != hVar && hVar != com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card) || (num = bVar.d) == null || num == null) {
|
|
return;
|
|
}
|
|
a(hVar != hVar2 ? 8 : 4, num.intValue());
|
|
}
|
|
|
|
public abstract void b(boolean z);
|
|
|
|
public abstract void c(boolean z);
|
|
|
|
public abstract void d(boolean z);
|
|
|
|
@Override // com.fyber.inneractive.sdk.player.ui.d, com.fyber.inneractive.sdk.player.ui.l
|
|
public void destroy() {
|
|
h();
|
|
setVisibility(8);
|
|
super.destroy();
|
|
IAlog.a("%sdestroyed called", IAlog.a(this));
|
|
}
|
|
|
|
public abstract void e(boolean z);
|
|
|
|
public abstract void f();
|
|
|
|
public abstract void f(boolean z);
|
|
|
|
public abstract void g();
|
|
|
|
public abstract void g(boolean z);
|
|
|
|
public abstract View getEndCardView();
|
|
|
|
public int getMaxTickFactor() {
|
|
return 1000;
|
|
}
|
|
|
|
public ViewGroup getTextureHost() {
|
|
return this.m;
|
|
}
|
|
|
|
public int getTickFractions() {
|
|
return 5;
|
|
}
|
|
|
|
public abstract View[] getTrackingFriendlyView();
|
|
|
|
public abstract View[] getTrackingFriendlyViewObstructionPurposeOther();
|
|
|
|
public int getVideoHeight() {
|
|
return this.r;
|
|
}
|
|
|
|
public int getVideoWidth() {
|
|
return this.q;
|
|
}
|
|
|
|
public abstract void h();
|
|
|
|
public abstract void h(boolean z);
|
|
|
|
public final boolean i() {
|
|
return this.t.getVisibility() == 0 || this.u.getChildCount() > 0;
|
|
}
|
|
|
|
public abstract boolean j();
|
|
|
|
public abstract void k();
|
|
|
|
public abstract void l();
|
|
|
|
public abstract void m();
|
|
|
|
public abstract boolean n();
|
|
|
|
public abstract void o();
|
|
|
|
@Override // android.widget.RelativeLayout, android.view.View
|
|
public final void onMeasure(int i, int i2) {
|
|
int size = View.MeasureSpec.getSize(i);
|
|
int size2 = View.MeasureSpec.getSize(i2);
|
|
a(this.C, size, size2);
|
|
q0 q0Var = this.C;
|
|
int i3 = q0Var.a;
|
|
if (i3 <= 0 || q0Var.b <= 0) {
|
|
q0Var.a = size;
|
|
q0Var.b = size2;
|
|
} else {
|
|
int makeMeasureSpec = View.MeasureSpec.makeMeasureSpec(i3, 1073741824);
|
|
i2 = View.MeasureSpec.makeMeasureSpec(this.C.b, 1073741824);
|
|
i = makeMeasureSpec;
|
|
}
|
|
if (!this.v.equals(this.C)) {
|
|
q0 q0Var2 = this.v;
|
|
q0 q0Var3 = this.C;
|
|
q0Var2.getClass();
|
|
q0Var2.a = q0Var3.a;
|
|
q0Var2.b = q0Var3.b;
|
|
q();
|
|
}
|
|
super.onMeasure(i, i2);
|
|
}
|
|
|
|
public abstract void p();
|
|
|
|
public abstract void q();
|
|
|
|
public abstract void setAppInfoButtonRound(TextView textView);
|
|
|
|
public abstract void setMuteButtonState(boolean z);
|
|
|
|
public abstract void setRemainingTime(String str);
|
|
|
|
public abstract void setSkipText(String str);
|
|
|
|
public s(Context context, com.fyber.inneractive.sdk.config.global.s sVar, String str, int i) {
|
|
super(context);
|
|
this.q = -1;
|
|
this.r = -1;
|
|
this.s = false;
|
|
this.v = new q0(0, 0);
|
|
this.A = false;
|
|
this.C = new q0(0, 0);
|
|
IAlog.a("%sctor called", b());
|
|
int tickFractions = getTickFractions();
|
|
this.j = tickFractions;
|
|
this.i = getMaxTickFactor();
|
|
this.k = 1000 / tickFractions;
|
|
setBackgroundColor(getResources().getColor(R.color.ia_video_background_color));
|
|
setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
|
|
this.y = sVar;
|
|
this.B = str;
|
|
}
|
|
|
|
public void c(com.fyber.inneractive.sdk.player.ui.b bVar) {
|
|
Integer num;
|
|
com.fyber.inneractive.sdk.ignite.l lVar;
|
|
View view = this.t;
|
|
if (view != null) {
|
|
if (!bVar.a) {
|
|
view.setVisibility(8);
|
|
} else if (!r.c.NONE.equals(bVar.k)) {
|
|
a(this.t, bVar.k, bVar.l);
|
|
} else {
|
|
this.t.setVisibility(0);
|
|
}
|
|
this.n.setAllCaps(bVar.b);
|
|
if (IAConfigManager.L.D.m() && (lVar = bVar.m) != null && lVar == com.fyber.inneractive.sdk.ignite.l.TRUE_SINGLE_TAP) {
|
|
this.n.setText(R.string.ia_video_instant_install_text);
|
|
if (bVar.h) {
|
|
this.x.setVisibility(0);
|
|
String str = bVar.i;
|
|
if (str != null && str.length() == 1) {
|
|
setAppInfoButtonRound(this.x);
|
|
}
|
|
this.x.setText(str);
|
|
}
|
|
} else {
|
|
this.x.setVisibility(8);
|
|
String str2 = bVar.c;
|
|
this.n.setText(!TextUtils.isEmpty(str2) ? t0.a(str2, 15) : getContext().getString(R.string.ia_video_install_now_text));
|
|
}
|
|
UnitDisplayType unitDisplayType = ((e0) this.c).f.j;
|
|
if (bVar.g) {
|
|
this.n.setBackgroundResource(R.drawable.ia_bg_green);
|
|
this.o.setVisibility(0);
|
|
ImageView imageView = this.o;
|
|
float f = bVar.j;
|
|
ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(imageView, PropertyValuesHolder.ofFloat((Property<?, Float>) View.SCALE_X, f), PropertyValuesHolder.ofFloat((Property<?, Float>) View.SCALE_Y, f));
|
|
ofPropertyValuesHolder.setRepeatCount(-1);
|
|
ofPropertyValuesHolder.setRepeatMode(2);
|
|
ofPropertyValuesHolder.setDuration(700L);
|
|
ofPropertyValuesHolder.start();
|
|
} else if (unitDisplayType.equals(UnitDisplayType.LANDSCAPE) || unitDisplayType.equals(UnitDisplayType.MRECT)) {
|
|
this.n.setBackgroundResource(R.drawable.ia_bg_green_medium);
|
|
this.n.setTextSize(0, getResources().getDimension(R.dimen.ia_video_overlay_text_large));
|
|
} else {
|
|
this.n.setBackgroundResource(R.drawable.ia_bg_green);
|
|
this.n.setTextSize(0, getResources().getDimension(R.dimen.ia_video_overlay_text_large_plus));
|
|
}
|
|
this.n.setVisibility(0);
|
|
if (!bVar.a || (num = bVar.d) == null || num == null) {
|
|
return;
|
|
}
|
|
a(8, num.intValue());
|
|
}
|
|
}
|
|
|
|
public void setLastFrameBitmap(Bitmap bitmap) {
|
|
IAlog.a("%ssetLastFrameBitmap - %s", IAlog.a(this), bitmap);
|
|
ImageView imageView = this.l;
|
|
if (imageView != null) {
|
|
imageView.setImageBitmap(bitmap);
|
|
}
|
|
q0 q0Var = this.v;
|
|
if (q0Var.a != 0 && q0Var.b != 0) {
|
|
a(bitmap);
|
|
} else {
|
|
d(false);
|
|
addOnLayoutChangeListener(new a(bitmap));
|
|
}
|
|
}
|
|
|
|
public final void a(View view, r.c cVar, int i) {
|
|
if (this.A || !r.c.ZOOM_IN.equals(cVar)) {
|
|
return;
|
|
}
|
|
ObjectAnimator ofPropertyValuesHolder = ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofFloat((Property<?, Float>) View.SCALE_X, 0.0f, 1.0f), PropertyValuesHolder.ofFloat((Property<?, Float>) View.SCALE_Y, 0.0f, 1.0f));
|
|
this.z = ofPropertyValuesHolder;
|
|
ofPropertyValuesHolder.setDuration(i);
|
|
}
|
|
|
|
public final void a(boolean z, long j) {
|
|
View view;
|
|
ObjectAnimator objectAnimator = this.z;
|
|
if (objectAnimator != null) {
|
|
if (objectAnimator.getDuration() <= j) {
|
|
ViewGroup viewGroup = this.u;
|
|
if (viewGroup != null) {
|
|
a((View) viewGroup.getParent(), 4);
|
|
}
|
|
this.z.start();
|
|
this.z.addListener(new r(this));
|
|
} else {
|
|
this.A = true;
|
|
this.z = null;
|
|
ViewGroup viewGroup2 = this.u;
|
|
if (viewGroup2 != null && viewGroup2.getParent() != null) {
|
|
((View) this.u.getParent()).setOnTouchListener(null);
|
|
}
|
|
}
|
|
if (z && (view = this.t) != null) {
|
|
view.setVisibility(0);
|
|
return;
|
|
}
|
|
ViewGroup viewGroup3 = this.u;
|
|
if (viewGroup3 != null) {
|
|
viewGroup3.setVisibility(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void a(Bitmap bitmap) {
|
|
if (bitmap != null) {
|
|
UnitDisplayType unitDisplayType = this.d;
|
|
int width = bitmap.getWidth();
|
|
int height = bitmap.getHeight();
|
|
q0 q0Var = this.v;
|
|
int i = q0Var.a;
|
|
int i2 = q0Var.b;
|
|
if (width > 0 && height > 0) {
|
|
float f = width;
|
|
float f2 = height;
|
|
float f3 = f / f2;
|
|
if (unitDisplayType == UnitDisplayType.SQUARE) {
|
|
i = (int) (i2 * f3);
|
|
} else {
|
|
float min = Math.min(i / f, 10.0f);
|
|
float f4 = i2;
|
|
float f5 = min * f2;
|
|
if (f4 > f5) {
|
|
i = (int) (min * f);
|
|
i2 = (int) f5;
|
|
} else {
|
|
float min2 = Math.min(f4 / f2, 10.0f);
|
|
i = (int) (f * min2);
|
|
i2 = (int) (min2 * f2);
|
|
}
|
|
}
|
|
}
|
|
ImageView imageView = this.l;
|
|
if (imageView != null) {
|
|
imageView.getLayoutParams().width = i;
|
|
this.l.getLayoutParams().height = i2;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void a(View view, int i) {
|
|
if (view != null) {
|
|
view.setOnTouchListener(new c(new GestureDetector(view.getContext(), new b(view, new int[2], i))));
|
|
}
|
|
}
|
|
}
|