正在查看: MedEd v5.3.6 应用的 BatchOverviewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: MedEd v5.3.6 应用的 BatchOverviewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.penpencil.physicswallah.feature.batch.presentation.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.databinding.DataBinderMapperImpl;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.e;
import androidx.lifecycle.I;
import androidx.paging.L;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.d;
import com.google.gson.Gson;
import com.penpencil.network.response.BatchData;
import com.penpencil.network.response.BatchDetailsResponse;
import com.penpencil.network.response.BatchTopicContentData;
import com.penpencil.network.response.BatchTopicContentResponse;
import com.penpencil.network.response.GetVideoStatsData;
import com.penpencil.network.response.GetVideoStatsResponse;
import com.penpencil.network.response.SuccessResponse;
import com.penpencil.physicswallah.feature.batch.presentation.activity.BatchOverviewActivity;
import com.penpencil.physicswallah.feature.batch.presentation.fragment.AnnouncementFragment;
import com.penpencil.physicswallah.feature.batch.presentation.fragment.NeetPGClassSubjectFragment;
import com.penpencil.physicswallah.feature.batch.presentation.fragment.NeetPgDescriptionFragment;
import com.penpencil.physicswallah.feature.batch.utlis.ByPassBatchesPlans;
import com.penpencil.physicswallah.feature.home.presentation.ui.AppNavigationContainerActivity;
import com.penpencil.physicswallah.feature.profile.presentation.activity.NeetPGUserProfileActivity;
import com.penpencil.physicswallah.feature.revenue.presentation.activity.MedEdPlansActivity;
import com.penpencil.physicswallah.feature.revenue.presentation.args.MedEdPlansArgs;
import com.penpencil.physicswallah.feature.revenue.presentation.args.OrderSummaryArgs;
import defpackage.DP0;
import defpackage.E32;
import defpackage.Fj1;
import defpackage.Lc2;
import defpackage.Vs;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import kotlin.Pair;
import kotlin.jvm.internal.Intrinsics;
public class BatchOverviewActivity extends DP0 {
public static final int V0 = 0;
public ViewPager2 I0;
public TextView J0;
public ImageView K0;
public Vs L0;
public BatchData M0;
public Boolean N0;
public z5 O0;
public boolean P0;
public SM1 Q0;
public wQ1 R0;
public Dm3 S0;
public PL1 T0;
public boolean U0 = false;
public class a implements TabLayout.d {
public a() {
}
public final void a(TabLayout.f fVar) {
BatchData batchData;
if (fVar == null) {
return;
}
int i = fVar.d;
ag agVar = BatchOverviewActivity.this;
((TextView) ((LinearLayout) ((ViewGroup) agVar.O0.D.getChildAt(0)).getChildAt(i)).getChildAt(1)).setTypeface(qz2.b(agVar, 2131296259));
if (TextUtils.equals(agVar.getResources().getString(2132017977), fVar.b) && !agVar.M0.isPurchased()) {
agVar.X0(agVar.M0);
} else if (!TextUtils.equals(agVar.getResources().getString(2132017725), fVar.b) || agVar.M0.isPurchased()) {
agVar.X0(agVar.M0);
} else {
agVar.X0(agVar.M0);
}
if (TextUtils.equals(agVar.getResources().getString(2132018943), fVar.b)) {
View view = fVar.e;
if (view != null) {
((TextView) view.findViewById(2131363886)).setTextColor(agVar.getResources().getColor(2131102313));
}
} else if (fVar.b.toString().equals("Announcement") && (batchData = agVar.M0) != null) {
agVar.Q0.e("Announcement", batchData.getName());
}
if (!TextUtils.equals(agVar.getResources().getString(2132017977), fVar.b)) {
if (TextUtils.equals(agVar.getResources().getString(2132017725), fVar.b)) {
agVar.Q0.e(agVar.getResources().getString(2132017725), agVar.M0.getName());
}
} else if (agVar.U0) {
agVar.U0 = false;
} else {
agVar.Q0.e(agVar.getResources().getString(2132017977), agVar.M0.getName());
}
}
public final void b(TabLayout.f fVar) {
View view;
ag agVar = BatchOverviewActivity.this;
if (TextUtils.equals(agVar.getResources().getString(2132018943), fVar.b) && (view = fVar.e) != null) {
((TextView) view.findViewById(2131363886)).setTextColor(agVar.getResources().getColor(2131102314));
}
((TextView) ((LinearLayout) ((ViewGroup) agVar.O0.D.getChildAt(0)).getChildAt(fVar.d)).getChildAt(1)).setTypeface(qz2.b(agVar, 2131296261));
}
}
public final void U0() {
final String stringExtra = getIntent().getStringExtra("batchId");
final int i = 0;
this.P0 = getIntent().getBooleanExtra("isPurchased", false);
T0("Loading Batch Details");
this.L0.f(stringExtra).f(this, new b02() {
public final void a(Object obj) {
int i2 = i;
Object obj2 = stringExtra;
Object obj3 = this;
switch (i2) {
case 0:
e eVar = (BatchOverviewActivity) obj3;
String str = (String) obj2;
BatchDetailsResponse batchDetailsResponse = (BatchDetailsResponse) obj;
int i3 = BatchOverviewActivity.V0;
eVar.S0();
if (batchDetailsResponse == null || batchDetailsResponse.getData() == null) {
Toast.makeText((Context) eVar, 2132018186, 0).show();
return;
}
if (batchDetailsResponse.getSuccess()) {
eVar.M0 = batchDetailsResponse.getData();
((rp) eVar).C0.c().E(eVar.M0.get_id(), Boolean.valueOf(batchDetailsResponse.getData().isChatBlocked()));
BatchData batchData = eVar.M0;
if (batchData != null) {
eVar.P0 = batchData.isPurchased();
eVar.N0 = Boolean.valueOf(eVar.getIntent().getBooleanExtra("openBatchPayment", false));
boolean booleanExtra = eVar.getIntent().getBooleanExtra("IsKhazanaTab", false);
eVar.J0.setText(eVar.M0.getName());
boolean booleanExtra2 = eVar.getIntent().getBooleanExtra("From ANNOUNCEMENT", false);
eVar.K0.setVisibility(8);
bp1 c = ((rp) eVar).C0.c();
BatchData batchData2 = eVar.M0;
c.getClass();
c.a.u(a.M, pK0.h(BatchData.class, batchData2));
K03 k03 = new K03(eVar.getSupportFragmentManager(), eVar.getLifecycle());
wQ1 wq1 = eVar.R0;
String name = eVar.M0.getName();
String valueOf = String.valueOf(eVar.M0.getBatchPrice());
wq1.getClass();
Pair[] pairArr = new Pair[3];
if (name == null) {
name = "";
}
pairArr[0] = new Pair("batch_name", name);
pairArr[1] = new Pair("batch_id", str == null ? "" : str);
if (valueOf == null) {
valueOf = "";
}
pairArr[2] = new Pair("price", valueOf);
wq1.d("live_batch_description_page_view", Ls1.i(pairArr));
Parcelable parcelable = eVar.M0;
boolean z = eVar.P0;
NeetPgDescriptionFragment neetPgDescriptionFragment = new NeetPgDescriptionFragment();
Bundle bundle = new Bundle();
bundle.putParcelable("batchOverview", parcelable);
bundle.putBoolean("isPurchased", z);
bundle.putString("batchId", str);
neetPgDescriptionFragment.setArguments(bundle);
String string = eVar.getResources().getString(2132017977);
ArrayList<Fragment> arrayList = k03.l;
arrayList.add(neetPgDescriptionFragment);
ArrayList<String> arrayList2 = k03.m;
arrayList2.add(string);
Parcelable parcelable2 = eVar.M0;
NeetPGClassSubjectFragment neetPGClassSubjectFragment = new NeetPGClassSubjectFragment();
Bundle bundle2 = new Bundle();
bundle2.putParcelable("batchOverview", parcelable2);
neetPGClassSubjectFragment.setArguments(bundle2);
String string2 = eVar.getResources().getString(2132017725);
arrayList.add(neetPGClassSubjectFragment);
arrayList2.add(string2);
Parcelable parcelable3 = eVar.M0;
AnnouncementFragment announcementFragment = new AnnouncementFragment();
Bundle bundle3 = new Bundle();
bundle3.putParcelable("batchData", parcelable3);
announcementFragment.setArguments(bundle3);
String string3 = eVar.getResources().getString(2132017358);
arrayList.add(announcementFragment);
arrayList2.add(string3);
if (arrayList.size() <= 3) {
eVar.O0.D.setTabMode(1);
} else {
eVar.O0.D.setTabMode(0);
}
eVar.I0.setAdapter(k03);
TabLayout tabLayout = eVar.O0.D;
ViewPager2 viewPager2 = eVar.I0;
d dVar = new d(tabLayout, viewPager2, new DD2(k03));
if (dVar.e) {
throw new IllegalStateException("TabLayoutMediator is already attached");
}
RecyclerView.g adapter = viewPager2.getAdapter();
dVar.d = adapter;
if (adapter == null) {
throw new IllegalStateException("TabLayoutMediator attached before ViewPager2 has an adapter");
}
dVar.e = true;
viewPager2.c.a.add(new d.c(tabLayout));
tabLayout.a(new d.d(viewPager2, true));
dVar.d.registerAdapterDataObserver(new d.a(dVar));
dVar.a();
tabLayout.l(viewPager2.getCurrentItem(), 0.0f, true, true, true);
if (eVar.getIntent().getBooleanExtra("isFromDeepLink", false)) {
eVar.I0.setCurrentItem(1);
} else if (booleanExtra && !TextUtils.isEmpty(eVar.M0.getKhazanaProgramId())) {
eVar.I0.setCurrentItem(2);
} else if (booleanExtra2) {
eVar.I0.setCurrentItem(arrayList.size() - 1);
} else if (eVar.M0.isPurchased()) {
eVar.I0.setCurrentItem(1);
((rp) eVar).D0.a(eVar.M0.get_id());
}
if (eVar.N0.booleanValue()) {
eVar.W0();
return;
}
return;
}
return;
}
return;
default:
C0659ns c0659ns = (C0659ns) obj3;
L.b bVar = (L.b) obj2;
BatchTopicContentResponse batchTopicContentResponse = (BatchTopicContentResponse) obj;
c0659ns.j.a();
if (batchTopicContentResponse != null && batchTopicContentResponse.getSuccess() && batchTopicContentResponse.getSuccess()) {
if (batchTopicContentResponse.getData().isEmpty()) {
c0659ns.k.w0();
}
bVar.a(C0659ns.h(batchTopicContentResponse.getData()), c0659ns.i(c0659ns.d.intValue(), batchTopicContentResponse.getData()));
return;
}
return;
}
}
});
}
public final void V0(BatchData batchData, String str) {
int i;
String str2;
if (batchData.getFee() != null) {
if (str.equals("order_summary")) {
i = batchData.getFee().getFinalAmount();
str2 = batchData.getFee().getDiscountAmount();
} else {
i = 0;
str2 = "";
}
this.T0.e(batchData.getName(), this.M0.get_id(), String.valueOf(i), str2, "batch_description", str);
}
}
public final void W0() {
BatchData batchData = this.M0;
if (batchData == null) {
Toast.makeText((Context) this, (CharSequence) getString(2132020609), 0).show();
return;
}
if (batchData.isPurchased()) {
Toast.makeText((Context) this, (CharSequence) getString(2132017500), 0).show();
return;
}
if (!TextUtils.isEmpty(this.M0.getEndDate()) && !Af.i(this.M0.getEndDate())) {
Toast.makeText((Context) this, (CharSequence) getString(2132017506), 0).show();
return;
}
if (this.M0.isFree()) {
Vs vs = this.L0;
String str = this.M0.get_id();
Gr a2 = vs.b.a();
a2.getClass();
lH1 lh1 = new lH1();
a2.a.b().batchEnroll(str, (String) null, "").d(VF2.a()).a(Jc.a()).c(new Br(lh1));
lh1.f(this, new b02() {
public final void a(Object obj) {
int i = r2;
NeetPGUserProfileActivity neetPGUserProfileActivity = this;
switch (i) {
case 0:
?? r1 = (BatchOverviewActivity) neetPGUserProfileActivity;
SuccessResponse successResponse = (SuccessResponse) obj;
int i2 = BatchOverviewActivity.V0;
r1.S0();
if (successResponse != null) {
if (successResponse.getSuccess()) {
r1.S0.a();
r1.R0.e(r1.M0.getName(), r1.M0.get_id());
C0679oP1.a.put(r1.M0.get_id(), Long.valueOf(System.currentTimeMillis()));
Toast.makeText((Context) r1, 2132020732, 0).show();
Intent intent = new Intent((Context) r1, (Class<?>) AppNavigationContainerActivity.class);
intent.addFlags(67108864);
r1.startActivity(intent);
r1.finish();
break;
}
} else {
Toast.makeText((Context) r1, r1.getString(2132018186), 0).show();
break;
}
break;
default:
neetPGUserProfileActivity.L0 = (List) obj;
break;
}
}
});
return;
}
Kv0 a3 = kw2.a();
mw2 mw2Var = mw2.a;
String g = a3.h.g("bypass_plans");
Intrinsics.checkNotNullExpressionValue(g, "getString(...)");
ByPassBatchesPlans byPassBatchesPlans = g.isEmpty() ? null : (ByPassBatchesPlans) iK0.b(ByPassBatchesPlans.class, g);
String str2 = this.M0.get_id();
if (!str2.isEmpty() && byPassBatchesPlans != null && byPassBatchesPlans.getBatchIds() != null && !byPassBatchesPlans.getBatchIds().contains(str2)) {
V0(this.M0, "premium_plans");
Fj1.b(this, new AX1(this, 10));
return;
}
V0(this.M0, "order_summary");
Parcelable medEdPlansArgs = new MedEdPlansArgs(Lc2.i, new OrderSummaryArgs(this.M0.getFee() != null ? this.M0.getFee().getOriginalAmount() : 0, this.M0.getFee().getDiscountPercentage(), this.M0.getFee().getFinalAmount(), this.M0.getName(), null, "", "", this.M0.get_id(), "", "", E32.d, true));
Intrinsics.checkNotNullParameter(this, "context");
Intrinsics.checkNotNullParameter(medEdPlansArgs, "planArgs");
Intent intent = new Intent((Context) this, (Class<?>) MedEdPlansActivity.class);
intent.putExtra("ARGS_PLAN", medEdPlansArgs);
startActivity(intent);
}
public final void X0(BatchData batchData) {
if (batchData == null || batchData.getFee() == null) {
return;
}
if (batchData.getFee().getDiscount() <= 0.0f) {
this.O0.z.setVisibility(8);
} else {
this.O0.z.setText(Ut1.b(batchData.getFee().getDiscount()) + getString(2132019900));
}
if (batchData.getPriceLabel() != null) {
this.O0.B.setText(batchData.getPriceLabel());
}
this.O0.B.setVisibility(8);
if (batchData.isPurchased()) {
this.O0.w.setVisibility(8);
} else {
this.O0.w.setVisibility(0);
}
TextView textView = this.O0.x;
textView.setPaintFlags(textView.getPaintFlags() | 16);
if (batchData.getFee() == null) {
this.O0.x.setVisibility(8);
return;
}
this.O0.y.setText("₹" + Ut1.b(batchData.getFee().getTotal()));
this.O0.x.setText("" + Ut1.b(batchData.getFee().getAmount()));
if (batchData.getFee().getTotal() == 0.0f) {
this.O0.u.setText("Enroll");
} else {
this.O0.u.setText("Buy Now");
}
}
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
LayoutInflater layoutInflater = getLayoutInflater();
int i = z5.F;
DataBinderMapperImpl dataBinderMapperImpl = a00.a;
z5 p = Hs3.p(layoutInflater, 2131558437, (ViewGroup) null, (Object) null);
this.O0 = p;
setContentView(((Hs3) p).e);
this.U0 = true;
z5 z5Var = this.O0;
this.I0 = z5Var.E;
this.J0 = z5Var.t;
ImageView imageView = z5Var.C;
this.K0 = imageView;
imageView.setOnClickListener(new K0(this, 1));
this.O0.s.setOnClickListener(new gh0(this, 2));
this.O0.u.setOnClickListener(new wK0(this, 1));
this.O0.v.setOnClickListener(new xK0(this, 1));
String str = PV1.b;
if (!a.e(this)) {
((Hs3) this.O0.A).e.setVisibility(0);
}
this.O0.A.t.setOnClickListener(new Dt1(this, 2));
this.O0.A.s.setOnClickListener(new yK0(this, 2));
this.O0.E.setUserInputEnabled(false);
Intrinsics.checkNotNullParameter(this, "owner");
Qt3 viewModelStore = getViewModelStore();
I.c c = Pt3.c(this);
SW b = Pt3.b(this);
Intrinsics.checkNotNullParameter(viewModelStore, "store");
Intrinsics.checkNotNullParameter(c, "factory");
Ot3 b2 = Yd.b(b, "defaultCreationExtras", viewModelStore, c, b);
EG b3 = Y0.b(Vs.class, "modelClass", Vs.class, "<this>", Vs.class);
Intrinsics.checkNotNullParameter(b3, "modelClass");
this.L0 = (Vs) Ot3.b(b2, b3);
U0();
this.O0.D.a(new a());
}
public final void onNewIntent(final Intent intent) {
super/*OL*/.onNewIntent(intent);
String stringExtra = intent.getStringExtra("batchId");
T0(getString(2132019081));
final int i = 0;
this.L0.f(stringExtra).f(this, new b02() {
public final void a(Object obj) {
int i2 = i;
Object obj2 = intent;
Object obj3 = this;
switch (i2) {
case 0:
?? r2 = (BatchOverviewActivity) obj3;
Intent intent2 = (Intent) obj2;
BatchDetailsResponse batchDetailsResponse = (BatchDetailsResponse) obj;
int i3 = BatchOverviewActivity.V0;
r2.S0();
if (batchDetailsResponse == null) {
Toast.makeText((Context) r2, 2132018186, 0).show();
break;
} else if (batchDetailsResponse.getSuccess()) {
r2.M0 = batchDetailsResponse.getData();
boolean booleanExtra = intent2.getBooleanExtra("openBatchPayment", false);
r2.N0 = Boolean.valueOf(booleanExtra);
if (booleanExtra) {
r2.W0();
break;
}
}
break;
default:
final C0383fs c0383fs = (C0383fs) obj3;
final L.b bVar = (L.b) obj2;
BatchTopicContentResponse batchTopicContentResponse = (BatchTopicContentResponse) obj;
UP2 up2 = c0383fs.j;
up2.a();
if (batchTopicContentResponse == null) {
up2.a();
break;
} else if (batchTopicContentResponse.getSuccess()) {
if (c0383fs.k == null) {
c0383fs.k = new C0812sz("");
}
c0383fs.k.d(Long.valueOf(System.currentTimeMillis()));
if (!batchTopicContentResponse.getData().isEmpty() || batchTopicContentResponse.getRefresh().booleanValue()) {
c0383fs.k.c(new Gson().l(batchTopicContentResponse));
}
jV1 jv1 = c0383fs.i;
jv1.c().H("https://meded-api.penpencil.coep_programId_batch_topic_content_" + c0383fs.d + "_" + c0383fs.e + "_" + c0383fs.c + "_" + c0383fs.f + "_" + c0383fs.g, new Gson().l(c0383fs.k));
boolean isEmpty = TextUtils.isEmpty(c0383fs.k.a());
HashMap<Integer, List<BatchTopicContentData>> hashMap = c0383fs.l;
if (!isEmpty) {
hashMap.put(c0383fs.c, ((BatchTopicContentResponse) new Gson().d(BatchTopicContentResponse.class, c0383fs.k.a())).getData());
}
if (hashMap.get(c0383fs.c) == null) {
hashMap.put(c0383fs.c, new ArrayList());
}
ArrayList arrayList = new ArrayList();
for (BatchTopicContentData batchTopicContentData : hashMap.get(c0383fs.c)) {
if (batchTopicContentData.get_id() != null) {
arrayList.add(batchTopicContentData.get_id());
}
}
if (arrayList.isEmpty()) {
bVar.a(hashMap.get(c0383fs.c), c0383fs.h(c0383fs.c.intValue(), hashMap.get(c0383fs.c)));
break;
} else {
Lp3 f = jv1.f();
jv1.c().A();
f.b(arrayList).f(c0383fs.h, new b02() {
public final void a(Object obj4) {
GetVideoStatsResponse getVideoStatsResponse = (GetVideoStatsResponse) obj4;
C0383fs c0383fs2 = C0383fs.this;
c0383fs2.j.a();
HashMap<Integer, List<BatchTopicContentData>> hashMap2 = c0383fs2.l;
L.b bVar2 = bVar;
if (getVideoStatsResponse == null) {
bVar2.a(hashMap2.get(c0383fs2.c), c0383fs2.h(c0383fs2.c.intValue(), hashMap2.get(c0383fs2.c)));
return;
}
if (!getVideoStatsResponse.getSuccess()) {
bVar2.a(hashMap2.get(c0383fs2.c), c0383fs2.h(c0383fs2.c.intValue(), hashMap2.get(c0383fs2.c)));
return;
}
if (getVideoStatsResponse.getData().isEmpty()) {
bVar2.a(hashMap2.get(c0383fs2.c), c0383fs2.h(c0383fs2.c.intValue(), hashMap2.get(c0383fs2.c)));
return;
}
List<BatchTopicContentData> list = hashMap2.get(c0383fs2.c);
for (int i4 = 0; i4 < list.size(); i4++) {
Iterator it = getVideoStatsResponse.getData().iterator();
while (true) {
if (it.hasNext()) {
GetVideoStatsData getVideoStatsData = (GetVideoStatsData) it.next();
if (getVideoStatsData.getTypeId().equals(list.get(i4).get_id())) {
list.get(i4).setVideoStats(getVideoStatsData);
break;
}
list.get(i4).setVideoStats((GetVideoStatsData) null);
}
}
}
hashMap2.put(c0383fs2.c, list);
bVar2.a(hashMap2.get(c0383fs2.c), c0383fs2.h(c0383fs2.c.intValue(), hashMap2.get(c0383fs2.c)));
}
});
break;
}
} else {
up2.a();
break;
}
break;
}
}
});
}
public final void onStart() {
super.onStart();
}
}