导航菜单

页面标题

页面副标题

Biko v2.0.23 - CollectBankAccountActivity.java 源代码

正在查看: Biko v2.0.23 应用的 CollectBankAccountActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.stripe.android.payments.bankaccount.ui;

import android.content.Intent;
import android.os.Bundle;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import com.stripe.android.payments.bankaccount.navigation.CollectBankAccountContract;
import com.stripe.android.payments.bankaccount.ui.CollectBankAccountViewEffect;
import com.stripe.android.payments.bankaccount.ui.CollectBankAccountViewModel;
import com.stripe.android.payments.financialconnections.FinancialConnectionsPaymentsProxy;
import com.stripe.android.payments.financialconnections.IsFinancialConnectionsAvailable;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;

@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0010\u001a\u00020\u0011H\u0002J\u0012\u0010\u0012\u001a\u00020\u00112\b\u0010\u0013\u001a\u0004\u0018\u00010\u0014H\u0014J\f\u0010\u0015\u001a\u00020\u0011*\u00020\u0016H\u0002J\f\u0010\u0015\u001a\u00020\u0011*\u00020\u0017H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082.¢\u0006\u0002\n\u0000R\u001d\u0010\u0005\u001a\u0004\u0018\u00010\u00068BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\t\u0010\n\u001a\u0004\b\u0007\u0010\bR\u001b\u0010\u000b\u001a\u00020\f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000f\u0010\n\u001a\u0004\b\r\u0010\u000e¨\u0006\u0018"}, d2 = {"Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "financialConnectionsPaymentsProxy", "Lcom/stripe/android/payments/financialconnections/FinancialConnectionsPaymentsProxy;", "starterArgs", "Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountContract$Args;", "getStarterArgs", "()Lcom/stripe/android/payments/bankaccount/navigation/CollectBankAccountContract$Args;", "starterArgs$delegate", "Lkotlin/Lazy;", "viewModel", "Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel;", "getViewModel", "()Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewModel;", "viewModel$delegate", "initConnectionsPaymentsProxy", "", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "launch", "Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewEffect$FinishWithResult;", "Lcom/stripe/android/payments/bankaccount/ui/CollectBankAccountViewEffect$OpenConnectionsFlow;", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class CollectBankAccountActivity extends AppCompatActivity {
    private FinancialConnectionsPaymentsProxy financialConnectionsPaymentsProxy;

    private final Lazy starterArgs = LazyKt.lazy(new Function0<CollectBankAccountContract.Args>() {
        {
            super(0);
        }

        public final CollectBankAccountContract.Args m210invoke() {
            CollectBankAccountContract.Args.Companion companion = CollectBankAccountContract.Args.INSTANCE;
            Intent intent = CollectBankAccountActivity.this.getIntent();
            Intrinsics.checkNotNullExpressionValue(intent, "intent");
            return companion.fromIntent(intent);
        }
    });

    private final Lazy viewModel;

    public CollectBankAccountActivity() {
        final ComponentActivity componentActivity = (ComponentActivity) this;
        final Function0 function0 = null;
        this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(CollectBankAccountViewModel.class), new Function0<ViewModelStore>() {
            {
                super(0);
            }

            public final ViewModelStore m208invoke() {
                ViewModelStore viewModelStore = componentActivity.getViewModelStore();
                Intrinsics.checkNotNullExpressionValue(viewModelStore, "viewModelStore");
                return viewModelStore;
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

            public final ViewModelProvider.Factory m211invoke() {
                final CollectBankAccountActivity collectBankAccountActivity = CollectBankAccountActivity.this;
                return new CollectBankAccountViewModel.Factory(new Function0<CollectBankAccountContract.Args>() {
                    {
                        super(0);
                    }

                    public final CollectBankAccountContract.Args m212invoke() {
                        CollectBankAccountContract.Args starterArgs;
                        starterArgs = CollectBankAccountActivity.this.getStarterArgs();
                        if (starterArgs != null) {
                            return starterArgs;
                        }
                        throw new IllegalArgumentException("Required value was null.".toString());
                    }
                });
            }
        }, new Function0<CreationExtras>() {
            {
                super(0);
            }

            public final CreationExtras m209invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                if (function02 != null && (creationExtras = (CreationExtras) function02.invoke()) != null) {
                    return creationExtras;
                }
                CreationExtras defaultViewModelCreationExtras = componentActivity.getDefaultViewModelCreationExtras();
                Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "this.defaultViewModelCreationExtras");
                return defaultViewModelCreationExtras;
            }
        });
    }

    public final CollectBankAccountContract.Args getStarterArgs() {
        return (CollectBankAccountContract.Args) this.starterArgs.getValue();
    }

    public final CollectBankAccountViewModel getViewModel() {
        return (CollectBankAccountViewModel) this.viewModel.getValue();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initConnectionsPaymentsProxy();
        LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this).launchWhenStarted(new CollectBankAccountActivity$onCreate$1(this, null));
    }

    private final void initConnectionsPaymentsProxy() {
        this.financialConnectionsPaymentsProxy = FinancialConnectionsPaymentsProxy.Companion.create$default(FinancialConnectionsPaymentsProxy.INSTANCE, this, new CollectBankAccountActivity$initConnectionsPaymentsProxy$1(getViewModel()), (Function0) null, (IsFinancialConnectionsAvailable) null, 12, (Object) null);
    }

    public final void launch(CollectBankAccountViewEffect.OpenConnectionsFlow openConnectionsFlow) {
        FinancialConnectionsPaymentsProxy financialConnectionsPaymentsProxy = this.financialConnectionsPaymentsProxy;
        if (financialConnectionsPaymentsProxy == null) {
            Intrinsics.throwUninitializedPropertyAccessException("financialConnectionsPaymentsProxy");
            financialConnectionsPaymentsProxy = null;
        }
        financialConnectionsPaymentsProxy.present(openConnectionsFlow.getFinancialConnectionsSessionSecret(), openConnectionsFlow.getPublishableKey(), openConnectionsFlow.getStripeAccountId());
    }

    public final void launch(CollectBankAccountViewEffect.FinishWithResult finishWithResult) {
        setResult(-1, new Intent().putExtras(new CollectBankAccountContract.Result(finishWithResult.getResult()).toBundle()));
        finish();
    }
}