Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 EripPaymentFragment.java 源代码,内容仅作参考
package by.kufar.payments.ui.erip;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ViewAnimator;
import androidx.core.os.BundleKt;
import androidx.core.view.ViewGroupKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.payments.R$id;
import by.kufar.payments.R$layout;
import by.kufar.payments.ui.data.PaymentInfo;
import by.kufar.payments.ui.erip.EripPaymentVM;
import by.kufar.payments.ui.erip.adapter.EripController;
import by.kufar.re.ui.widget.error.ErrorView;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import d80.f;
import d80.j;
import d80.k;
import d80.u;
import e80.t;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.m;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.s;
import kotlin.reflect.KProperty;
import qg.d;
@Metadata(d1 = {"\u0000\u0084\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\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\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\u0018\u0000 K2\u00020\u00012\u00020\u0002:\u0001LB\u0007¢\u0006\u0004\bI\u0010JJ\u0010\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0003H\u0002J\b\u0010\u0007\u001a\u00020\u0005H\u0002J\b\u0010\b\u001a\u00020\u0005H\u0002J\b\u0010\t\u001a\u00020\u0005H\u0002J\b\u0010\n\u001a\u00020\u0005H\u0002J\u0010\u0010\r\u001a\u00020\u00052\u0006\u0010\f\u001a\u00020\u000bH\u0002J&\u0010\u0015\u001a\u0004\u0018\u00010\u00142\u0006\u0010\u000f\u001a\u00020\u000e2\b\u0010\u0011\u001a\u0004\u0018\u00010\u00102\b\u0010\u0013\u001a\u0004\u0018\u00010\u0012H\u0016J\u001a\u0010\u0017\u001a\u00020\u00052\u0006\u0010\u0016\u001a\u00020\u00142\b\u0010\u0013\u001a\u0004\u0018\u00010\u0012H\u0016J\b\u0010\u0018\u001a\u00020\u0005H\u0016J\b\u0010\u0019\u001a\u00020\u0005H\u0016J\u0010\u0010\u001a\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0003H\u0016J\b\u0010\u001b\u001a\u00020\u0005H\u0016J\u0010\u0010\u001e\u001a\u00020\u00052\u0006\u0010\u001d\u001a\u00020\u001cH\u0016R\u001b\u0010$\u001a\u00020\u001f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b \u0010!\u001a\u0004\b\"\u0010#R\u0016\u0010&\u001a\u00020%8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b&\u0010'R\u0016\u0010)\u001a\u00020(8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\b)\u0010*R\"\u0010,\u001a\u00020+8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b,\u0010-\u001a\u0004\b.\u0010/\"\u0004\b0\u00101R\"\u00103\u001a\u0002028\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b3\u00104\u001a\u0004\b5\u00106\"\u0004\b7\u00108R\u001b\u0010>\u001a\u0002098BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b:\u0010;\u001a\u0004\b<\u0010=R\u001b\u0010C\u001a\u00020?8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b@\u0010;\u001a\u0004\bA\u0010BR\u001b\u0010H\u001a\u00020D8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bE\u0010;\u001a\u0004\bF\u0010G¨\u0006M"}, d2 = {"Lby/kufar/payments/ui/erip/EripPaymentFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "Lby/kufar/payments/ui/erip/adapter/EripController$a;", "", "link", "", "openLink", "finish", "setUpViewModel", "setUpRecycler", "setUpActions", "Lby/kufar/payments/ui/erip/EripPaymentVM$a;", "state", "showState", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "view", "onViewCreated", "onResume", "onInject", "onBankClick", "onSupportClick", "", "id", "onButtonClick", "Lby/kufar/payments/ui/data/PaymentInfo;", "paymentInfo$delegate", "Ld80/j;", "getPaymentInfo", "()Lby/kufar/payments/ui/data/PaymentInfo;", "paymentInfo", "Lby/kufar/payments/ui/erip/EripPaymentVM;", "viewModel", "Lby/kufar/payments/ui/erip/EripPaymentVM;", "Lby/kufar/payments/ui/erip/adapter/EripController;", "controller", "Lby/kufar/payments/ui/erip/adapter/EripController;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Log/a;", "tracker", "Log/a;", "getTracker", "()Log/a;", "setTracker", "(Log/a;)V", "Lby/kufar/re/ui/widget/error/ErrorView;", "error$delegate", "Li6/c;", "getError", "()Lby/kufar/re/ui/widget/error/ErrorView;", "error", "Landroid/widget/ViewAnimator;", "viewAnimator$delegate", "getViewAnimator", "()Landroid/widget/ViewAnimator;", "viewAnimator", "Landroidx/recyclerview/widget/RecyclerView;", "recycler$delegate", "getRecycler", "()Landroidx/recyclerview/widget/RecyclerView;", "recycler", "<init>", "()V", "Companion", "a", "feature-payments_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class EripPaymentFragment extends BaseFragment implements EripController.a {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(EripPaymentFragment.class, "error", "getError()Lby/kufar/re/ui/widget/error/ErrorView;", 0)), o0.i(new g0(EripPaymentFragment.class, "viewAnimator", "getViewAnimator()Landroid/widget/ViewAnimator;", 0)), o0.i(new g0(EripPaymentFragment.class, "recycler", "getRecycler()Landroidx/recyclerview/widget/RecyclerView;", 0))};
public static final Companion INSTANCE = new Companion(null);
private static final String KEY_CARD_PAYMENT = "KEY_CARD_PAYMENT";
private EripController controller;
public og.a tracker;
private EripPaymentVM viewModel;
public ViewModelProvider.Factory viewModelFactory;
private final j paymentInfo = k.b(new b());
private final i6.c error = bindView(R$id.f12962f);
private final i6.c viewAnimator = bindView(R$id.f12959c);
private final i6.c recycler = bindView(R$id.f12961e);
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\t\u0010\nJ\u000e\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002R\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0007\u0010\b¨\u0006\u000b"}, d2 = {"Lby/kufar/payments/ui/erip/EripPaymentFragment$a;", "", "Lby/kufar/payments/ui/data/PaymentInfo;", "paymentData", "Landroidx/fragment/app/Fragment;", "a", "", "KEY_CARD_PAYMENT", "Ljava/lang/String;", "<init>", "()V", "feature-payments_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class Companion {
public Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final Fragment a(PaymentInfo paymentData) {
s.j(paymentData, "paymentData");
EripPaymentFragment eripPaymentFragment = new EripPaymentFragment();
eripPaymentFragment.setArguments(BundleKt.bundleOf(u.a("KEY_CARD_PAYMENT", paymentData)));
return eripPaymentFragment;
}
}
@Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lby/kufar/payments/ui/data/PaymentInfo;", "b", "()Lby/kufar/payments/ui/data/PaymentInfo;"}, k = 3, mv = {1, 9, 0})
public static final class b extends kotlin.jvm.internal.u implements Function0<PaymentInfo> {
public b() {
super(0);
}
@Override
public final PaymentInfo invoke() {
PaymentInfo paymentInfo;
Bundle arguments = EripPaymentFragment.this.getArguments();
if (arguments != null && (paymentInfo = (PaymentInfo) arguments.getParcelable("KEY_CARD_PAYMENT")) != null) {
return paymentInfo;
}
throw new IllegalArgumentException("Payment data must be set when start card payment fragment");
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class c implements Observer, m {
public final Function1 f13139b;
public c(Function1 function) {
s.j(function, "function");
this.f13139b = 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 f<?> getFunctionDelegate() {
return this.f13139b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f13139b.invoke(obj);
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class d extends kotlin.jvm.internal.u implements Function1<View, Unit> {
public d() {
super(1);
}
@Override
public Unit invoke(View view) {
invoke2(view);
return Unit.f82492a;
}
public final void invoke2(View it) {
s.j(it, "it");
EripPaymentVM eripPaymentVM = EripPaymentFragment.this.viewModel;
if (eripPaymentVM == null) {
s.B("viewModel");
eripPaymentVM = null;
}
eripPaymentVM.init(EripPaymentFragment.this.getPaymentInfo());
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u000e\u0010\u0002\u001a\n \u0001*\u0004\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"Lby/kufar/payments/ui/erip/EripPaymentVM$a;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/payments/ui/erip/EripPaymentVM$a;)V"}, k = 3, mv = {1, 9, 0})
public static final class e extends kotlin.jvm.internal.u implements Function1<EripPaymentVM.a, Unit> {
public e() {
super(1);
}
public final void a(EripPaymentVM.a aVar) {
EripPaymentFragment eripPaymentFragment = EripPaymentFragment.this;
s.g(aVar);
eripPaymentFragment.showState(aVar);
}
@Override
public Unit invoke(EripPaymentVM.a aVar) {
a(aVar);
return Unit.f82492a;
}
}
private final void finish() {
FragmentActivity activity = getActivity();
if (activity != null) {
activity.setResult(-1);
}
FragmentActivity activity2 = getActivity();
if (activity2 != null) {
activity2.finish();
}
}
private final ErrorView getError() {
return (ErrorView) this.error.getValue(this, $$delegatedProperties[0]);
}
public final PaymentInfo getPaymentInfo() {
return (PaymentInfo) this.paymentInfo.getValue();
}
private final RecyclerView getRecycler() {
return (RecyclerView) this.recycler.getValue(this, $$delegatedProperties[2]);
}
private final ViewAnimator getViewAnimator() {
return (ViewAnimator) this.viewAnimator.getValue(this, $$delegatedProperties[1]);
}
private final void openLink(String link) {
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, link, false, null, false, false, 60, null));
}
private final void setUpActions() {
getError().setOnRetryListener(new d());
}
private final void setUpRecycler() {
Context context = getContext();
if (context == null) {
return;
}
getRecycler().setLayoutManager(new LinearLayoutManager(context));
this.controller = new EripController(this, context);
RecyclerView recycler = getRecycler();
EripController eripController = this.controller;
if (eripController == null) {
s.B("controller");
eripController = null;
}
recycler.setAdapter(eripController.getAdapter());
}
private final void setUpViewModel() {
EripPaymentVM eripPaymentVM = (EripPaymentVM) new ViewModelProvider(this, getViewModelFactory()).get(EripPaymentVM.class);
this.viewModel = eripPaymentVM;
EripPaymentVM eripPaymentVM2 = null;
if (eripPaymentVM == null) {
s.B("viewModel");
eripPaymentVM = null;
}
eripPaymentVM.init(getPaymentInfo());
EripPaymentVM eripPaymentVM3 = this.viewModel;
if (eripPaymentVM3 == null) {
s.B("viewModel");
} else {
eripPaymentVM2 = eripPaymentVM3;
}
eripPaymentVM2.getState().observe(getViewLifecycleOwner(), new c(new e()));
}
public final void showState(EripPaymentVM.a state) {
boolean z11;
boolean z12;
boolean z13;
int i11 = -1;
if (state instanceof EripPaymentVM.a.C0277a) {
ViewAnimator viewAnimator = getViewAnimator();
int i12 = R$id.f12961e;
Iterator<View> it = ViewGroupKt.getChildren(viewAnimator).iterator();
int i13 = 0;
while (true) {
if (!it.hasNext()) {
break;
}
View next = it.next();
if (i13 < 0) {
t.x();
}
if (next.getId() == i12) {
z13 = true;
} else {
z13 = false;
}
if (z13) {
i11 = i13;
break;
}
i13++;
}
if (viewAnimator.getDisplayedChild() != i11) {
if (i11 >= 0) {
viewAnimator.setDisplayedChild(i11);
} else {
throw new IllegalArgumentException("View with ID " + i12 + " not found.");
}
}
EripController eripController = this.controller;
if (eripController == null) {
s.B("controller");
eripController = null;
}
eripController.setItems(((EripPaymentVM.a.C0277a) state).a());
return;
}
if (state instanceof EripPaymentVM.a.b) {
ViewAnimator viewAnimator2 = getViewAnimator();
int i14 = R$id.f12962f;
Iterator<View> it2 = ViewGroupKt.getChildren(viewAnimator2).iterator();
int i15 = 0;
while (true) {
if (!it2.hasNext()) {
break;
}
View next2 = it2.next();
if (i15 < 0) {
t.x();
}
if (next2.getId() == i14) {
z12 = true;
} else {
z12 = false;
}
if (z12) {
i11 = i15;
break;
}
i15++;
}
if (viewAnimator2.getDisplayedChild() != i11) {
if (i11 >= 0) {
viewAnimator2.setDisplayedChild(i11);
} else {
throw new IllegalArgumentException("View with ID " + i14 + " not found.");
}
}
getError().setupError(((EripPaymentVM.a.b) state).getError());
return;
}
if (s.e(state, EripPaymentVM.a.c.f13144a)) {
ViewAnimator viewAnimator3 = getViewAnimator();
int i16 = R$id.f12972p;
Iterator<View> it3 = ViewGroupKt.getChildren(viewAnimator3).iterator();
int i17 = 0;
while (true) {
if (!it3.hasNext()) {
break;
}
View next3 = it3.next();
if (i17 < 0) {
t.x();
}
if (next3.getId() == i16) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
i11 = i17;
break;
}
i17++;
}
if (viewAnimator3.getDisplayedChild() != i11) {
if (i11 >= 0) {
viewAnimator3.setDisplayedChild(i11);
return;
}
throw new IllegalArgumentException("View with ID " + i16 + " not found.");
}
}
}
public final og.a getTracker() {
og.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 onBankClick(String link) {
s.j(link, "link");
Context context = getContext();
if (context == null) {
return;
}
startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, link, false, null, false, false, 60, null));
}
@Override
public void onButtonClick(int id2) {
if (id2 == R$id.f12957a) {
getTracker().a();
openLink("http://raschet.by/main.aspx?guid=1111");
} else if (id2 == R$id.f12958b) {
finish();
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
s.j(inflater, "inflater");
return inflater.inflate(R$layout.f12985g, container, false);
}
@Override
public void onInject() {
super.onInject();
d.a a11 = qg.b.a();
Object obj = m5.a.d(this).get(qg.e.class);
if (obj != null) {
a11.a((qg.e) obj).b(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.payments.di.PaymentsFeatureDependencies");
}
@Override
public void onResume() {
super.onResume();
getTracker().b();
}
@Override
public void onSupportClick() {
openLink("https://support.kufar.by/hc/ru/articles/115001675549?utm_source=android&utm_medium=pp");
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setUpViewModel();
setUpActions();
setUpRecycler();
}
public final void setTracker(og.a aVar) {
s.j(aVar, "<set-?>");
this.tracker = aVar;
}
public final void setViewModelFactory(ViewModelProvider.Factory factory) {
s.j(factory, "<set-?>");
this.viewModelFactory = factory;
}
}