Money Lover v8.14.0.6版本的 MD5 值为:48b9d922212c7ccfd438cdcc183ff396
以下内容为反编译后的 i.java 源代码,内容仅作参考
package gb;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.activity.result.ActivityResult;
import androidx.appcompat.widget.n0;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.q0;
import androidx.lifecycle.i;
import androidx.lifecycle.o0;
import androidx.lifecycle.r0;
import androidx.viewpager2.widget.ViewPager2;
import com.bookmark.money.R;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import com.zoostudio.moneylover.MoneyApplication;
import com.zoostudio.moneylover.globalcate.budget.detail.ui.ActivityAddBudget;
import com.zoostudio.moneylover.globalcate.budget.listBudget.model.HeaderItem;
import com.zoostudio.moneylover.main.MainActivity;
import com.zoostudio.moneylover.ui.activity.ActivityPremiumStore;
import com.zoostudio.moneylover.ui.switcherWallet.ActivityWalletSwitcher;
import com.zoostudio.moneylover.utils.m0;
import com.zoostudio.moneylover.views.ImageViewGlide;
import com.zoostudio.moneylover.views.MLToolbar;
import gb.i;
import h3.j6;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.Locale;
import java.util.TimeZone;
import kotlin.jvm.internal.k0;
import kotlin.jvm.internal.p0;
import org.apache.poi.ss.usermodel.DateUtil;
import org.zoostudio.fw.view.CustomFontTextView;
import u0.a;
public final class i extends n7.d {
public static final a R = new a(null);
private final kn.g B;
private com.zoostudio.moneylover.adapter.item.a C;
private MainActivity H;
private CountDownTimer L;
private final j M;
private Dialog Q;
private j6 f18212c;
private AlertDialog f18213d;
private final kn.g f18214e;
private final kn.g f18215f;
private final kn.g f18216g;
private final kn.g f18217i;
private final kn.g f18218j;
private final androidx.activity.result.b<Intent> f18219o;
private final BroadcastReceiver f18220p;
private final C0325i f18221q;
public static final class a {
private a() {
}
public a(kotlin.jvm.internal.j jVar) {
this();
}
}
public static final class a0 extends kotlin.jvm.internal.t implements wn.a<u0.a> {
final wn.a f18222a;
final kn.g f18223b;
public a0(wn.a aVar, kn.g gVar) {
super(0);
this.f18222a = aVar;
this.f18223b = gVar;
}
@Override
public final u0.a invoke() {
r0 c10;
androidx.lifecycle.h hVar;
u0.a aVar;
wn.a aVar2 = this.f18222a;
if (aVar2 == null || (aVar = (u0.a) aVar2.invoke()) == null) {
c10 = q0.c(this.f18223b);
if (c10 instanceof androidx.lifecycle.h) {
hVar = (androidx.lifecycle.h) c10;
} else {
hVar = null;
}
if (hVar != null) {
return hVar.getDefaultViewModelCreationExtras();
}
return a.C0605a.f34814b;
}
return aVar;
}
}
static final class b extends kotlin.jvm.internal.t implements wn.a<Long> {
public static final b f18224a = new b();
b() {
super(0);
}
@Override
public final Long invoke() {
return Long.valueOf(zi.f.a().F());
}
}
static final class b0 extends kotlin.jvm.internal.t implements wn.a<String> {
public static final b0 f18225a = new b0();
b0() {
super(0);
}
@Override
public final String invoke() {
return rt.c.c(new Date(System.currentTimeMillis()));
}
}
static final class c extends kotlin.jvm.internal.t implements wn.a<String[]> {
c() {
super(0);
}
@Override
public final String[] invoke() {
return i.this.getResources().getStringArray(R.array.date_format_values);
}
}
public static final class d extends kotlin.jvm.internal.t implements wn.l<ArrayList<Object>, kn.v> {
final String f18228b;
final Integer f18229c;
final String f18230d;
final String f18231e;
public static final class a implements hd.a {
final i f18232a;
final hd.d f18233b;
a(i iVar, hd.d dVar) {
this.f18232a = iVar;
this.f18233b = dVar;
}
@Override
public void a() {
this.f18232a.n0();
this.f18233b.dismiss();
}
}
d(String str, Integer num, String str2, String str3) {
super(1);
this.f18228b = str;
this.f18229c = num;
this.f18230d = str2;
this.f18231e = str3;
}
public final void a(ArrayList<Object> it) {
int j02;
boolean z10;
kotlin.jvm.internal.r.h(it, "it");
Object obj = null;
j6 j6Var = null;
j6 j6Var2 = null;
if (i.this.h0().v().isEmpty()) {
j6 j6Var3 = i.this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
ViewPager2 viewPager = j6Var3.L;
kotlin.jvm.internal.r.g(viewPager, "viewPager");
el.d.d(viewPager);
j6 j6Var4 = i.this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
TabLayout tabLayout = j6Var4.C;
kotlin.jvm.internal.r.g(tabLayout, "tabLayout");
el.d.d(tabLayout);
if (kotlin.jvm.internal.r.c(this.f18228b, i.this.getString(R.string.running_budgets))) {
j6 j6Var5 = i.this.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var = j6Var5;
}
LinearLayout emptyViewBackground = j6Var.f20584j;
kotlin.jvm.internal.r.g(emptyViewBackground, "emptyViewBackground");
el.d.k(emptyViewBackground);
} else {
j6 j6Var6 = i.this.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var6;
}
LinearLayout emptyViewBackground2 = j6Var2.f20584j;
kotlin.jvm.internal.r.g(emptyViewBackground2, "emptyViewBackground");
el.d.d(emptyViewBackground2);
}
Boolean o12 = zi.f.a().o1();
kotlin.jvm.internal.r.g(o12, "getShowSampleBudget(...)");
if (o12.booleanValue()) {
hd.d dVar = new hd.d();
dVar.z(new a(i.this, dVar));
dVar.show(i.this.getChildFragmentManager(), "");
zi.f.a().y5(Boolean.FALSE);
return;
}
return;
}
ArrayList arrayList = new ArrayList();
Iterator<T> it2 = i.this.h0().v().iterator();
while (it2.hasNext()) {
arrayList.add(HeaderItem.b((HeaderItem) it2.next(), null, null, 0, null, null, 0.0f, 0.0f, 127, null));
}
bb.a h02 = i.this.h0();
String string = i.this.getString(R.string.thismonth);
kotlin.jvm.internal.r.g(string, "getString(...)");
h02.q(string, arrayList);
bb.a h03 = i.this.h0();
String string2 = i.this.getString(R.string.thisweek);
kotlin.jvm.internal.r.g(string2, "getString(...)");
h03.q(string2, arrayList);
bb.a h04 = i.this.h0();
String string3 = i.this.getString(R.string.thisquarter);
kotlin.jvm.internal.r.g(string3, "getString(...)");
h04.q(string3, arrayList);
bb.a h05 = i.this.h0();
String string4 = i.this.getString(R.string.thisyear);
kotlin.jvm.internal.r.g(string4, "getString(...)");
h05.q(string4, arrayList);
if (kotlin.jvm.internal.r.c(this.f18228b, i.this.getString(R.string.running_budgets))) {
j6 j6Var7 = i.this.f18212c;
if (j6Var7 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var7 = null;
}
TabLayout tabLayout2 = j6Var7.C;
kotlin.jvm.internal.r.g(tabLayout2, "tabLayout");
el.d.k(tabLayout2);
j6 j6Var8 = i.this.f18212c;
if (j6Var8 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var8 = null;
}
ViewPager2 viewPager2 = j6Var8.L;
kotlin.jvm.internal.r.g(viewPager2, "viewPager");
el.d.k(viewPager2);
j6 j6Var9 = i.this.f18212c;
if (j6Var9 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var9 = null;
}
LinearLayout emptyViewBackground3 = j6Var9.f20584j;
kotlin.jvm.internal.r.g(emptyViewBackground3, "emptyViewBackground");
el.d.d(emptyViewBackground3);
} else {
j6 j6Var10 = i.this.f18212c;
if (j6Var10 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var10 = null;
}
TabLayout tabLayout3 = j6Var10.C;
kotlin.jvm.internal.r.g(tabLayout3, "tabLayout");
el.d.d(tabLayout3);
j6 j6Var11 = i.this.f18212c;
if (j6Var11 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var11 = null;
}
ViewPager2 viewPager3 = j6Var11.L;
kotlin.jvm.internal.r.g(viewPager3, "viewPager");
el.d.d(viewPager3);
j6 j6Var12 = i.this.f18212c;
if (j6Var12 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var12 = null;
}
LinearLayout emptyViewBackground4 = j6Var12.f20584j;
kotlin.jvm.internal.r.g(emptyViewBackground4, "emptyViewBackground");
el.d.d(emptyViewBackground4);
}
Integer num = this.f18229c;
String str = this.f18230d;
String str2 = this.f18231e;
Iterator it3 = arrayList.iterator();
while (true) {
if (!it3.hasNext()) {
break;
}
Object next = it3.next();
HeaderItem headerItem = (HeaderItem) next;
int i10 = headerItem.i();
if (num != null && i10 == num.intValue() && kotlin.jvm.internal.r.c(headerItem.f(), str) && kotlin.jvm.internal.r.c(headerItem.d(), str2)) {
z10 = true;
} else {
z10 = false;
}
if (z10) {
obj = next;
break;
}
}
j02 = ln.z.j0(arrayList, (HeaderItem) obj);
if (j02 == -1) {
j02 = i.this.g0().g();
}
i.this.w0(arrayList, j02);
i.this.g0().i(j02);
}
@Override
public kn.v invoke(ArrayList<Object> arrayList) {
a(arrayList);
return kn.v.f26314a;
}
}
public static final class e extends kotlin.jvm.internal.t implements wn.l<com.zoostudio.moneylover.adapter.item.a, kn.v> {
e() {
super(1);
}
public final void a(com.zoostudio.moneylover.adapter.item.a aVar) {
i iVar = i.this;
if (aVar == null) {
aVar = m0.q(iVar.requireContext());
}
iVar.C = aVar;
i.this.p0();
}
@Override
public kn.v invoke(com.zoostudio.moneylover.adapter.item.a aVar) {
a(aVar);
return kn.v.f26314a;
}
}
public static final class f implements androidx.core.view.o {
f() {
}
public static final boolean f(i this$0, MenuItem menuItem) {
kotlin.jvm.internal.r.h(this$0, "this$0");
int itemId = menuItem.getItemId();
MainActivity mainActivity = null;
if (itemId == R.id.finish_budget) {
j6 j6Var = this$0.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
j6Var.H.setNavigationIcon(R.drawable.ic_arrow_left);
j6 j6Var2 = this$0.f18212c;
if (j6Var2 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var2 = null;
}
TabLayout tabLayout = j6Var2.C;
kotlin.jvm.internal.r.g(tabLayout, "tabLayout");
el.d.d(tabLayout);
j6 j6Var3 = this$0.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
ViewPager2 viewPager = j6Var3.L;
kotlin.jvm.internal.r.g(viewPager, "viewPager");
el.d.d(viewPager);
j6 j6Var4 = this$0.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
LinearLayout emptyViewBackground = j6Var4.f20584j;
kotlin.jvm.internal.r.g(emptyViewBackground, "emptyViewBackground");
el.d.d(emptyViewBackground);
j6 j6Var5 = this$0.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var5 = null;
}
MLToolbar mLToolbar = j6Var5.H;
MainActivity mainActivity2 = this$0.H;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity2 = null;
}
mLToolbar.setTitle(mainActivity2.getString(R.string.finished_budgets));
za.c cVar = new za.c();
Bundle bundle = new Bundle();
bundle.putSerializable("wallet", cVar.h0());
MainActivity mainActivity3 = this$0.H;
if (mainActivity3 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity3;
}
bundle.putString("tab_budget", mainActivity.getString(R.string.finished));
cVar.setArguments(bundle);
FragmentManager childFragmentManager = this$0.getChildFragmentManager();
kotlin.jvm.internal.r.g(childFragmentManager, "getChildFragmentManager(...)");
if (childFragmentManager.V0()) {
return true;
}
childFragmentManager.p().b(R.id.container_budget_finish, cVar).h(cVar.getTag()).j();
return true;
}
if (itemId == R.id.running_budget) {
j6 j6Var6 = this$0.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var6 = null;
}
j6Var6.H.setTitle(this$0.getString(R.string.running_budgets));
i.j0(this$0, null, null, null, 7, null);
this$0.getChildFragmentManager().i1();
j6 j6Var7 = this$0.f18212c;
if (j6Var7 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var7 = null;
}
j6Var7.H.setNavigationIcon((Drawable) null);
return true;
}
return false;
}
@Override
public void a(Menu menu, MenuInflater menuInflater) {
kotlin.jvm.internal.r.h(menu, "menu");
kotlin.jvm.internal.r.h(menuInflater, "menuInflater");
menuInflater.inflate(R.menu.menu_budget_finish, menu);
}
@Override
public boolean d(MenuItem menuItem) {
MainActivity mainActivity;
kotlin.jvm.internal.r.h(menuItem, "menuItem");
if (menuItem.getItemId() == R.id.finish_budget) {
MainActivity mainActivity2 = i.this.H;
String str = null;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity = null;
} else {
mainActivity = mainActivity2;
}
j6 j6Var = i.this.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
n0 n0Var = new n0(mainActivity, j6Var.f20579d, 0, 0, R.style.PopupMenuBudget);
n0Var.b().inflate(R.menu.menu_view_finish_budget, n0Var.a());
MenuItem findItem = n0Var.a().findItem(R.id.finish_budget);
MenuItem findItem2 = n0Var.a().findItem(R.id.running_budget);
j6 j6Var2 = i.this.f18212c;
if (j6Var2 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var2 = null;
}
CharSequence title = j6Var2.H.getTitle();
if (title != null) {
str = title.toString();
}
if (kotlin.jvm.internal.r.c(str, i.this.getString(R.string.running_budgets))) {
findItem.setVisible(true);
findItem2.setVisible(false);
} else {
findItem.setVisible(false);
findItem2.setVisible(true);
}
final i iVar = i.this;
n0Var.e(new n0.d() {
@Override
public final boolean onMenuItemClick(MenuItem menuItem2) {
boolean f10;
f10 = i.f.f(i.this, menuItem2);
return f10;
}
});
n0Var.f();
return true;
}
return false;
}
}
public static final class g implements TabLayout.OnTabSelectedListener {
g() {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
@Override
public void onTabSelected(TabLayout.Tab tab) {
j6 j6Var = i.this.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
ViewPager2 viewPager2 = j6Var.L;
kotlin.jvm.internal.r.e(tab);
viewPager2.setCurrentItem(tab.getPosition());
i.this.g0().i(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
}
static final class h extends kotlin.jvm.internal.t implements wn.a<Boolean> {
public static final h f18237a = new h();
h() {
super(0);
}
@Override
public final Boolean invoke() {
return Boolean.valueOf(zi.f.a().e2());
}
}
public static final class C0325i extends BroadcastReceiver {
C0325i() {
}
@Override
public void onReceive(Context context, Intent intent) {
kotlin.jvm.internal.r.h(context, "context");
kotlin.jvm.internal.r.h(intent, "intent");
i.j0(i.this, null, null, null, 7, null);
}
}
public static final class j extends BroadcastReceiver {
j() {
}
@Override
public void onReceive(Context context, Intent intent) {
Long l10;
Long l11;
kotlin.jvm.internal.r.h(context, "context");
kotlin.jvm.internal.r.h(intent, "intent");
com.zoostudio.moneylover.adapter.item.a aVar = (com.zoostudio.moneylover.adapter.item.a) intent.getSerializableExtra("wallet");
MainActivity mainActivity = null;
if (i.this.C == null) {
i iVar = i.this;
MainActivity mainActivity2 = iVar.H;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity2 = null;
}
iVar.C = mainActivity2.X2().X().f();
}
com.zoostudio.moneylover.adapter.item.a aVar2 = i.this.C;
if (aVar2 != null) {
l10 = Long.valueOf(aVar2.getId());
} else {
l10 = null;
}
if (aVar != null) {
l11 = Long.valueOf(aVar.getId());
} else {
l11 = null;
}
boolean c10 = kotlin.jvm.internal.r.c(l10, l11);
boolean z10 = true;
if (!c10) {
i.this.C = aVar;
i.this.p0();
if (intent.getBooleanExtra("add_budget_successfully", false)) {
String stringExtra = intent.getStringExtra("label_names");
MainActivity mainActivity3 = i.this.H;
if (mainActivity3 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity3;
}
FrameLayout container = mainActivity.W2().f21977j;
kotlin.jvm.internal.r.g(container, "container");
String string = i.this.getString(R.string.add_budget_success_toast, stringExtra);
kotlin.jvm.internal.r.g(string, "getString(...)");
gc.a.a(container, string, -180.0f);
} else if (intent.getBooleanExtra("delete_budget_successfully", false)) {
String stringExtra2 = intent.getStringExtra("label_names");
MainActivity mainActivity4 = i.this.H;
if (mainActivity4 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity4;
}
FrameLayout container2 = mainActivity.W2().f21977j;
kotlin.jvm.internal.r.g(container2, "container");
String string2 = i.this.getString(R.string.delete_budget_success_toast, stringExtra2);
kotlin.jvm.internal.r.g(string2, "getString(...)");
gc.a.a(container2, string2, -180.0f);
} else if (intent.getBooleanExtra("edit_budget_successfully", false)) {
String stringExtra3 = intent.getStringExtra("label_names");
MainActivity mainActivity5 = i.this.H;
if (mainActivity5 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity5;
}
FrameLayout container3 = mainActivity.W2().f21977j;
kotlin.jvm.internal.r.g(container3, "container");
String string3 = i.this.getString(R.string.edit_budget_success_toast, stringExtra3);
kotlin.jvm.internal.r.g(string3, "getString(...)");
gc.a.a(container3, string3, -180.0f);
}
}
if (i.this.h0().v().isEmpty()) {
i.j0(i.this, null, null, null, 7, null);
return;
}
int intExtra = intent.getIntExtra("budget_type", 2);
String stringExtra4 = intent.getStringExtra("START_DATE");
String stringExtra5 = intent.getStringExtra("END_DATE");
for (HeaderItem headerItem : i.this.h0().v()) {
if (headerItem.i() == intExtra && kotlin.jvm.internal.r.c(headerItem.f(), stringExtra4) && kotlin.jvm.internal.r.c(headerItem.d(), stringExtra5)) {
z10 = false;
}
}
if (z10) {
i.this.i0(Integer.valueOf(intExtra), stringExtra4, stringExtra5);
}
}
}
public static final class k extends BroadcastReceiver {
static final class a extends kotlin.jvm.internal.t implements wn.l<com.zoostudio.moneylover.adapter.item.a, kn.v> {
final i f18241a;
a(i iVar) {
super(1);
this.f18241a = iVar;
}
public final void a(com.zoostudio.moneylover.adapter.item.a aVar) {
i iVar = this.f18241a;
if (aVar == null) {
aVar = m0.q(iVar.requireContext());
}
iVar.C = aVar;
this.f18241a.p0();
}
@Override
public kn.v invoke(com.zoostudio.moneylover.adapter.item.a aVar) {
a(aVar);
return kn.v.f26314a;
}
}
k() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (context != null) {
bb.a h02 = i.this.h0();
String uuid = MoneyApplication.f11023j.o(context).getUUID();
kotlin.jvm.internal.r.g(uuid, "getUUID(...)");
h02.n(context, uuid);
}
ib.a g02 = i.this.g0();
Context requireContext = i.this.requireContext();
kotlin.jvm.internal.r.g(requireContext, "requireContext(...)");
g02.h(requireContext, zi.f.a().F(), new a(i.this));
}
}
public static final class l implements androidx.lifecycle.x, kotlin.jvm.internal.m {
private final wn.l f18242a;
l(wn.l function) {
kotlin.jvm.internal.r.h(function, "function");
this.f18242a = function;
}
@Override
public final kn.c<?> a() {
return this.f18242a;
}
@Override
public final void b(Object obj) {
this.f18242a.invoke(obj);
}
public final boolean equals(Object obj) {
if ((obj instanceof androidx.lifecycle.x) && (obj instanceof kotlin.jvm.internal.m)) {
return kotlin.jvm.internal.r.c(a(), ((kotlin.jvm.internal.m) obj).a());
}
return false;
}
public final int hashCode() {
return a().hashCode();
}
}
public static final class m extends kotlin.jvm.internal.t implements wn.l<Long, kn.v> {
m() {
super(1);
}
public final void a(Long l10) {
j6 j6Var = null;
if (l10 == null || l10.longValue() <= 1000 || !zi.f.a().A2() || zi.f.a().t2()) {
j6 j6Var2 = i.this.f18212c;
if (j6Var2 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var = j6Var2;
}
ConstraintLayout root = j6Var.f20578c.getRoot();
kotlin.jvm.internal.r.g(root, "getRoot(...)");
el.d.d(root);
return;
}
if (l10.longValue() / DateUtil.DAY_MILLISECONDS >= 1) {
long longValue = l10.longValue() / DateUtil.DAY_MILLISECONDS;
long longValue2 = (l10.longValue() % DateUtil.DAY_MILLISECONDS) / 3600000;
if (longValue2 < 1) {
int i10 = (int) longValue;
String quantityString = i.this.getResources().getQuantityString(R.plurals.plural_time_day, i10, Integer.valueOf(i10));
kotlin.jvm.internal.r.g(quantityString, "getQuantityString(...)");
j6 j6Var3 = i.this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
CustomFontTextView customFontTextView = j6Var3.f20578c.f21668f;
p0 p0Var = p0.f26377a;
String format = String.format(String.valueOf(quantityString), Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.r.g(format, "format(format, *args)");
customFontTextView.setText(format);
} else {
int i11 = (int) longValue;
String quantityString2 = i.this.getResources().getQuantityString(R.plurals.plural_time_day, i11, Integer.valueOf(i11));
kotlin.jvm.internal.r.g(quantityString2, "getQuantityString(...)");
int i12 = (int) longValue2;
String quantityString3 = i.this.getResources().getQuantityString(R.plurals.plurals_hour, i12, Integer.valueOf(i12));
kotlin.jvm.internal.r.g(quantityString3, "getQuantityString(...)");
j6 j6Var4 = i.this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
CustomFontTextView customFontTextView2 = j6Var4.f20578c.f21668f;
p0 p0Var2 = p0.f26377a;
String format2 = String.format(quantityString2 + ' ' + quantityString3, Arrays.copyOf(new Object[0], 0));
kotlin.jvm.internal.r.g(format2, "format(format, *args)");
customFontTextView2.setText(format2);
}
} else {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss", Locale.getDefault());
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = new Date(l10.longValue());
j6 j6Var5 = i.this.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var5 = null;
}
j6Var5.f20578c.f21668f.setText(simpleDateFormat.format(date));
}
j6 j6Var6 = i.this.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var = j6Var6;
}
ConstraintLayout root2 = j6Var.f20578c.getRoot();
kotlin.jvm.internal.r.g(root2, "getRoot(...)");
el.d.k(root2);
}
@Override
public kn.v invoke(Long l10) {
a(l10);
return kn.v.f26314a;
}
}
public static final class n extends kotlin.jvm.internal.t implements wn.a<kn.v> {
n() {
super(0);
}
@Override
public kn.v invoke() {
invoke2();
return kn.v.f26314a;
}
public final void invoke2() {
c9.b.f7270d.a(true).show(i.this.getParentFragmentManager(), "");
AlertDialog l02 = i.this.l0();
if (l02 != null) {
l02.dismiss();
}
}
}
public static final class o extends kotlin.jvm.internal.t implements wn.a<kn.v> {
o() {
super(0);
}
@Override
public kn.v invoke() {
invoke2();
return kn.v.f26314a;
}
public final void invoke2() {
AlertDialog l02 = i.this.l0();
if (l02 != null) {
l02.dismiss();
}
}
}
public static final class p extends kotlin.jvm.internal.t implements wn.a<kn.v> {
p() {
super(0);
}
@Override
public kn.v invoke() {
invoke2();
return kn.v.f26314a;
}
public final void invoke2() {
i.this.startActivity(ActivityPremiumStore.Ak.b(i.this.getContext(), 1));
Dialog dialog = i.this.Q;
if (dialog != null) {
dialog.dismiss();
}
}
}
public static final class q extends kotlin.jvm.internal.t implements wn.a<kn.v> {
q() {
super(0);
}
@Override
public kn.v invoke() {
invoke2();
return kn.v.f26314a;
}
public final void invoke2() {
Dialog dialog = i.this.Q;
if (dialog != null) {
dialog.dismiss();
}
}
}
public static final class r extends kotlin.jvm.internal.t implements wn.a<o0.b> {
final Fragment f18248a;
final kn.g f18249b;
public r(Fragment fragment, kn.g gVar) {
super(0);
this.f18248a = fragment;
this.f18249b = gVar;
}
@Override
public final o0.b invoke() {
r0 c10;
androidx.lifecycle.h hVar;
o0.b defaultViewModelProviderFactory;
c10 = q0.c(this.f18249b);
if (c10 instanceof androidx.lifecycle.h) {
hVar = (androidx.lifecycle.h) c10;
} else {
hVar = null;
}
if (hVar == null || (defaultViewModelProviderFactory = hVar.getDefaultViewModelProviderFactory()) == null) {
o0.b defaultViewModelProviderFactory2 = this.f18248a.getDefaultViewModelProviderFactory();
kotlin.jvm.internal.r.g(defaultViewModelProviderFactory2, "defaultViewModelProviderFactory");
return defaultViewModelProviderFactory2;
}
return defaultViewModelProviderFactory;
}
}
public static final class s extends kotlin.jvm.internal.t implements wn.a<Fragment> {
final Fragment f18250a;
public s(Fragment fragment) {
super(0);
this.f18250a = fragment;
}
@Override
public final Fragment invoke() {
return this.f18250a;
}
}
public static final class t extends kotlin.jvm.internal.t implements wn.a<r0> {
final wn.a f18251a;
public t(wn.a aVar) {
super(0);
this.f18251a = aVar;
}
@Override
public final r0 invoke() {
return (r0) this.f18251a.invoke();
}
}
public static final class u extends kotlin.jvm.internal.t implements wn.a<androidx.lifecycle.q0> {
final kn.g f18252a;
public u(kn.g gVar) {
super(0);
this.f18252a = gVar;
}
@Override
public final androidx.lifecycle.q0 invoke() {
r0 c10;
c10 = q0.c(this.f18252a);
return c10.getViewModelStore();
}
}
public static final class v extends kotlin.jvm.internal.t implements wn.a<u0.a> {
final wn.a f18253a;
final kn.g f18254b;
public v(wn.a aVar, kn.g gVar) {
super(0);
this.f18253a = aVar;
this.f18254b = gVar;
}
@Override
public final u0.a invoke() {
r0 c10;
androidx.lifecycle.h hVar;
u0.a aVar;
wn.a aVar2 = this.f18253a;
if (aVar2 == null || (aVar = (u0.a) aVar2.invoke()) == null) {
c10 = q0.c(this.f18254b);
if (c10 instanceof androidx.lifecycle.h) {
hVar = (androidx.lifecycle.h) c10;
} else {
hVar = null;
}
if (hVar != null) {
return hVar.getDefaultViewModelCreationExtras();
}
return a.C0605a.f34814b;
}
return aVar;
}
}
public static final class w extends kotlin.jvm.internal.t implements wn.a<o0.b> {
final Fragment f18255a;
final kn.g f18256b;
public w(Fragment fragment, kn.g gVar) {
super(0);
this.f18255a = fragment;
this.f18256b = gVar;
}
@Override
public final o0.b invoke() {
r0 c10;
androidx.lifecycle.h hVar;
o0.b defaultViewModelProviderFactory;
c10 = q0.c(this.f18256b);
if (c10 instanceof androidx.lifecycle.h) {
hVar = (androidx.lifecycle.h) c10;
} else {
hVar = null;
}
if (hVar == null || (defaultViewModelProviderFactory = hVar.getDefaultViewModelProviderFactory()) == null) {
o0.b defaultViewModelProviderFactory2 = this.f18255a.getDefaultViewModelProviderFactory();
kotlin.jvm.internal.r.g(defaultViewModelProviderFactory2, "defaultViewModelProviderFactory");
return defaultViewModelProviderFactory2;
}
return defaultViewModelProviderFactory;
}
}
public static final class x extends kotlin.jvm.internal.t implements wn.a<Fragment> {
final Fragment f18257a;
public x(Fragment fragment) {
super(0);
this.f18257a = fragment;
}
@Override
public final Fragment invoke() {
return this.f18257a;
}
}
public static final class y extends kotlin.jvm.internal.t implements wn.a<r0> {
final wn.a f18258a;
public y(wn.a aVar) {
super(0);
this.f18258a = aVar;
}
@Override
public final r0 invoke() {
return (r0) this.f18258a.invoke();
}
}
public static final class z extends kotlin.jvm.internal.t implements wn.a<androidx.lifecycle.q0> {
final kn.g f18259a;
public z(kn.g gVar) {
super(0);
this.f18259a = gVar;
}
@Override
public final androidx.lifecycle.q0 invoke() {
r0 c10;
c10 = q0.c(this.f18259a);
return c10.getViewModelStore();
}
}
public i() {
kn.g a10;
kn.g a11;
kn.g b10;
kn.g b11;
kn.g b12;
kn.g b13;
s sVar = new s(this);
kn.k kVar = kn.k.f26293c;
a10 = kn.i.a(kVar, new t(sVar));
this.f18214e = q0.b(this, k0.b(ib.a.class), new u(a10), new v(null, a10), new w(this, a10));
a11 = kn.i.a(kVar, new y(new x(this)));
this.f18215f = q0.b(this, k0.b(bb.a.class), new z(a11), new a0(null, a11), new r(this, a11));
b10 = kn.i.b(h.f18237a);
this.f18216g = b10;
b11 = kn.i.b(new c());
this.f18217i = b11;
b12 = kn.i.b(b0.f18225a);
this.f18218j = b12;
androidx.activity.result.b<Intent> registerForActivityResult = registerForActivityResult(new c.c(), new androidx.activity.result.a() {
@Override
public final void a(Object obj) {
i.A0(i.this, (ActivityResult) obj);
}
});
kotlin.jvm.internal.r.g(registerForActivityResult, "registerForActivityResult(...)");
this.f18219o = registerForActivityResult;
this.f18220p = new k();
this.f18221q = new C0325i();
b13 = kn.i.b(b.f18224a);
this.B = b13;
this.M = new j();
}
public static final void A0(i this$0, ActivityResult activityResult) {
kotlin.jvm.internal.r.h(this$0, "this$0");
if (activityResult.b() == -1) {
try {
Intent a10 = activityResult.a();
kotlin.jvm.internal.r.e(a10);
Serializable serializableExtra = a10.getSerializableExtra("EXTRA_SELECTED_ACCOUNT_ITEM");
kotlin.jvm.internal.r.f(serializableExtra, "null cannot be cast to non-null type com.zoostudio.moneylover.adapter.item.AccountItem");
com.zoostudio.moneylover.adapter.item.a aVar = (com.zoostudio.moneylover.adapter.item.a) serializableExtra;
this$0.C = aVar;
boolean z10 = true;
if (aVar == null || !aVar.isTotalAccount()) {
z10 = false;
}
if (z10) {
this$0.C = m0.q(this$0.requireContext());
}
zi.a a11 = zi.f.a();
com.zoostudio.moneylover.adapter.item.a aVar2 = this$0.C;
kotlin.jvm.internal.r.e(aVar2);
a11.d3(aVar2.getId());
this$0.p0();
} catch (Exception e10) {
e10.printStackTrace();
}
}
}
private final void B0() {
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
MainActivity mainActivity = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
ImageView icClose = j6Var.f20578c.f21664b;
kotlin.jvm.internal.r.g(icClose, "icClose");
el.d.k(icClose);
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
ImageView icLogo = j6Var3.f20578c.f21666d;
kotlin.jvm.internal.r.g(icLogo, "icLogo");
ViewGroup.LayoutParams layoutParams = icLogo.getLayoutParams();
if (layoutParams != null) {
ConstraintLayout.b bVar = (ConstraintLayout.b) layoutParams;
((ViewGroup.MarginLayoutParams) bVar).rightMargin = getResources().getDimensionPixelSize(R.dimen.spacing_18);
((ViewGroup.MarginLayoutParams) bVar).width = getResources().getDimensionPixelSize(R.dimen.height_checkbox);
((ViewGroup.MarginLayoutParams) bVar).height = getResources().getDimensionPixelSize(R.dimen.item_user_height);
icLogo.setLayoutParams(bVar);
j6 j6Var4 = this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
j6Var4.f20578c.f21669g.setTextSize(14.0f);
j6 j6Var5 = this.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var5 = null;
}
j6Var5.f20578c.f21668f.setTextSize(12.0f);
j6 j6Var6 = this.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var6 = null;
}
j6Var6.f20578c.f21664b.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.C0(i.this, view);
}
});
j6 j6Var7 = this.f18212c;
if (j6Var7 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var7 = null;
}
j6Var7.f20578c.f21667e.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.D0(i.this, view);
}
});
if (zi.f.a().A2() && !zi.f.a().t2()) {
MainActivity mainActivity2 = this.H;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity2;
}
mainActivity.X2().Y().i(getViewLifecycleOwner(), new l(new m()));
return;
}
j6 j6Var8 = this.f18212c;
if (j6Var8 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var8;
}
ConstraintLayout root = j6Var2.f20578c.getRoot();
kotlin.jvm.internal.r.g(root, "getRoot(...)");
el.d.d(root);
return;
}
throw new NullPointerException("null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
}
public static final void C0(i this$0, View view) {
kotlin.jvm.internal.r.h(this$0, "this$0");
j6 j6Var = this$0.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
ConstraintLayout root = j6Var.f20578c.getRoot();
kotlin.jvm.internal.r.g(root, "getRoot(...)");
el.d.d(root);
CountDownTimer countDownTimer = this$0.L;
if (countDownTimer != null) {
countDownTimer.cancel();
}
zi.f.a().n5(false);
}
public static final void D0(i this$0, View view) {
Uri parse;
kotlin.jvm.internal.r.h(this$0, "this$0");
Intent intent = new Intent("android.intent.action.VIEW");
if (rt.e.a(this$0.requireContext(), "vi")) {
parse = Uri.parse("https://note.moneylover.vn/ban-da-biet-cach-tan-huong-tron-ven-premium-chua/");
} else {
parse = Uri.parse("https://note.moneylover.me/your-passport-to-premium-dive-into-14-days-of-exclusive-benefits/");
}
intent.setData(parse);
this$0.startActivity(intent);
}
private final void E0() {
Context requireContext = requireContext();
kotlin.jvm.internal.r.g(requireContext, "requireContext(...)");
fc.a.d(requireContext, "create_budget_tap_create_button", "", "Can not create a budget popup");
Context requireContext2 = requireContext();
kotlin.jvm.internal.r.g(requireContext2, "requireContext(...)");
be.c n10 = new be.c(requireContext2).s().r(R.string.cannot_create_budget_title).k(R.string.cannot_create_budget_content).p(R.string.create_a_wallet_button, new n()).i(R.color.p_500).n(R.string.close, new o());
AlertDialog create = n10.setView(n10.e().getRoot()).create();
this.f18213d = create;
if (create != null) {
create.show();
}
}
private final void F0() {
Context requireContext = requireContext();
kotlin.jvm.internal.r.g(requireContext, "requireContext(...)");
fc.a.d(requireContext, "create_budget_tap_create_button", "", "Premium Store");
Context requireContext2 = requireContext();
kotlin.jvm.internal.r.g(requireContext2, "requireContext(...)");
be.k g10 = new be.k(requireContext2).r().q(R.string.title_popup_lock_create_budget).i(R.drawable.ic_logo_premium).j(R.string.description_popup_lock_create_budget).o(R.string.upgrade_now, new p()).g(new q());
this.Q = g10;
if (g10 != null) {
g10.show();
}
}
private final void G0() {
androidx.activity.result.b<Intent> bVar = this.f18219o;
ActivityWalletSwitcher.a aVar = ActivityWalletSwitcher.f14397xk;
Context requireContext = requireContext();
kotlin.jvm.internal.r.e(requireContext);
bVar.b(ActivityWalletSwitcher.a.e(aVar, requireContext, "FragmentLabelManagerV3", true, true, false, true, true, 16, null));
}
private final long f0() {
return ((Number) this.B.getValue()).longValue();
}
public final ib.a g0() {
return (ib.a) this.f18214e.getValue();
}
public final bb.a h0() {
return (bb.a) this.f18215f.getValue();
}
public final void i0(Integer num, String str, String str2) {
String str3;
MainActivity mainActivity;
bb.a h02 = h0();
Context requireContext = requireContext();
kotlin.jvm.internal.r.g(requireContext, "requireContext(...)");
h02.y(requireContext);
j6 j6Var = this.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
CharSequence title = j6Var.H.getTitle();
if (title != null) {
str3 = title.toString();
} else {
str3 = null;
}
com.zoostudio.moneylover.adapter.item.a aVar = this.C;
if (aVar != null) {
bb.a h03 = h0();
MainActivity mainActivity2 = this.H;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity = null;
} else {
mainActivity = mainActivity2;
}
bb.a.x(h03, mainActivity, aVar, m0(), z0(), k0(), true, null, null, null, true, new d(str3, num, str, str2), 448, null);
}
}
static void j0(i iVar, Integer num, String str, String str2, int i10, Object obj) {
if ((i10 & 1) != 0) {
num = null;
}
if ((i10 & 2) != 0) {
str = null;
}
if ((i10 & 4) != 0) {
str2 = null;
}
iVar.i0(num, str, str2);
}
private final String[] k0() {
Object value = this.f18217i.getValue();
kotlin.jvm.internal.r.g(value, "getValue(...)");
return (String[]) value;
}
public final void n0() {
if (!h0().m()) {
F0();
return;
}
jd.b bVar = jd.b.f25352a;
com.zoostudio.moneylover.adapter.item.a aVar = this.C;
kotlin.jvm.internal.r.e(aVar);
boolean b10 = bVar.b(aVar);
MainActivity mainActivity = null;
if (b10) {
MainActivity mainActivity2 = this.H;
if (mainActivity2 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity2;
}
jd.b.c(mainActivity);
return;
}
if (this.C != null) {
bb.a h02 = h0();
com.zoostudio.moneylover.adapter.item.a aVar2 = this.C;
kotlin.jvm.internal.r.e(aVar2);
if (h02.z(aVar2)) {
MainActivity mainActivity3 = this.H;
if (mainActivity3 == null) {
kotlin.jvm.internal.r.z("mainActivity");
} else {
mainActivity = mainActivity3;
}
Intent intent = new Intent(mainActivity, (Class<?>) ActivityAddBudget.class);
intent.putExtra("wallet", this.C);
startActivity(intent);
return;
}
}
E0();
}
private final void o0() {
String str;
Context context = getContext();
if (context != null) {
if (rt.e.a(context, "vi")) {
str = "https://note.moneylover.vn/huong-dan-su-dung-chi-tiet-ngan-sach-o-money-lover-ban-8-0/";
} else {
str = "https://note.moneylover.me/how-to-use-budgets-in-money-lover-app/";
}
I(new Intent("android.intent.action.VIEW", Uri.parse(str)));
}
}
public final void p0() {
y0();
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
TabLayout tabLayout = j6Var.C;
kotlin.jvm.internal.r.g(tabLayout, "tabLayout");
el.d.k(tabLayout);
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var3;
}
ViewPager2 viewPager = j6Var2.L;
kotlin.jvm.internal.r.g(viewPager, "viewPager");
el.d.k(viewPager);
j0(this, null, null, null, 7, null);
}
private final void q0() {
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
j6Var.f20579d.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.r0(i.this, view);
}
});
androidx.fragment.app.q requireActivity = requireActivity();
kotlin.jvm.internal.r.g(requireActivity, "requireActivity(...)");
com.zoostudio.moneylover.utils.n.b(requireActivity, R.attr.colorSurface);
Context context = getContext();
if (context != null) {
bb.a h02 = h0();
String uuid = MoneyApplication.f11023j.o(context).getUUID();
kotlin.jvm.internal.r.g(uuid, "getUUID(...)");
h02.n(context, uuid);
}
if (f0() == 0) {
this.C = m0.q(requireContext());
p0();
} else {
ib.a g02 = g0();
Context requireContext = requireContext();
kotlin.jvm.internal.r.g(requireContext, "requireContext(...)");
g02.h(requireContext, f0(), new e());
}
v0();
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
j6Var3.f20585o.getBuilder().q(R.string.no_budget).m(R.string.budget_benefit).c();
j6 j6Var4 = this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
j6Var4.H.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.s0(i.this, view);
}
});
j6 j6Var5 = this.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var5 = null;
}
j6Var5.f20581f.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.t0(i.this, view);
}
});
j6 j6Var6 = this.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var6;
}
j6Var2.f20580e.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
i.u0(i.this, view);
}
});
}
public static final void r0(i this$0, View view) {
kotlin.jvm.internal.r.h(this$0, "this$0");
this$0.G0();
}
public static final void s0(i this$0, View view) {
kotlin.jvm.internal.r.h(this$0, "this$0");
j6 j6Var = this$0.f18212c;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
j6Var.H.setTitle(this$0.getString(R.string.running_budgets));
j0(this$0, null, null, null, 7, null);
this$0.getChildFragmentManager().i1();
j6 j6Var2 = this$0.f18212c;
if (j6Var2 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var2 = null;
}
j6Var2.H.setNavigationIcon((Drawable) null);
}
public static final void t0(i this$0, View view) {
kotlin.jvm.internal.r.h(this$0, "this$0");
this$0.n0();
}
public static final void u0(i this$0, View view) {
kotlin.jvm.internal.r.h(this$0, "this$0");
this$0.o0();
}
private final void v0() {
MainActivity mainActivity = this.H;
if (mainActivity == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity = null;
}
mainActivity.addMenuProvider(new f(), getViewLifecycleOwner(), i.b.RESUMED);
}
public final void w0(final ArrayList<HeaderItem> arrayList, int i10) {
Bundle bundle = new Bundle();
bundle.putSerializable("wallet", this.C);
Context requireContext = requireContext();
FragmentManager childFragmentManager = getChildFragmentManager();
kotlin.jvm.internal.r.g(childFragmentManager, "getChildFragmentManager(...)");
androidx.lifecycle.i lifecycle = getLifecycle();
kotlin.jvm.internal.r.g(lifecycle, "<get-lifecycle>(...)");
jb.a aVar = new jb.a(requireContext, bundle, arrayList, childFragmentManager, lifecycle);
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
j6Var.L.setAdapter(aVar);
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var3 = null;
}
TabLayout tabLayout = j6Var3.C;
j6 j6Var4 = this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var4 = null;
}
new TabLayoutMediator(tabLayout, j6Var4.L, new TabLayoutMediator.TabConfigurationStrategy() {
@Override
public final void onConfigureTab(TabLayout.Tab tab, int i11) {
i.x0(arrayList, tab, i11);
}
}).attach();
j6 j6Var5 = this.f18212c;
if (j6Var5 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var5 = null;
}
j6Var5.C.addOnTabSelectedListener((TabLayout.OnTabSelectedListener) new g());
j6 j6Var6 = this.f18212c;
if (j6Var6 == null) {
kotlin.jvm.internal.r.z("binding");
j6Var6 = null;
}
j6Var6.L.j(i10, false);
j6 j6Var7 = this.f18212c;
if (j6Var7 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var7;
}
TabLayout tabLayout2 = j6Var2.C;
kotlin.jvm.internal.r.g(tabLayout2, "tabLayout");
zf.d.c(tabLayout2);
}
public static final void x0(ArrayList headers, TabLayout.Tab tab, int i10) {
kotlin.jvm.internal.r.h(headers, "$headers");
kotlin.jvm.internal.r.h(tab, "tab");
tab.setText(((HeaderItem) headers.get(i10)).g());
}
private final void y0() {
com.zoostudio.moneylover.adapter.item.a aVar = this.C;
if (aVar != null) {
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
ImageViewGlide imageViewGlide = j6Var.f20587q;
String icon = aVar.getIcon();
kotlin.jvm.internal.r.g(icon, "getIcon(...)");
imageViewGlide.setIconByName(icon);
if (jd.b.f25352a.b(aVar) && !aVar.isLinkedAccount()) {
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var3;
}
j6Var2.B.setVisibility(0);
return;
}
j6 j6Var4 = this.f18212c;
if (j6Var4 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var4;
}
j6Var2.B.setVisibility(8);
}
}
public final AlertDialog l0() {
return this.f18213d;
}
public final String m0() {
Object value = this.f18218j.getValue();
kotlin.jvm.internal.r.g(value, "getValue(...)");
return (String) value;
}
@Override
public void onAttach(Context context) {
kotlin.jvm.internal.r.h(context, "context");
super.onAttach(context);
this.H = (MainActivity) context;
}
@Override
public void onDestroy() {
super.onDestroy();
il.b.b(this.M);
il.b.b(this.f18220p);
il.b.b(this.f18221q);
}
@Override
public void onViewCreated(View view, Bundle bundle) {
kotlin.jvm.internal.r.h(view, "view");
super.onViewCreated(view, bundle);
j6 j6Var = this.f18212c;
j6 j6Var2 = null;
if (j6Var == null) {
kotlin.jvm.internal.r.z("binding");
j6Var = null;
}
MLToolbar toolbar = j6Var.H;
kotlin.jvm.internal.r.g(toolbar, "toolbar");
zf.d.d(toolbar);
MainActivity mainActivity = this.H;
if (mainActivity == null) {
kotlin.jvm.internal.r.z("mainActivity");
mainActivity = null;
}
j6 j6Var3 = this.f18212c;
if (j6Var3 == null) {
kotlin.jvm.internal.r.z("binding");
} else {
j6Var2 = j6Var3;
}
mainActivity.u0(j6Var2.H);
j jVar = this.M;
String jVar2 = com.zoostudio.moneylover.utils.j.BUDGET_GLOBAL.toString();
kotlin.jvm.internal.r.g(jVar2, "toString(...)");
il.b.a(jVar, jVar2);
BroadcastReceiver broadcastReceiver = this.f18220p;
String jVar3 = com.zoostudio.moneylover.utils.j.WALLET.toString();
kotlin.jvm.internal.r.g(jVar3, "toString(...)");
il.b.a(broadcastReceiver, jVar3);
il.b.a(this.f18221q, "com.zoostudio.intent.action.UPDATE_BUDGET_GLOBAL");
q0();
B0();
}
@Override
public View z() {
j6 c10 = j6.c(getLayoutInflater());
kotlin.jvm.internal.r.g(c10, "inflate(...)");
this.f18212c = c10;
if (c10 == null) {
kotlin.jvm.internal.r.z("binding");
c10 = null;
}
ConstraintLayout root = c10.getRoot();
kotlin.jvm.internal.r.g(root, "getRoot(...)");
return root;
}
public final boolean z0() {
return ((Boolean) this.f18216g.getValue()).booleanValue();
}
}