正在查看: MedEd v5.3.6 应用的 OfflineVideos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MedEd v5.3.6 应用的 OfflineVideos.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.penpencil.physicswallah.feature.extras.presentation;
import android.R;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.os.Build;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.databinding.DataBinderMapperImpl;
import androidx.lifecycle.n;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.button.MaterialButton;
import com.penpencil.network.localfile.database.entity.DownloadEntity;
import com.penpencil.network.response.BatchData;
import com.penpencil.network.response.FileId;
import com.penpencil.physicswallah.feature.extras.presentation.OfflineVideos;
import com.penpencil.player.manager.offline.f;
import com.penpencil.player.models.BatchCredential;
import com.penpencil.player.models.CourseCredential;
import defpackage.C0505jR0;
import defpackage.FK1;
import defpackage.mL1;
import defpackage.p02;
import defpackage.u02;
import defpackage.w02;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import kotlin.Metadata;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
@Metadata
public final class OfflineVideos extends kR0<p6> implements w02 {
public static final int Z0 = 0;
public Lm1 L0;
public View M0;
public final float N0;
public long O0;
public androidx.appcompat.app.c P0;
public he0 Q0;
public Ua2 R0;
public ArrayList<FileId> S0;
public CopyOnWriteArrayList<sd0> T0;
public int U0;
public OfflineVideos V0;
public kt1 W0;
public final b X0;
public RecyclerView.g Y0;
public class a extends RE0 implements Function1<LayoutInflater, p6> {
public static final a i = new a();
public a() {
super(1, p6.class, "inflate", "inflate(Landroid/view/LayoutInflater;)Lcom/penpencil/physicswallah/databinding/ActivityOfflineVideosBinding;", 0);
}
public final Object invoke(Object obj) {
LayoutInflater layoutInflater = (LayoutInflater) obj;
Intrinsics.checkNotNullParameter(layoutInflater, "p0");
int i2 = p6.I;
DataBinderMapperImpl dataBinderMapperImpl = a00.a;
return Hs3.p(layoutInflater, 2131558460, (ViewGroup) null, (Object) null);
}
}
public static final class b implements It0 {
public b() {
}
public final void G0(int i, final int i2, final String str) {
Intrinsics.checkNotNullParameter(str, "fileId");
final ?? r0 = OfflineVideos.this;
r0.runOnUiThread(new Runnable() {
@Override
public final void run() {
OfflineVideos offlineVideos = OfflineVideos.this;
Intrinsics.checkNotNullParameter(offlineVideos, "this$0");
String str2 = str;
Intrinsics.checkNotNullParameter(str2, "$fileId");
he0 he0Var = offlineVideos.Q0;
if (he0Var == null) {
return;
}
int i3 = 0;
while (true) {
CopyOnWriteArrayList copyOnWriteArrayList = he0Var.c;
if (i3 >= copyOnWriteArrayList.size()) {
return;
}
sd0 sd0Var = (sd0) copyOnWriteArrayList.get(i3);
if (!TextUtils.isEmpty(str2) && TextUtils.equals(str2, sd0Var.c()) && sd0Var.h() == b.b) {
sd0Var.k(Integer.valueOf(i2));
he0Var.l(sd0Var, i3);
}
i3++;
}
}
});
}
public final void J(String str) {
Intrinsics.checkNotNullParameter(str, "fileId");
kR0 kr0 = OfflineVideos.this;
kr0.runOnUiThread(new Im0(kr0, 3, str));
}
public final void M(int i, String str, String str2) {
Intrinsics.checkNotNullParameter(str, "fileId");
Intrinsics.checkNotNullParameter(str2, "url");
}
public final void Q(String str) {
Intrinsics.checkNotNullParameter(str, "fileId");
kR0 kr0 = OfflineVideos.this;
kr0.runOnUiThread(new rz2(kr0, 4, str));
}
public final void m0(String str, int i, String str2) {
Intrinsics.checkNotNullParameter(str, "fileId");
Intrinsics.checkNotNullParameter(str2, "url");
}
public final void n0(int i, String str, String str2, zd0 zd0Var) {
Intrinsics.checkNotNullParameter(str, "fileId");
Intrinsics.checkNotNullParameter(str2, "url");
Intrinsics.checkNotNullParameter(zd0Var, "downloadStatus");
}
public final void u0(int i, String str) {
a.a(str);
}
}
public static final class c extends AnimatorListenerAdapter {
public final View a;
public c(View view) {
this.a = view;
}
@Override
public final void onAnimationEnd(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animation");
this.a.setVisibility(8);
}
}
public static final class d extends AnimatorListenerAdapter {
public final View a;
public d(View view) {
this.a = view;
}
@Override
public final void onAnimationEnd(Animator animator) {
Intrinsics.checkNotNullParameter(animator, "animation");
this.a.setVisibility(0);
}
}
public static final class e implements b02, OE0 {
public final Function1 a;
public e(Function1 function1) {
Intrinsics.checkNotNullParameter(function1, "function");
this.a = function1;
}
public final void a(Object obj) {
this.a.invoke(obj);
}
public final FE0<?> b() {
return this.a;
}
public final boolean equals(Object obj) {
if ((obj instanceof b02) && (obj instanceof OE0)) {
return Intrinsics.b(b(), ((OE0) obj).b());
}
return false;
}
public final int hashCode() {
return b().hashCode();
}
}
public OfflineVideos() {
super(a.i);
((kR0) this).K0 = false;
addOnContextAvailableListener(new C0505jR0(this));
this.N0 = 1.0f;
this.T0 = new CopyOnWriteArrayList<>();
this.X0 = new b();
}
public static final void X0(OfflineVideos offlineVideos) {
offlineVideos.getClass();
lu0.e(offlineVideos, offlineVideos).f(offlineVideos, new e(new Jn3(offlineVideos, 1)));
}
@Override
public final void L0(FileId fileId) {
Window window;
Intrinsics.checkNotNullParameter(fileId, "fileId");
View inflate = LayoutInflater.from(this).inflate(2131558537, (ViewGroup) null, false);
this.M0 = inflate;
MaterialButton findViewById = inflate != null ? inflate.findViewById(2131363004) : null;
View view = this.M0;
MaterialButton findViewById2 = view != null ? view.findViewById(2131363003) : null;
View view2 = this.M0;
AppCompatImageView findViewById3 = view2 != null ? view2.findViewById(2131363002) : null;
View view3 = this.M0;
AppCompatTextView findViewById4 = view3 != null ? view3.findViewById(2131364135) : null;
String string = getString(this.U0 == 0 ? 2132021151 : 2132018008);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
if (findViewById4 != null) {
findViewById4.setText(getString(2132020753, string));
}
this.W0 = new kt1(this).i(this.M0);
if (!isFinishing()) {
kt1 kt1Var = this.W0;
androidx.appcompat.app.c h = kt1Var != null ? kt1Var.h() : null;
this.P0 = h;
if (h != null && (window = h.getWindow()) != null) {
QO.a(0, window);
}
}
if (findViewById != null) {
ct3.g(findViewById, new z10(this, 17, fileId));
}
if (findViewById2 != null) {
findViewById2.setOnClickListener(new gh0(this, 4));
}
if (findViewById3 != null) {
findViewById3.setOnClickListener(new wK0(this, 5));
}
}
public final void V0(Ur3 ur3) {
Intrinsics.checkNotNullParameter((p6) ur3, "<this>");
this.O0 = getResources().getInteger(R.integer.config_shortAnimTime);
this.V0 = this;
this.T0 = new CopyOnWriteArrayList<>();
ArrayList<FileId> arrayList = new ArrayList<>();
this.S0 = arrayList;
jV1 jv1 = ((rp) this).C0;
Intrinsics.checkNotNullExpressionValue(jv1, "networkManager");
this.R0 = new Ua2(arrayList, this, jv1, this, a1(), this);
CopyOnWriteArrayList<sd0> copyOnWriteArrayList = this.T0;
he0 he0Var = new he0();
he0Var.c = copyOnWriteArrayList;
he0Var.d = this;
he0Var.e = this;
he0Var.g = new HashSet();
he0Var.f = this.X0;
this.Q0 = he0Var;
U0().t.setOnClickListener(new XX2(this, 2));
U0().F.setOnClickListener(new YX2(this, 3));
U0().A.setOnClickListener(new zq3(this, 1));
U0().y.setOnClickListener(new aY2(this, 3));
U0().u.setOnClickListener(new mL1(this, 2));
U0().v.setOnClickListener(new cY2(this, 3));
U0().z.setOnClickListener(new dY2(this, 2));
this.U0 = 0;
Y0(0);
n nVar = ((rp) this).F0;
Intrinsics.checkNotNullExpressionValue(nVar, "lifecycleScope");
Lx.q(nVar, yb0.c, (mV) null, new u02(this, null), 2);
}
public final void Y0(int i) {
((Hs3) U0().x).e.setVisibility(8);
((Hs3) U0().w).e.setVisibility(8);
c1(xI.d(U0().u));
if (i == 0) {
this.Y0 = this.Q0;
U0().C.setAdapter(this.Q0);
U0().C.setItemAnimator((RecyclerView.l) null);
b1();
U0().G.setTextColor(getResources().getColor(2131099905));
U0().F.setCardElevation(TypedValue.applyDimension(1, 0.0f, getResources().getDisplayMetrics()));
U0().F.setRadius(TypedValue.applyDimension(1, 8.0f, getResources().getDisplayMetrics()));
U0().F.setCardBackgroundColor(getResources().getColor(2131099968));
int i2 = Build.VERSION.SDK_INT;
if (i2 >= 28) {
uV1.a(U0().F, getResources().getColor(2131100128));
}
U0().B.setTextColor(getResources().getColor(2131099849));
U0().A.setCardElevation(0.0f);
U0().A.setRadius(0.0f);
U0().A.setCardBackgroundColor(getResources().getColor(2131101369));
if (i2 >= 26) {
U0().G.setTypeface(CJ.b(getResources()));
U0().B.setTypeface(DJ.c(getResources()));
}
g1();
return;
}
if (i != 1) {
return;
}
this.Y0 = this.R0;
U0().C.setAdapter(this.R0);
U0().C.setItemAnimator((RecyclerView.l) null);
b1();
U0().G.setTextColor(getResources().getColor(2131099849));
U0().F.setCardElevation(0.0f);
U0().F.setRadius(0.0f);
U0().F.setCardBackgroundColor(getResources().getColor(2131101369));
U0().B.setTextColor(getResources().getColor(2131099905));
U0().A.setCardElevation(TypedValue.applyDimension(1, 0.0f, getResources().getDisplayMetrics()));
U0().A.setRadius(TypedValue.applyDimension(1, 8.0f, getResources().getDisplayMetrics()));
U0().A.setCardBackgroundColor(getResources().getColor(2131099968));
int i3 = Build.VERSION.SDK_INT;
if (i3 >= 28) {
uV1.a(U0().A, getResources().getColor(2131100128));
}
if (i3 >= 26) {
U0().G.setTypeface(DJ.c(getResources()));
U0().B.setTypeface(CJ.b(getResources()));
}
lu0.e(this, this).f(this, new e(new hL0(this, 3)));
}
public final void Z0(sd0 sd0Var) {
if (Intrinsics.b(sd0Var.n, Boolean.TRUE)) {
f.a.d(this, UW2.f(sd0Var.e().getVideoId()), new In3(5));
} else {
rt0 rt0Var = rt0.y;
a.a().o(sd0Var);
}
}
public final Lm1 a1() {
Lm1 lm1 = this.L0;
if (lm1 != null) {
return lm1;
}
Intrinsics.n("localFileManager");
throw null;
}
public final void b1() {
c1(yI.m(new View[]{U0().u, U0().v, U0().D, U0().y}));
e1(yI.m(new View[]{U0().t, U0().E, U0().z}));
RecyclerView.g gVar = this.Y0;
if (gVar != null) {
gVar.e();
}
RecyclerView.g gVar2 = this.Y0;
if (gVar2 != null) {
gVar2.h();
}
RecyclerView.g gVar3 = this.Y0;
if (gVar3 != null) {
gVar3.j();
}
}
public final void c1(List<? extends View> list) {
for (View view : list) {
view.animate().alpha(0.0f).setDuration(this.O0).setListener(new c(view));
}
}
public final void d1() {
runOnUiThread(new kd(this, 4));
}
public final void e1(List<? extends View> list) {
for (View view : list) {
view.animate().alpha(this.N0).setDuration(this.O0).setListener(new d(view));
}
}
public final void f1() {
c1(yI.m(new View[]{U0().z, U0().u, U0().t, U0().E}));
e1(yI.m(new View[]{U0().v, U0().D, U0().y}));
RecyclerView.g gVar = this.Y0;
if (gVar != null) {
gVar.e();
}
RecyclerView.g gVar2 = this.Y0;
if (gVar2 != null) {
gVar2.j();
}
RecyclerView.g gVar3 = this.Y0;
if (gVar3 != null) {
gVar3.g();
}
d1();
}
public final void g1() {
View view = ((Hs3) U0().x).e;
Intrinsics.checkNotNullExpressionValue(view, "getRoot(...)");
view.setVisibility(this.T0.size() == 0 ? 0 : 8);
}
@Override
public final void k(sd0 sd0Var, AppCompatImageView appCompatImageView) {
Window window;
Intrinsics.checkNotNullParameter(sd0Var, "downloadModel");
Intrinsics.checkNotNullParameter(appCompatImageView, "deleteVideoButton");
int i = 0;
View inflate = LayoutInflater.from(this).inflate(2131558537, (ViewGroup) null, false);
this.M0 = inflate;
MaterialButton findViewById = inflate != null ? inflate.findViewById(2131363004) : null;
View view = this.M0;
MaterialButton findViewById2 = view != null ? view.findViewById(2131363003) : null;
View view2 = this.M0;
AppCompatImageView findViewById3 = view2 != null ? view2.findViewById(2131363002) : null;
View view3 = this.M0;
AppCompatTextView findViewById4 = view3 != null ? view3.findViewById(2131364135) : null;
String string = getString(this.U0 == 0 ? 2132021151 : 2132018008);
Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
if (findViewById4 != null) {
findViewById4.setText(getString(2132020753, string));
}
this.W0 = new kt1(this).i(this.M0);
if (!isFinishing()) {
kt1 kt1Var = this.W0;
androidx.appcompat.app.c h = kt1Var != null ? kt1Var.h() : null;
this.P0 = h;
if (h != null && (window = h.getWindow()) != null) {
QO.a(0, window);
}
}
if (findViewById != null) {
ct3.g(findViewById, new SX1(this, 20, sd0Var));
}
if (findViewById2 != null) {
findViewById2.setOnClickListener(new p02(this, i));
}
if (findViewById3 != null) {
findViewById3.setOnClickListener(new FK1(this, 2));
}
}
@Override
public final void o(final sd0 sd0Var) {
Intrinsics.checkNotNullParameter(sd0Var, "downloadModel");
HA3.n(a1().e(sd0Var.j(), this), this, new b02() {
public final void a(Object obj) {
BatchCredential batchCredential;
DownloadEntity downloadEntity = (DownloadEntity) obj;
int i = OfflineVideos.Z0;
kR0 kr0 = OfflineVideos.this;
Intrinsics.checkNotNullParameter(kr0, "this$0");
sd0 sd0Var2 = sd0Var;
Intrinsics.checkNotNullParameter(sd0Var2, "$downloadModel");
if ((downloadEntity != null ? downloadEntity.getStatus() : null) == b.e) {
l.o(kr0, 2132021135);
return;
}
if (sd0Var2.h() == b.b) {
l.o(kr0, 2132019772);
return;
}
if (sd0Var2.h() == b.c) {
l.o(kr0, 2132019773);
return;
}
if (sd0Var2.h() != b.g) {
l.o(kr0, 2132021141);
return;
}
if (downloadEntity == null || UW2.f(downloadEntity.getBatch_id()).length() == 0) {
batchCredential = null;
} else {
String f = UW2.f(downloadEntity.getBatch_id());
String f2 = UW2.f(downloadEntity.getBatch_subject_id());
String f3 = UW2.f(downloadEntity.getContent_id());
String f4 = UW2.f(downloadEntity.getTopic_id());
Float batch_fee = downloadEntity.getBatch_fee();
float floatValue = batch_fee != null ? batch_fee.floatValue() : 0.0f;
Boolean is_purchased_batch = downloadEntity.is_purchased_batch();
boolean booleanValue = is_purchased_batch != null ? is_purchased_batch.booleanValue() : false;
String f5 = UW2.f(downloadEntity.getBatch_name());
QW2 qw2 = QW2.a;
String e2 = UW2.e(qw2);
String e3 = UW2.e(qw2);
String f6 = UW2.f(downloadEntity.getSubject_name());
String e4 = UW2.e(qw2);
tk0 tk0Var = tk0.a;
batchCredential = new BatchCredential(f, f2, f3, f4, floatValue, booleanValue, f5, e2, e3, f6, e4, (List) tk0Var, (List) tk0Var, (BatchData) null, 16384);
}
HI1.d(kr0, (Object) null, new t02(sd0Var2, batchCredential, downloadEntity != null ? new CourseCredential(UW2.f(downloadEntity.getSubject_id()), UW2.f(downloadEntity.getChapter_id()), UW2.f(downloadEntity.getTopic_id()), UW2.f(downloadEntity.getContent_id()), UW2.f(downloadEntity.getSubject_name()), UW2.f(downloadEntity.getChapter_name()), UW2.f(downloadEntity.getTopic_name()), UW2.f(downloadEntity.getContent_name()), false) : null, downloadEntity));
}
});
}
public final void onBackPressed() {
androidx.appcompat.app.c cVar;
if (this.W0 != null && (cVar = this.P0) != null && cVar.isShowing()) {
androidx.appcompat.app.c cVar2 = this.P0;
if (cVar2 != null) {
cVar2.dismiss();
}
b1();
d1();
return;
}
RecyclerView.g gVar = this.Y0;
if ((gVar == null || !gVar.d()) && U0().u.getVisibility() == 8 && U0().v.getVisibility() == 8 && U0().D.getVisibility() == 8 && U0().y.getVisibility() == 8) {
super/*OL*/.onBackPressed();
} else {
b1();
d1();
}
}
public final void onDestroy() {
S0();
CopyOnWriteArrayList<sd0> copyOnWriteArrayList = this.T0;
if (copyOnWriteArrayList != null) {
Iterator<sd0> it = copyOnWriteArrayList.iterator();
while (it.hasNext()) {
sd0 next = it.next();
String j = next.j();
if (j != null) {
if (Intrinsics.b(next.n, Boolean.FALSE)) {
rt0 rt0Var = rt0.y;
a.a().E(j, this.X0);
}
}
}
}
super/*xP0*/.onDestroy();
}
@Override
public final void x0() {
f1();
}
}