Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 MyCardsFragment.java 源代码,内容仅作参考
package by.kufar.mycards.ui;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.graphics.result.ActivityResult;
import androidx.graphics.result.ActivityResultCallback;
import androidx.graphics.result.ActivityResultLauncher;
import androidx.graphics.result.contract.ActivityResultContracts;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.navigation.compose.DialogNavigator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.mycards.R$color;
import by.kufar.mycards.R$id;
import by.kufar.mycards.R$layout;
import by.kufar.mycards.R$string;
import by.kufar.mycards.ui.MyCardsVM;
import by.kufar.mycards.ui.adapter.MyCardsController;
import by.kufar.re.ui.widget.dialog.AlertKufarDialogFragment;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import com.applovin.sdk.AppLovinEventTypes;
import com.begateway.mobilepayments.sdk.PaymentSdk;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.tapjoy.TapjoyConstants;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.m;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.p;
import kotlin.jvm.internal.s;
import kotlin.jvm.internal.u;
import kotlin.reflect.KProperty;
import wd.d;
@Metadata(d1 = {"\u0000¦\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u000f\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002B\u0007¢\u0006\u0004\bm\u0010nJ\b\u0010\u0004\u001a\u00020\u0003H\u0002J\b\u0010\u0005\u001a\u00020\u0003H\u0002J\b\u0010\u0006\u001a\u00020\u0003H\u0002J\b\u0010\u0007\u001a\u00020\u0003H\u0002J\u0010\u0010\n\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\bH\u0002J\u0010\u0010\f\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\u000bH\u0002J\u0010\u0010\u000e\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\rH\u0002J\u0010\u0010\u0011\u001a\u00020\u00032\u0006\u0010\u0010\u001a\u00020\u000fH\u0002J\u0010\u0010\u0012\u001a\u00020\u00032\u0006\u0010\u0010\u001a\u00020\u000fH\u0002J\b\u0010\u0013\u001a\u00020\u0003H\u0002J\b\u0010\u0014\u001a\u00020\u0003H\u0016J&\u0010\u001c\u001a\u0004\u0018\u00010\u001b2\u0006\u0010\u0016\u001a\u00020\u00152\b\u0010\u0018\u001a\u0004\u0018\u00010\u00172\b\u0010\u001a\u001a\u0004\u0018\u00010\u0019H\u0016J\u001a\u0010\u001e\u001a\u00020\u00032\u0006\u0010\u001d\u001a\u00020\u001b2\b\u0010\u001a\u001a\u0004\u0018\u00010\u0019H\u0016J\u0010\u0010!\u001a\u00020\u00032\u0006\u0010 \u001a\u00020\u001fH\u0016J\u0010\u0010#\u001a\u00020\u00032\u0006\u0010\"\u001a\u00020\u001fH\u0016J\b\u0010$\u001a\u00020\u0003H\u0016J\b\u0010%\u001a\u00020\u0003H\u0016J\b\u0010&\u001a\u00020\u0003H\u0016R\"\u0010(\u001a\u00020'8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b(\u0010)\u001a\u0004\b*\u0010+\"\u0004\b,\u0010-R\"\u0010/\u001a\u00020.8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b/\u00100\u001a\u0004\b1\u00102\"\u0004\b3\u00104R\"\u00106\u001a\u0002058\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b6\u00107\u001a\u0004\b8\u00109\"\u0004\b:\u0010;R\u0016\u0010=\u001a\u00020<8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b=\u0010>R\u001b\u0010D\u001a\u00020?8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b@\u0010A\u001a\u0004\bB\u0010CR\u001b\u0010J\u001a\u00020E8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bF\u0010G\u001a\u0004\bH\u0010IR\u001b\u0010N\u001a\u00020\u001b8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bK\u0010G\u001a\u0004\bL\u0010MR\u001b\u0010Q\u001a\u00020\u001b8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bO\u0010G\u001a\u0004\bP\u0010MR\u001b\u0010T\u001a\u00020\u001b8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bR\u0010G\u001a\u0004\bS\u0010MR\u001b\u0010Y\u001a\u00020U8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bV\u0010G\u001a\u0004\bW\u0010XR\u001b\u0010^\u001a\u00020Z8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b[\u0010G\u001a\u0004\b\\\u0010]R\u001b\u0010c\u001a\u00020_8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b`\u0010G\u001a\u0004\ba\u0010bR\u001b\u0010f\u001a\u00020_8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bd\u0010G\u001a\u0004\be\u0010bR\"\u0010j\u001a\u0010\u0012\f\u0012\n i*\u0004\u0018\u00010h0h0g8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bj\u0010kR\"\u0010l\u001a\u0010\u0012\f\u0012\n i*\u0004\u0018\u00010h0h0g8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\bl\u0010k¨\u0006o"}, d2 = {"Lby/kufar/mycards/ui/MyCardsFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "Lby/kufar/mycards/ui/adapter/MyCardsController$a;", "", "setupViews", "onSafetyClick", "setupViewModel", "setupRecycler", "Lby/kufar/mycards/ui/MyCardsVM$a;", "state", "showState", "Lby/kufar/mycards/ui/MyCardsVM$a$b;", "showError", "Lby/kufar/mycards/ui/MyCardsVM$a$a;", "showData", "Landroidx/activity/result/ActivityResult;", IronSourceConstants.EVENTS_RESULT, "onCardAdded", "onFMAAdded", "showProgress", "onInject", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "", "cardId", "onCardDelete", "url", "onLinkClicked", "onOpenSafeDealClicked", "onMfaPromoClick", "onMfaInfoClick", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lud/a;", "tracker", "Lud/a;", "getTracker", "()Lud/a;", "setTracker", "(Lud/a;)V", "Lby/kufar/mycards/ui/adapter/MyCardsController;", "myCardsController", "Lby/kufar/mycards/ui/adapter/MyCardsController;", "Lby/kufar/mycards/ui/MyCardsVM;", "myCardsVM$delegate", "Ld80/j;", "getMyCardsVM", "()Lby/kufar/mycards/ui/MyCardsVM;", "myCardsVM", "Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;", "swipeView$delegate", "Li6/c;", "getSwipeView", "()Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;", "swipeView", "error$delegate", "getError", "()Landroid/view/View;", "error", "content$delegate", "getContent", AppLovinEventTypes.USER_VIEWED_CONTENT, "progress$delegate", "getProgress", "progress", "Landroidx/recyclerview/widget/RecyclerView;", "recycler$delegate", "getRecycler", "()Landroidx/recyclerview/widget/RecyclerView;", "recycler", "Landroid/widget/TextView;", "safety$delegate", "getSafety", "()Landroid/widget/TextView;", "safety", "Landroid/widget/Button;", "retry$delegate", "getRetry", "()Landroid/widget/Button;", TapjoyConstants.TJC_RETRY, "addCard$delegate", "getAddCard", "addCard", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "kotlin.jvm.PlatformType", "onCardAddedResult", "Landroidx/activity/result/ActivityResultLauncher;", "onMFAResult", "<init>", "()V", "feature-mycards_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class MyCardsFragment extends BaseFragment implements MyCardsController.a {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(MyCardsFragment.class, "swipeView", "getSwipeView()Landroidx/swiperefreshlayout/widget/SwipeRefreshLayout;", 0)), o0.i(new g0(MyCardsFragment.class, "error", "getError()Landroid/view/View;", 0)), o0.i(new g0(MyCardsFragment.class, AppLovinEventTypes.USER_VIEWED_CONTENT, "getContent()Landroid/view/View;", 0)), o0.i(new g0(MyCardsFragment.class, "progress", "getProgress()Landroid/view/View;", 0)), o0.i(new g0(MyCardsFragment.class, "recycler", "getRecycler()Landroidx/recyclerview/widget/RecyclerView;", 0)), o0.i(new g0(MyCardsFragment.class, "safety", "getSafety()Landroid/widget/TextView;", 0)), o0.i(new g0(MyCardsFragment.class, TapjoyConstants.TJC_RETRY, "getRetry()Landroid/widget/Button;", 0)), o0.i(new g0(MyCardsFragment.class, "addCard", "getAddCard()Landroid/widget/Button;", 0))};
private final i6.c addCard;
private final i6.c content;
private final i6.c error;
public cb.b mediator;
private MyCardsController myCardsController;
private final d80.j myCardsVM;
private final ActivityResultLauncher<Intent> onCardAddedResult;
private final ActivityResultLauncher<Intent> onMFAResult;
private final i6.c progress;
private final i6.c recycler;
private final i6.c retry;
private final i6.c safety;
private final i6.c swipeView;
public ud.a tracker;
public ViewModelProvider.Factory viewModelFactory;
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelProvider$Factory;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class a extends u implements Function0<ViewModelProvider.Factory> {
public a() {
super(0);
}
@Override
public final ViewModelProvider.Factory invoke() {
return MyCardsFragment.this.getViewModelFactory();
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public class b implements ActivityResultCallback, m {
public b() {
}
@Override
public final void onActivityResult(ActivityResult p02) {
s.j(p02, "p0");
MyCardsFragment.this.onCardAdded(p02);
}
public final boolean equals(Object obj) {
if (!(obj instanceof ActivityResultCallback) || !(obj instanceof m)) {
return false;
}
return s.e(getFunctionDelegate(), ((m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return new p(1, MyCardsFragment.this, MyCardsFragment.class, "onCardAdded", "onCardAdded(Landroidx/activity/result/ActivityResult;)V", 0);
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\b\u0010\u0001\u001a\u0004\u0018\u00010\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/content/DialogInterface;", DialogNavigator.NAME, "Landroid/view/View;", "view", "", "a", "(Landroid/content/DialogInterface;Landroid/view/View;)V"}, k = 3, mv = {1, 9, 0})
public static final class c extends u implements Function2<DialogInterface, View, Unit> {
public final String f11930e;
public c(String str) {
super(2);
this.f11930e = str;
}
public final void a(DialogInterface dialogInterface, View view) {
s.j(view, "view");
if (dialogInterface != null) {
dialogInterface.dismiss();
}
MyCardsFragment.this.getMyCardsVM().onDeleteCard(this.f11930e);
}
@Override
public Unit mo1invoke(DialogInterface dialogInterface, View view) {
a(dialogInterface, view);
return Unit.f82492a;
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public class e implements ActivityResultCallback, m {
public e() {
}
@Override
public final void onActivityResult(ActivityResult p02) {
s.j(p02, "p0");
MyCardsFragment.this.onFMAAdded(p02);
}
public final boolean equals(Object obj) {
if (!(obj instanceof ActivityResultCallback) || !(obj instanceof m)) {
return false;
}
return s.e(getFunctionDelegate(), ((m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return new p(1, MyCardsFragment.this, MyCardsFragment.class, "onFMAAdded", "onFMAAdded(Landroidx/activity/result/ActivityResult;)V", 0);
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class f implements Observer, m {
public final Function1 f11933b;
public f(Function1 function) {
s.j(function, "function");
this.f11933b = function;
}
public final boolean equals(Object obj) {
if (!(obj instanceof Observer) || !(obj instanceof m)) {
return false;
}
return s.e(getFunctionDelegate(), ((m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return this.f11933b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f11933b.invoke(obj);
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public class g extends p implements Function1<MyCardsVM.a, Unit> {
public g(Object obj) {
super(1, obj, MyCardsFragment.class, "showState", "showState(Lby/kufar/mycards/ui/MyCardsVM$State;)V", 0);
}
public final void a(MyCardsVM.a p02) {
s.j(p02, "p0");
((MyCardsFragment) this.receiver).showState(p02);
}
@Override
public Unit invoke(MyCardsVM.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0016¨\u0006\t"}, d2 = {"by/kufar/mycards/ui/MyCardsFragment$h", "Landroid/text/style/ClickableSpan;", "Landroid/text/TextPaint;", "ds", "", "updateDrawState", "Landroid/view/View;", "widget", "onClick", "core-android_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class h extends ClickableSpan {
public final Integer f11934b;
public final boolean f11935c;
public final MyCardsFragment f11936d;
public h(Integer num, boolean z11, MyCardsFragment myCardsFragment) {
this.f11934b = num;
this.f11935c = z11;
this.f11936d = myCardsFragment;
}
@Override
public void onClick(View widget) {
s.j(widget, "widget");
this.f11936d.onSafetyClick();
}
@Override
public void updateDrawState(TextPaint ds2) {
s.j(ds2, "ds");
Integer num = this.f11934b;
if (num != null) {
ds2.setColor(num.intValue());
}
ds2.setUnderlineText(this.f11935c);
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/fragment/app/Fragment;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$5"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class i extends u implements Function0<Fragment> {
public final Fragment f11937d;
public i(Fragment fragment) {
super(0);
this.f11937d = fragment;
}
@Override
public final Fragment invoke() {
return this.f11937d;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStoreOwner;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$owner$4"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class j extends u implements Function0<ViewModelStoreOwner> {
public final Function0 f11938d;
public j(Function0 function0) {
super(0);
this.f11938d = function0;
}
@Override
public final ViewModelStoreOwner invoke() {
return (ViewModelStoreOwner) this.f11938d.invoke();
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/ViewModelStore;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$6"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class k extends u implements Function0<ViewModelStore> {
public final d80.j f11939d;
public k(d80.j jVar) {
super(0);
this.f11939d = jVar;
}
@Override
public final ViewModelStore invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f11939d);
ViewModelStore viewModelStore = m4202viewModels$lambda1.getViewModelStore();
s.i(viewModelStore, "owner.viewModelStore");
return viewModelStore;
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u0001\"\n\b\u0000\u0010\u0002\u0018\u0001*\u00020\u0003H\n¢\u0006\u0002\b\u0004¨\u0006\u0005"}, d2 = {"<anonymous>", "Landroidx/lifecycle/viewmodel/CreationExtras;", "VM", "Landroidx/lifecycle/ViewModel;", "invoke", "androidx/fragment/app/FragmentViewModelLazyKt$viewModels$7"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class l extends u implements Function0<CreationExtras> {
public final Function0 f11940d;
public final d80.j f11941e;
public l(Function0 function0, d80.j jVar) {
super(0);
this.f11940d = function0;
this.f11941e = jVar;
}
@Override
public final CreationExtras invoke() {
ViewModelStoreOwner m4202viewModels$lambda1;
CreationExtras creationExtras;
Function0 function0 = this.f11940d;
if (function0 != null && (creationExtras = (CreationExtras) function0.invoke()) != null) {
return creationExtras;
}
m4202viewModels$lambda1 = FragmentViewModelLazyKt.m4202viewModels$lambda1(this.f11941e);
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = m4202viewModels$lambda1 instanceof HasDefaultViewModelProviderFactory ? (HasDefaultViewModelProviderFactory) m4202viewModels$lambda1 : null;
CreationExtras defaultViewModelCreationExtras = hasDefaultViewModelProviderFactory != null ? hasDefaultViewModelProviderFactory.getDefaultViewModelCreationExtras() : null;
return defaultViewModelCreationExtras == null ? CreationExtras.Empty.INSTANCE : defaultViewModelCreationExtras;
}
}
public MyCardsFragment() {
a aVar = new a();
d80.j a11 = d80.k.a(d80.m.f73493d, new j(new i(this)));
this.myCardsVM = FragmentViewModelLazyKt.createViewModelLazy(this, o0.b(MyCardsVM.class), new k(a11), new l(null, a11), aVar);
this.swipeView = bindView(R$id.f11788t);
this.error = bindView(R$id.f11777i);
this.content = bindView(R$id.f11775g);
this.progress = bindView(R$id.f11784p);
this.recycler = bindView(R$id.f11773e);
this.safety = bindView(R$id.f11787s);
this.retry = bindView(R$id.f11786r);
this.addCard = bindView(R$id.f11770b);
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new b());
s.i(registerForActivityResult, "registerForActivityResult(...)");
this.onCardAddedResult = registerForActivityResult;
ActivityResultLauncher<Intent> registerForActivityResult2 = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new e());
s.i(registerForActivityResult2, "registerForActivityResult(...)");
this.onMFAResult = registerForActivityResult2;
}
private final Button getAddCard() {
return (Button) this.addCard.getValue(this, $$delegatedProperties[7]);
}
private final View getContent() {
return (View) this.content.getValue(this, $$delegatedProperties[2]);
}
private final View getError() {
return (View) this.error.getValue(this, $$delegatedProperties[1]);
}
public final MyCardsVM getMyCardsVM() {
return (MyCardsVM) this.myCardsVM.getValue();
}
private final View getProgress() {
return (View) this.progress.getValue(this, $$delegatedProperties[3]);
}
private final RecyclerView getRecycler() {
return (RecyclerView) this.recycler.getValue(this, $$delegatedProperties[4]);
}
private final Button getRetry() {
return (Button) this.retry.getValue(this, $$delegatedProperties[6]);
}
private final TextView getSafety() {
return (TextView) this.safety.getValue(this, $$delegatedProperties[5]);
}
private final SwipeRefreshLayout getSwipeView() {
return (SwipeRefreshLayout) this.swipeView.getValue(this, $$delegatedProperties[0]);
}
public final void onCardAdded(ActivityResult result) {
getMyCardsVM().refresh();
}
public final void onFMAAdded(ActivityResult result) {
if (result.getResultCode() == -1) {
getMyCardsVM().onMfaTurnedOn();
}
}
public final void onSafetyClick() {
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/articles/360007412697?utm_source=Android&utm_medium=Link&utm_campaign=ProdCards", false, null, false, false, 60, null));
}
private final void setupRecycler() {
this.myCardsController = new MyCardsController(this);
RecyclerView recycler = getRecycler();
MyCardsController myCardsController = this.myCardsController;
if (myCardsController == null) {
s.B("myCardsController");
myCardsController = null;
}
recycler.setAdapter(myCardsController.getAdapter());
getRecycler().setLayoutManager(new LinearLayoutManager(getContext()));
}
private final void setupViewModel() {
getMyCardsVM().getState().observe(getViewLifecycleOwner(), new f(new g(this)));
}
private final void setupViews() {
int i11;
getSwipeView().setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public final void onRefresh() {
MyCardsFragment.setupViews$lambda$0(MyCardsFragment.this);
}
});
getAddCard().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyCardsFragment.setupViews$lambda$1(MyCardsFragment.this, view);
}
});
getSafety().setMovementMethod(LinkMovementMethod.getInstance());
TextView safety = getSafety();
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(getString(R$string.f11816l) + " ");
Context context = getContext();
if (context != null) {
i11 = ContextCompat.getColor(context, R$color.f11762a);
} else {
i11 = ViewCompat.MEASURED_STATE_MASK;
}
ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(i11);
int length = spannableStringBuilder.length();
h hVar = new h(null, true, this);
int length2 = spannableStringBuilder.length();
spannableStringBuilder.append((CharSequence) getString(R$string.f11815k));
spannableStringBuilder.setSpan(hVar, length2, spannableStringBuilder.length(), 17);
spannableStringBuilder.setSpan(foregroundColorSpan, length, spannableStringBuilder.length(), 17);
safety.setText(spannableStringBuilder);
}
public static final void setupViews$lambda$0(MyCardsFragment this$0) {
s.j(this$0, "this$0");
this$0.getMyCardsVM().refresh();
}
public static final void setupViews$lambda$1(MyCardsFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.getMyCardsVM().onAddCardClick();
}
private final void showData(MyCardsVM.a.C0261a state) {
getSwipeView().setRefreshing(false);
getError().setVisibility(8);
getContent().setVisibility(0);
getProgress().setVisibility(8);
MyCardsController myCardsController = this.myCardsController;
if (myCardsController == null) {
s.B("myCardsController");
myCardsController = null;
}
myCardsController.setup(state.a(), state.getShowMfaPromoHeader());
}
private final void showError(final MyCardsVM.a.b state) {
getSwipeView().setRefreshing(false);
getError().setVisibility(0);
getContent().setVisibility(8);
getProgress().setVisibility(8);
if (state.getException() instanceof xd.a) {
getRetry().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyCardsFragment.showError$lambda$5(MyCardsFragment.this, state, view);
}
});
} else {
getRetry().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MyCardsFragment.showError$lambda$6(MyCardsFragment.this, view);
}
});
}
}
public static final void showError$lambda$5(MyCardsFragment this$0, MyCardsVM.a.b state, View view) {
s.j(this$0, "this$0");
s.j(state, "$state");
this$0.getMyCardsVM().onDeleteCard(((xd.a) state.getException()).getCardId());
}
public static final void showError$lambda$6(MyCardsFragment this$0, View view) {
s.j(this$0, "this$0");
this$0.getMyCardsVM().refresh();
}
private final void showProgress() {
if (getSwipeView().isRefreshing()) {
return;
}
getError().setVisibility(8);
getContent().setVisibility(0);
getProgress().setVisibility(0);
}
public final void showState(MyCardsVM.a state) {
if (state instanceof MyCardsVM.a.b) {
showError((MyCardsVM.a.b) state);
return;
}
if (state instanceof MyCardsVM.a.C0261a) {
showData((MyCardsVM.a.C0261a) state);
return;
}
if (s.e(state, MyCardsVM.a.c.f11945a)) {
showProgress();
} else if (s.e(state, MyCardsVM.a.d.f11946a)) {
PaymentSdk.Companion companion = PaymentSdk.INSTANCE;
Context requireContext = requireContext();
s.i(requireContext, "requireContext(...)");
startActivity(companion.getCardFormIntent(requireContext));
}
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
s.B("mediator");
return null;
}
public final ud.a getTracker() {
ud.a aVar = this.tracker;
if (aVar != null) {
return aVar;
}
s.B("tracker");
return null;
}
public final ViewModelProvider.Factory getViewModelFactory() {
ViewModelProvider.Factory factory = this.viewModelFactory;
if (factory != null) {
return factory;
}
s.B("viewModelFactory");
return null;
}
@Override
public void onCardDelete(String cardId) {
s.j(cardId, "cardId");
AlertKufarDialogFragment.Companion companion = AlertKufarDialogFragment.INSTANCE;
String string = getString(R$string.f11810f);
String string2 = getString(R$string.f11808d);
String string3 = getString(R$string.f11809e);
s.g(string);
s.g(string2);
s.g(string3);
AlertKufarDialogFragment.Companion.b(companion, string, "", string2, string3, false, false, 32, null).setPositiveClickListener(new c(cardId)).setOnDismissListener(d.f11931d).show(getChildFragmentManager(), (String) null);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return inflater.inflate(R$layout.f11795c, container, false);
}
@Override
public void onInject() {
super.onInject();
d.a a11 = wd.b.a();
Object obj = m5.a.d(this).get(wd.e.class);
if (obj != null) {
a11.a((wd.e) obj).a(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.mycards.di.MyCardsFeatureDependencies");
}
@Override
public void onLinkClicked(String url) {
s.j(url, "url");
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, url, false, null, false, false, 60, null));
}
@Override
public void onMfaInfoClick() {
Context context = getContext();
if (context == null) {
return;
}
context.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru/articles/360019237117-Двухэтапная-проверка-Что-это-Как-ее-включить-выключить-?utm_source=android&utm_medium=payment_data&utm_campaign=mfa", false, null, false, false, 60, null));
}
@Override
public void onMfaPromoClick() {
Context context = getContext();
if (context == null) {
return;
}
this.onMFAResult.launch(getMediator().m().b(context));
}
@Override
public void onOpenSafeDealClicked() {
Context context = getContext();
if (context == null) {
return;
}
startActivity(getMediator().K().a(context));
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
getTracker().a();
setupViewModel();
setupRecycler();
setupViews();
}
public final void setMediator(cb.b bVar) {
s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setTracker(ud.a aVar) {
s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setViewModelFactory(ViewModelProvider.Factory factory) {
s.j(factory, "<set-?>");
this.viewModelFactory = factory;
}
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\b\u0010\u0001\u001a\u0004\u0018\u00010\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Landroid/content/DialogInterface;", "it", "", "a", "(Landroid/content/DialogInterface;)V"}, k = 3, mv = {1, 9, 0})
public static final class d extends u implements Function1<DialogInterface, Unit> {
public static final d f11931d = new d();
public d() {
super(1);
}
@Override
public Unit invoke(DialogInterface dialogInterface) {
a(dialogInterface);
return Unit.f82492a;
}
public final void a(DialogInterface dialogInterface) {
}
}
}