正在查看: MX Player v1.97.8 应用的 ImmersiveFlowPlayerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MX Player v1.97.8 应用的 ImmersiveFlowPlayerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mxtech.videoplayer.ad.online.features.immersive;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import androidx.appcompat.app.ActionBar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.m.x.player.pandora.common.fromstack.From;
import com.m.x.player.pandora.common.fromstack.FromStack;
import com.mxtech.SkinViewInflater;
import com.mxtech.videoplayer.ad.online.features.immersive.a;
import com.mxtech.videoplayer.ad.online.model.bean.Feed;
import com.mxtech.videoplayer.ad.online.model.bean.next.OnlineResource;
import com.mxtech.videoplayer.ad.online.mxexo.service.ExoPlayerService;
import com.mxtech.videoplayer.ad.view.list.MXRecyclerView;
import com.mxtech.videoplayer.service.PlayService;
import defpackage.a34;
import defpackage.a7d;
import defpackage.ccf;
import defpackage.cf9;
import defpackage.coi;
import defpackage.d0c;
import defpackage.ei0;
import defpackage.en2;
import defpackage.gfh;
import defpackage.i0g;
import defpackage.i4h;
import defpackage.jeh;
import defpackage.mdg;
import defpackage.r26;
import defpackage.shc;
import defpackage.sv8;
import defpackage.tj5;
import defpackage.tv8;
import defpackage.vv7;
import defpackage.weh;
import defpackage.wv7;
import defpackage.xv8;
import defpackage.xxc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.greenrobot.eventbus.ThreadMode;
public class ImmersiveFlowPlayerActivity extends xxc implements View.OnClickListener, a34.b, cf9, jeh {
public static final int L = 0;
public View A;
public View B;
public View C;
public shc D;
public Feed E;
public boolean F;
public boolean G;
public tv8 H;
public wmc I;
public a J;
public int K;
public OnlineResource u;
public OnlineResource v;
public final ArrayList w = new ArrayList();
public MXRecyclerView x;
public mxb y;
public View z;
public class a extends RecyclerView.q {
public int a;
public final void onScrollStateChanged(RecyclerView recyclerView, int i) {
a.C0068a f0;
a.C0068a f02;
xv8 xv8Var;
a.C0068a f03;
xv8 xv8Var2;
super.onScrollStateChanged(recyclerView, i);
if (i == 0 && (recyclerView.getLayoutManager() instanceof LinearLayoutManager)) {
int f1 = recyclerView.getLayoutManager().f1();
if ((recyclerView.f0(f1) instanceof a.C0068a) && (f0 = recyclerView.f0(f1)) != null) {
if (1.0f - do2.q0(recyclerView, ((RecyclerView.z) f0).itemView) >= 0.33333334f) {
int i2 = f1 + 1;
if (!(recyclerView.f0(i2) instanceof a.C0068a) || (f02 = recyclerView.f0(i2)) == null || (xv8Var = f02.c) == null) {
return;
}
this.a = i2;
xv8Var.d();
f0.c.g();
return;
}
xv8 xv8Var3 = f0.c;
if (xv8Var3 != null) {
this.a = f1;
xv8Var3.d();
int i3 = f1 + 1;
if (!(recyclerView.f0(i3) instanceof a.C0068a) || (f03 = recyclerView.f0(i3)) == null || (xv8Var2 = f03.c) == null) {
return;
}
xv8Var2.g();
}
}
}
}
public final void onScrolled(RecyclerView recyclerView, int i, int i2) {
a.C0068a f0;
a.C0068a f02;
xv8 xv8Var;
a.C0068a f03;
xv8 xv8Var2;
a.C0068a f04;
xv8 xv8Var3;
super.onScrolled(recyclerView, i, i2);
if (recyclerView.getLayoutManager() instanceof LinearLayoutManager) {
int f1 = recyclerView.getLayoutManager().f1();
if (!(recyclerView.f0(f1) instanceof a.C0068a) || (f0 = recyclerView.f0(f1)) == null || f0.c == null) {
return;
}
if (1.0f - do2.q0(recyclerView, ((RecyclerView.z) f0).itemView) >= 0.33333334f) {
if (this.a <= f1) {
f0.c.g();
int i3 = f1 + 1;
if (!(recyclerView.f0(i3) instanceof a.C0068a) || (f02 = recyclerView.f0(i3)) == null || (xv8Var = f02.c) == null) {
return;
}
this.a = i3;
xv8Var.e();
return;
}
return;
}
if (this.a != f1) {
if (f1 == 0) {
this.a = f1;
f0.c.e();
f0.c.d();
int i4 = f1 + 1;
if (!(recyclerView.f0(i4) instanceof a.C0068a) || (f04 = recyclerView.f0(i4)) == null || (xv8Var3 = f04.c) == null) {
return;
} else {
xv8Var3.g();
}
}
int i5 = this.a;
if (i5 >= f1 + 1) {
this.a = f1;
f0.c.e();
if (!(recyclerView.f0(i5) instanceof a.C0068a) || (f03 = recyclerView.f0(i5)) == null || (xv8Var2 = f03.c) == null) {
return;
}
xv8Var2.g();
}
}
}
}
}
public static void u6(Activity activity, OnlineResource onlineResource, OnlineResource onlineResource2, OnlineResource onlineResource3, FromStack fromStack) {
Intent intent = new Intent(activity, (Class<?>) ImmersiveFlowPlayerActivity.class);
FromStack newAndPush = fromStack.newAndPush(From.create(onlineResource3.getId(), onlineResource3.getName(), "item"));
intent.putExtra("resource", onlineResource3);
if (onlineResource2 != null) {
intent.putExtra("card", OnlineResource.copySlightly(onlineResource2));
}
if (onlineResource != null) {
intent.putExtra("fromTab", OnlineResource.copySlightly(onlineResource));
}
intent.putExtra("loadMoreDisabled", false);
intent.putExtra("swipeToRefresh", false);
intent.putExtra(FromStack.FROM_LIST, newAndPush);
activity.startActivity(intent);
}
@Override
public final void D7(OnlineResource onlineResource, int i) {
OnlineResource onlineResource2 = this.u;
OnlineResource onlineResource3 = this.v;
FromStack x = getX();
mdg mdgVar = new mdg("immersiveClicked", weh.c);
HashMap hashMap = mdgVar.b;
d0d.t(onlineResource2, hashMap);
d0d.m(onlineResource3, hashMap);
d0d.e("videoID", onlineResource.getId(), hashMap);
d0d.e("videoType", d0d.E(onlineResource), hashMap);
d0d.f(hashMap, x);
d0d.e("index", Integer.valueOf(i), hashMap);
d0d.l(onlineResource, hashMap);
gfh.d(mdgVar);
}
@Override
public final void E(a34 a34Var) {
t6(true);
s6(false);
this.x.U0();
if (a34Var.isReload()) {
this.x.Z0();
}
}
@Override
public final void E0(OnlineResource onlineResource) {
d0d.L(onlineResource, getX(), "immersivePage", (OnlineResource) null, (OnlineResource) null);
}
@Override
public final void G0(int i) {
this.K = i;
}
@Override
public final void H2(OnlineResource onlineResource, long j, long j2, long j3, int i) {
OnlineResource onlineResource2 = this.u;
OnlineResource onlineResource3 = this.v;
FromStack x = getX();
mdg mdgVar = new mdg("immersiveExited", weh.c);
HashMap hashMap = mdgVar.b;
d0d.t(onlineResource2, hashMap);
d0d.m(onlineResource3, hashMap);
d0d.e("playTime", Long.valueOf(j), hashMap);
d0d.e("currentPos", Long.valueOf(j2), hashMap);
d0d.e("videoLength", Long.valueOf(j3), hashMap);
d0d.e("videoID", onlineResource.getId(), hashMap);
d0d.e("videoType", d0d.E(onlineResource), hashMap);
d0d.f(hashMap, x);
d0d.e("index", Integer.valueOf(i), hashMap);
d0d.l(onlineResource, hashMap);
gfh.d(mdgVar);
}
@Override
public final void L4(OnlineResource onlineResource) {
d0d.L2(onlineResource);
}
@Override
public final void P3(a34 a34Var, boolean z) {
Object c;
t6(true);
int i = 0;
s6(false);
this.x.W0();
this.x.X0();
ArrayList arrayList = this.w;
if (z) {
arrayList.clear();
arrayList.addAll(a34Var.cloneData());
this.y.notifyDataSetChanged();
if (this.E != null && !ti.n(arrayList)) {
while (true) {
if (i >= arrayList.size()) {
break;
}
if (this.E.getId().equals(((r26) arrayList.get(i)).i.getId())) {
this.x.post(new p73(this, i, 1));
break;
}
i++;
}
}
} else if (a34Var.size() > arrayList.size()) {
arrayList.addAll(a34Var.subList(this.y.getItemCount(), a34Var.size()));
mxb mxbVar = this.y;
mxbVar.notifyItemRangeInserted(mxbVar.getItemCount() - 1, a34Var.size());
}
if (a34Var.hasMoreData()) {
return;
}
this.x.S0();
wv7 wv7Var = new wv7();
mxb mxbVar2 = this.y;
List list = mxbVar2 != null ? mxbVar2.i : null;
if (ti.n(list) || (c = eb6.c(1, list)) == null || (c instanceof wv7)) {
return;
}
list.add(wv7Var);
this.y.notifyItemInserted(list.size() - 1);
}
@Override
public final void V0(a34 a34Var, Throwable th) {
this.x.W0();
if (a34Var == null || a34Var.size() == 0) {
s6(true);
t6(false);
}
}
@Override
public final void b3(OnlineResource onlineResource) {
d0d.v2(onlineResource, getX(), "immersivePage", (OnlineResource) null, (OnlineResource) null);
}
@Override
public final From d6() {
return From.create("immersive", "immersive", "immersive");
}
@Override
public final int e6() {
return i0g.b().h("immersive_player_activity");
}
@Override
public final void f9(OnlineResource onlineResource) {
d0d.p1(onlineResource);
}
@Override
public final void g7(OnlineResource onlineResource, int i) {
FromStack x = getX();
mdg mdgVar = new mdg("itemsViewed", weh.c);
HashMap hashMap = mdgVar.b;
d0d.p(hashMap, onlineResource, (OnlineResource) null, (OnlineResource) null, x, i, (String) null);
d0d.e("tabName", "immersive", hashMap);
gfh.d(mdgVar);
}
@Override
public final void initToolBar() {
super.initToolBar();
ActionBar actionBar = this.p;
if (actionBar != null) {
actionBar.u(2131234207);
}
}
@Override
public final int j6() {
return 2131558468;
}
@Override
public void onClick(View view) {
int id = view.getId();
if ((id == 2131365669 || id == 2131365683) && !en2.a(400L)) {
if (this.C.getVisibility() != 0 || vk4.h(this)) {
p6();
return;
}
ei0.p(this);
if (this.D == null) {
this.D = new shc(new ra2(this));
}
this.D.d();
}
}
@Override
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
vk4.j(this);
getWindow().addFlags(SkinViewInflater.FLAG_SWITCH_THUMB);
this.E = (Feed) getIntent().getSerializableExtra("resource");
this.u = (OnlineResource) getIntent().getSerializableExtra("fromTab");
this.v = (OnlineResource) getIntent().getSerializableExtra("card");
if (this.E == null) {
finish();
} else {
this.F = getIntent().getBooleanExtra("loadMoreDisabled", false);
this.G = getIntent().getBooleanExtra("swipeToRefresh", false);
a7d.a();
PlayService.y();
ExoPlayerService.M();
d0c i = d0c.i();
if (i.n()) {
i.q();
}
}
this.z = findViewById(2131365669);
this.A = findViewById(2131365683);
this.B = findViewById(2131365665);
this.C = findViewById(2131362416);
this.z.setVisibility(8);
this.z.setOnClickListener(this);
this.A.setVisibility(8);
this.A.setOnClickListener(this);
MXRecyclerView findViewById = findViewById(2131365603);
this.x = findViewById;
if (this.F) {
findViewById.S0();
} else {
findViewById.U0();
}
if (this.G) {
this.x.V0();
} else {
this.x.T0();
}
this.x.setLayoutManager(new TopLinearLayoutManager(1));
this.x.setOnActionListener(new sv8(this));
this.I = new wmc(this, (OnlineResource) null, this.E, getX(), (ccf) null);
mxb mxbVar = new mxb(this.w);
this.y = mxbVar;
mxbVar.g(r26.class, new com.mxtech.videoplayer.ad.online.features.immersive.a(this.I, this, this, this, getX()));
this.y.g(wv7.class, new vv7());
this.x.setLoadingColor(Color.parseColor("#dadde4"));
this.x.setAdapter(this.y);
this.x.setNestedScrollingEnabled(true);
this.x.getItemAnimator().g = false;
a aVar = new a();
aVar.a = -1;
this.J = aVar;
this.x.m(aVar);
this.y.notifyDataSetChanged();
p6();
tj5.e(this);
}
@Override
public final void onDestroy() {
xv8 xv8Var;
shc shcVar = this.D;
if (shcVar != null) {
shcVar.c();
}
tv8 tv8Var = this.H;
if (tv8Var != null) {
tv8Var.stop();
}
MXRecyclerView mXRecyclerView = this.x;
if (mXRecyclerView != null) {
mXRecyclerView.F0(this.J);
if (!(this.x.f0(this.K) instanceof a.C0068a)) {
super.onDestroy();
return;
}
a.C0068a f0 = this.x.f0(this.K);
if (f0 != null && (xv8Var = f0.c) != null) {
xv8Var.g();
}
}
int i = this.K;
mdg mdgVar = new mdg("immersiveExitPosition", weh.c);
d0d.e("index", Integer.valueOf(i), mdgVar.b);
gfh.d(mdgVar);
tj5.h(this);
super.onDestroy();
}
@vgg(threadMode = ThreadMode.MAIN)
public void onEvent(i4h i4hVar) {
a.C0068a f0;
if (tj5.a.contains(this) && (this.x.f0(this.K) instanceof a.C0068a) && (f0 = this.x.f0(this.K)) != null && f0.c != null) {
int i = i4hVar.d;
if (i == 1) {
if (!i4hVar.c.getId().equals(f0.c.c.i.getId()) || f0.c.c.c()) {
return;
}
f0.c.c.i.setThumbStatus(1);
f0.c.c();
return;
}
if (i == 2 && ((OnlineResource) i4hVar.b.get(0)).getId().equals(f0.c.c.i.getId()) && f0.c.c.c()) {
f0.c.c.i.setThumbStatus(0);
f0.c.c();
}
}
}
public final void p6() {
if (!shc.b(this)) {
this.B.setVisibility(8);
this.C.setVisibility(0);
this.A.setVisibility(0);
this.z.setVisibility(8);
return;
}
if (TextUtils.isEmpty(this.E.getImmersiveUrl())) {
s6(true);
t6(false);
return;
}
if (this.H == null) {
Feed feed = this.E;
tv8 tv8Var = new tv8();
tv8Var.b = "";
tv8Var.c = feed;
this.H = tv8Var;
}
if (this.H.isRegisterSourceListenerEmpty()) {
this.H.registerSourceListener(this);
}
this.H.reload();
}
public final void s6(boolean z) {
this.z.setVisibility(z ? 0 : 8);
this.A.setVisibility(8);
}
public final void t6(boolean z) {
this.x.setVisibility(z ? 0 : 8);
}
public final void w6(int i) {
a.C0068a f0;
if ((this.x.f0(i) instanceof a.C0068a) && (f0 = this.x.f0(i)) != null) {
MXRecyclerView mXRecyclerView = this.x;
View view = ((RecyclerView.z) f0).itemView;
int[] iArr = new int[2];
mXRecyclerView.getLocationOnScreen(iArr);
int i2 = iArr[1];
int[] iArr2 = new int[2];
view.getLocationOnScreen(iArr2);
this.x.M0(0, iArr2[1] - i2, false);
}
}
@Override
public final void p(a34 a34Var) {
}
@vgg(threadMode = ThreadMode.MAIN)
public void onEvent(coi coiVar) {
a.C0068a f0;
if (tj5.a.contains(this) && (this.x.f0(this.K) instanceof a.C0068a) && (f0 = this.x.f0(this.K)) != null && f0.c != null) {
int i = coiVar.d;
if (i == 1) {
if (!coiVar.c.getId().equals(f0.c.c.i.getId()) || f0.c.c.b()) {
return;
}
f0.c.c.i.setInWatchlist(true);
f0.c.h.b(true);
return;
}
if (i == 2 && ((OnlineResource) coiVar.b.get(0)).getId().equals(f0.c.c.i.getId()) && f0.c.c.b()) {
f0.c.c.i.setInWatchlist(false);
f0.c.h.b(false);
}
}
}
}