导航菜单

页面标题

页面副标题

Rilo v2.0.21 - WithdrawActivity.java 源代码

正在查看: Rilo v2.0.21 应用的 WithdrawActivity.java JAVA 源代码文件

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


package app.callpe.ui.home;

import android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
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 androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import app.callpe.App;
import app.callpe.adapters.WithdrawLogAdapter;
import app.callpe.common.utils.custom.CustomLinearLayoutManager;
import app.callpe.common.utils.helper_functions.DialogHelper;
import app.callpe.common.utils.listeners.PaginationListener;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.KycData;
import app.callpe.data.model.User;
import app.callpe.data.model.WithdrawLogModel;
import app.callpe.databinding.ActivityWithdrawBinding;
import app.callpe.databinding.StreamerContractDialogBinding;
import app.callpe.ui.dialog.BankDetailDialog;
import app.callpe.ui.dialog.TextToSpeechDialogFragment;
import app.callpe.ui.dialog.TransferDialog;
import app.callpe.ui.dialog.WithdrawDialog;
import app.callpe.ui.misc.ContractWebViewActivity;
import app.callpe.ui.misc.WebViewActivity;
import app.callpe.ui.user.KycSubmitActivity;
import dagger.hilt.android.AndroidEntryPoint;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import timber.log.Timber;

@Metadata(d1 = {"\u0000r\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0006\b\u0007\u0018\u0000 32\b\u0012\u0004\u0012\u00020\u00020\u0001:\u00043456B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0017\u001a\u00020\u0018H\u0002J\u0010\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u001cH\u0002J\u0010\u0010\u001d\u001a\u00020\u00022\u0006\u0010\u001e\u001a\u00020\u001fH\u0016J\b\u0010 \u001a\u00020\u001aH\u0002J\b\u0010!\u001a\u00020\"H\u0002J\b\u0010#\u001a\u00020\u001aH\u0002J\u0012\u0010$\u001a\u00020\u001a2\b\u0010%\u001a\u0004\u0018\u00010&H\u0014J\b\u0010'\u001a\u00020\u001aH\u0014J\u0010\u0010(\u001a\u00020\u00072\u0006\u0010)\u001a\u00020*H\u0016J\b\u0010+\u001a\u00020\u001aH\u0014J\b\u0010,\u001a\u00020\u001aH\u0002J\b\u0010-\u001a\u00020\u001aH\u0002J\b\u0010.\u001a\u00020\u001aH\u0002J\u0010\u0010/\u001a\u00020\u001a2\u0006\u00100\u001a\u000201H\u0002J\b\u00102\u001a\u00020\u001aH\u0002R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R \u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\tX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u000e\u0010\u000f\u001a\u00020\u0010X\u0082.¢\u0006\u0002\n\u0000R\u001b\u0010\u0011\u001a\u00020\u00128BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0015\u0010\u0016\u001a\u0004\b\u0013\u0010\u0014¨\u00067"}, d2 = {"Lapp/callpe/ui/home/WithdrawActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityWithdrawBinding;", "()V", "adapter", "Lapp/callpe/adapters/WithdrawLogAdapter;", "isIndianStreamer", "", "launcher", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "getLauncher", "()Landroidx/activity/result/ActivityResultLauncher;", "setLauncher", "(Landroidx/activity/result/ActivityResultLauncher;)V", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "viewModel", "Lapp/callpe/ui/home/AccountViewModel;", "getViewModel", "()Lapp/callpe/ui/home/AccountViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "getContext", "Landroid/content/Context;", "handleKyc", "", "metadata", "Lapp/callpe/data/model/Metadata;", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initViews", "observeEvent", "Lkotlinx/coroutines/Job;", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onResume", "refresh", "setUpToolbar", "setupRv", "showContractDialog", "contractUrl", "", "swipeRefresh", "Companion", "KycContractStatus", "KycStatus", "WithdrawStatus", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class WithdrawActivity extends BaseActivity<ActivityWithdrawBinding> {

    public static final Companion INSTANCE = new Companion(null);
    private static boolean resume;
    private WithdrawLogAdapter adapter;
    private boolean isIndianStreamer;
    private ActivityResultLauncher<Intent> launcher;
    private Toolbar toolbar;

    private final Lazy viewModel;

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0005\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005¨\u0006\u0006"}, d2 = {"Lapp/callpe/ui/home/WithdrawActivity$KycContractStatus;", "", "(Ljava/lang/String;I)V", "PENDING", "INITIATED", "COMPLETED", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum KycContractStatus {
        PENDING,
        INITIATED,
        COMPLETED
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0006\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006¨\u0006\u0007"}, d2 = {"Lapp/callpe/ui/home/WithdrawActivity$KycStatus;", "", "(Ljava/lang/String;I)V", "CREATED", "SUBMITTED", "REJECTED", "APPROVED", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum KycStatus {
        CREATED,
        SUBMITTED,
        REJECTED,
        APPROVED
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0006\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006¨\u0006\u0007"}, d2 = {"Lapp/callpe/ui/home/WithdrawActivity$WithdrawStatus;", "", "(Ljava/lang/String;I)V", "CREATED", "INPROGRESS", "FAILED", "COMPLETED", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum WithdrawStatus {
        CREATED,
        INPROGRESS,
        FAILED,
        COMPLETED
    }

    public static final void onClicks$lambda$6$lambda$5$lambda$4() {
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u001a\u0010\u0003\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Lapp/callpe/ui/home/WithdrawActivity$Companion;", "", "()V", "resume", "", "getResume", "()Z", "setResume", "(Z)V", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final boolean getResume() {
            return WithdrawActivity.resume;
        }

        public final void setResume(boolean z) {
            WithdrawActivity.resume = z;
        }
    }

    public WithdrawActivity() {
        ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
            public final void onActivityResult(Object obj) {
                WithdrawActivity.launcher$lambda$0(WithdrawActivity.this, (ActivityResult) obj);
            }
        });
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul…Details()\n        }\n    }");
        this.launcher = registerForActivityResult;
        final ComponentActivity componentActivity = (ComponentActivity) this;
        final Function0 function0 = null;
        this.viewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(AccountViewModel.class), new Function0<ViewModelStore>() {
            {
                super(0);
            }

            public final ViewModelStore m1496invoke() {
                return componentActivity.getViewModelStore();
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

            public final ViewModelProvider.Factory m1495invoke() {
                return componentActivity.getDefaultViewModelProviderFactory();
            }
        }, new Function0<CreationExtras>() {
            {
                super(0);
            }

            public final CreationExtras m1497invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
            }
        });
    }

    public final ActivityResultLauncher<Intent> getLauncher() {
        return this.launcher;
    }

    public final void setLauncher(ActivityResultLauncher<Intent> activityResultLauncher) {
        Intrinsics.checkNotNullParameter(activityResultLauncher, "<set-?>");
        this.launcher = activityResultLauncher;
    }

    public static final void launcher$lambda$0(WithdrawActivity withdrawActivity, ActivityResult activityResult) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        Intrinsics.checkNotNullParameter(activityResult, "result");
        if (activityResult.getResultCode() == -1) {
            AccountViewModel.getUserDetails$default(withdrawActivity.getViewModel(), false, false, 3, null);
        }
    }

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

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setWindowFlag((Activity) this, 67108864, false);
        Context context = (Context) this;
        getWindow().setStatusBarColor(ContextCompat.getColor(context, 2131100053));
        this.isIndianStreamer = SharedPref.getBoolean(context, PrefKeys.USER_IS_INDIAN);
        initViews();
        setUpToolbar();
        setupRv();
        swipeRefresh();
        observeEvent();
        onClicks();
        refresh();
    }

    private final void setupRv() {
        final RecyclerView.LayoutManager customLinearLayoutManager = new CustomLinearLayoutManager((Context) this);
        ((ActivityWithdrawBinding) getBinding()).rv.setLayoutManager(customLinearLayoutManager);
        this.adapter = new WithdrawLogAdapter(null, this.isIndianStreamer, new WithdrawLogAdapter.ItemClickListener() {
            @Override
            public void onItemClick(WithdrawLogModel model) {
                Intrinsics.checkNotNullParameter(model, "model");
            }

            @Override
            public void onOpenInvoiceClick(WithdrawLogModel model) {
                Intrinsics.checkNotNullParameter(model, "model");
                Intent intent = new Intent((Context) WithdrawActivity.this, (Class<?>) WebViewActivity.class);
                WithdrawActivity withdrawActivity = WithdrawActivity.this;
                String string = SharedPref.getString((Context) withdrawActivity, PrefKeys.AUTH_TOKEN);
                if (string == null) {
                    string = "";
                } else {
                    Intrinsics.checkNotNullExpressionValue(string, "SharedPref.getString(thi…refKeys.AUTH_TOKEN) ?: \"\"");
                }
                String str = "https://onato-invoice" + (App.isDevelopmentEnv ? "-dev" : "") + ".vercel.app/withdrawal-invoice?id=" + model.getId() + "&token=" + string;
                String valueOf = String.valueOf(model.getId());
                Timber.d("Invoice URL: " + str, new Object[0]);
                intent.putExtra("url", str);
                intent.putExtra("isInvoice", true);
                intent.putExtra("invoiceId", valueOf);
                withdrawActivity.startActivity(intent);
            }
        }, 1, null);
        RecyclerView recyclerView = ((ActivityWithdrawBinding) getBinding()).rv;
        WithdrawLogAdapter withdrawLogAdapter = this.adapter;
        if (withdrawLogAdapter == null) {
            Intrinsics.throwUninitializedPropertyAccessException("adapter");
            withdrawLogAdapter = null;
        }
        recyclerView.setAdapter(withdrawLogAdapter);
        ((ActivityWithdrawBinding) getBinding()).rv.addOnScrollListener(new PaginationListener(customLinearLayoutManager, this) {
            final WithdrawActivity this$0;

            @Override
            public void isScrolled(int dx, int dy) {
            }

            {
                super(customLinearLayoutManager, 20);
                this.this$0 = this;
            }

            @Override
            protected void loadMoreItems() {
                AccountViewModel viewModel;
                AccountViewModel viewModel2;
                viewModel = this.this$0.getViewModel();
                viewModel.setLoading(true);
                viewModel2 = this.this$0.getViewModel();
                viewModel2.getWithdrawLogs();
            }

            @Override
            public boolean isLastPage() {
                AccountViewModel viewModel;
                viewModel = this.this$0.getViewModel();
                return viewModel.getIsLastPage();
            }

            @Override
            public boolean isLoading() {
                AccountViewModel viewModel;
                viewModel = this.this$0.getViewModel();
                return viewModel.getIsLoading();
            }
        });
    }

    private final void setUpToolbar() {
        try {
            Toolbar toolbar = this.toolbar;
            if (toolbar == null) {
                Intrinsics.throwUninitializedPropertyAccessException("toolbar");
                toolbar = null;
            }
            setSupportActionBar(toolbar);
            ActionBar supportActionBar = getSupportActionBar();
            if (supportActionBar != null) {
                supportActionBar.setDisplayHomeAsUpEnabled(true);
            }
        } catch (Exception e) {
            Timber.e(e, "setUpToolbar: Error ", new Object[0]);
        }
    }

    private final void swipeRefresh() {
        getBinding().swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            public final void onRefresh() {
                WithdrawActivity.swipeRefresh$lambda$1(WithdrawActivity.this);
            }
        });
    }

    public static final void swipeRefresh$lambda$1(WithdrawActivity withdrawActivity) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        withdrawActivity.getBinding().swipeRefresh.setRefreshing(false);
        withdrawActivity.refresh();
    }

    public final void refresh() {
        getViewModel().setLastPage(false);
        getViewModel().setLoading(false);
        getViewModel().setFromId(-1L);
        getViewModel().getWithdrawLogList().clear();
        WithdrawLogAdapter withdrawLogAdapter = this.adapter;
        if (withdrawLogAdapter == null) {
            Intrinsics.throwUninitializedPropertyAccessException("adapter");
            withdrawLogAdapter = null;
        }
        withdrawLogAdapter.clear();
        getViewModel().getWithdrawLogs();
        AccountViewModel.getUserDetails$default(getViewModel(), false, false, 3, null);
        StreamerAccountFragment.INSTANCE.setRefreshScreen(true);
    }

    private final void onClicks() {
        getBinding().withdrawBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                WithdrawActivity.onClicks$lambda$3(WithdrawActivity.this, view);
            }
        });
        getBinding().transferBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                WithdrawActivity.onClicks$lambda$6(WithdrawActivity.this, view);
            }
        });
        getBinding().kycBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                WithdrawActivity.onClicks$lambda$8(WithdrawActivity.this, view);
            }
        });
        getBinding().updateKycBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                WithdrawActivity.onClicks$lambda$10(WithdrawActivity.this, view);
            }
        });
    }

    public static final void onClicks$lambda$3(final WithdrawActivity withdrawActivity, View view) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        final app.callpe.data.model.Metadata metadata = withdrawActivity.getViewModel().getMetadata();
        if (metadata != null) {
            WithdrawDialog withdrawDialog = new WithdrawDialog(metadata, new Function0<Unit>() {
                {
                    super(0);
                }

                public Object invoke() {
                    m1498invoke();
                    return Unit.INSTANCE;
                }

                public final void m1498invoke() {
                    User user = app.callpe.data.model.Metadata.this.getUser();
                    final WithdrawActivity withdrawActivity2 = withdrawActivity;
                    BankDetailDialog bankDetailDialog = new BankDetailDialog(user, new Function0<Unit>() {
                        {
                            super(0);
                        }

                        public Object invoke() {
                            m1499invoke();
                            return Unit.INSTANCE;
                        }

                        public final void m1499invoke() {
                            AccountViewModel viewModel;
                            viewModel = WithdrawActivity.this.getViewModel();
                            AccountViewModel.getUserDetails$default(viewModel, false, false, 3, null);
                        }
                    });
                    bankDetailDialog.show(withdrawActivity.getSupportFragmentManager(), bankDetailDialog.getTag());
                }
            }, new Function0<Unit>() {
                {
                    super(0);
                }

                public Object invoke() {
                    m1500invoke();
                    return Unit.INSTANCE;
                }

                public final void m1500invoke() {
                    WithdrawActivity.this.refresh();
                }
            }, new Function0<Unit>() {
                {
                    super(0);
                }

                public Object invoke() {
                    m1501invoke();
                    return Unit.INSTANCE;
                }

                public final void m1501invoke() {
                    Intent intent = new Intent((Context) WithdrawActivity.this, (Class<?>) KycSubmitActivity.class);
                    WithdrawActivity withdrawActivity2 = WithdrawActivity.this;
                    intent.putExtra("edit", true);
                    withdrawActivity2.getLauncher().launch(intent);
                }
            }, new Function0<Unit>() {
                {
                    super(0);
                }

                public Object invoke() {
                    m1502invoke();
                    return Unit.INSTANCE;
                }

                public final void m1502invoke() {
                    WithdrawActivity.this.refresh();
                }
            });
            withdrawDialog.show(withdrawActivity.getSupportFragmentManager(), withdrawDialog.getTag());
        }
    }

    public static final void onClicks$lambda$6(final WithdrawActivity withdrawActivity, View view) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        final app.callpe.data.model.Metadata metadata = withdrawActivity.getViewModel().getMetadata();
        if (metadata != null) {
            if (metadata.getUser().getReferredBy() != null) {
                try {
                    TextToSpeechDialogFragment.INSTANCE.newInstance("आपके बीन्स आपके आईडी से आपकी एजेंसी के आईडी में ट्रांसफर हो जाएंगे। क्या आप आगे बढ़ना चाहते हैं?\n\nYour beans will be transferred from your ID to your agency's ID. Do you want to proceed?", "Ok", "Cancel", new Function1<Boolean, Unit>() {
                        {
                            super(1);
                        }

                        public Object invoke(Object obj) {
                            invoke(((Boolean) obj).booleanValue());
                            return Unit.INSTANCE;
                        }

                        public final void invoke(boolean z) {
                            if (z) {
                                app.callpe.data.model.Metadata metadata2 = app.callpe.data.model.Metadata.this;
                                final app.callpe.data.model.Metadata metadata3 = app.callpe.data.model.Metadata.this;
                                final WithdrawActivity withdrawActivity2 = withdrawActivity;
                                Function0<Unit> function0 = new Function0<Unit>() {
                                    {
                                        super(0);
                                    }

                                    public Object invoke() {
                                        m1503invoke();
                                        return Unit.INSTANCE;
                                    }

                                    public final void m1503invoke() {
                                        User user = app.callpe.data.model.Metadata.this.getUser();
                                        final WithdrawActivity withdrawActivity3 = withdrawActivity2;
                                        BankDetailDialog bankDetailDialog = new BankDetailDialog(user, new Function0<Unit>() {
                                            {
                                                super(0);
                                            }

                                            public Object invoke() {
                                                m1504invoke();
                                                return Unit.INSTANCE;
                                            }

                                            public final void m1504invoke() {
                                                AccountViewModel viewModel;
                                                viewModel = WithdrawActivity.this.getViewModel();
                                                AccountViewModel.getUserDetails$default(viewModel, false, false, 3, null);
                                            }
                                        });
                                        bankDetailDialog.show(withdrawActivity2.getSupportFragmentManager(), bankDetailDialog.getTag());
                                    }
                                };
                                final WithdrawActivity withdrawActivity3 = withdrawActivity;
                                Function0<Unit> function02 = new Function0<Unit>() {
                                    {
                                        super(0);
                                    }

                                    public Object invoke() {
                                        m1505invoke();
                                        return Unit.INSTANCE;
                                    }

                                    public final void m1505invoke() {
                                        WithdrawActivity.this.refresh();
                                    }
                                };
                                WithdrawActivity$onClicks$2$1$dialogFragment$1$dialogFragment$3 withdrawActivity$onClicks$2$1$dialogFragment$1$dialogFragment$3 = new Function0<Unit>() {
                                    public final void m1506invoke() {
                                    }

                                    public Object invoke() {
                                        m1506invoke();
                                        return Unit.INSTANCE;
                                    }
                                };
                                final WithdrawActivity withdrawActivity4 = withdrawActivity;
                                TransferDialog transferDialog = new TransferDialog(metadata2, function0, function02, withdrawActivity$onClicks$2$1$dialogFragment$1$dialogFragment$3, new Function0<Unit>() {
                                    {
                                        super(0);
                                    }

                                    public Object invoke() {
                                        m1507invoke();
                                        return Unit.INSTANCE;
                                    }

                                    public final void m1507invoke() {
                                        WithdrawActivity.this.refresh();
                                    }
                                });
                                transferDialog.show(withdrawActivity.getSupportFragmentManager(), transferDialog.getTag());
                            }
                        }
                    }).show(withdrawActivity.getSupportFragmentManager(), "textToSpeechDialog");
                    return;
                } catch (Exception e) {
                    Timber.e(e);
                    return;
                }
            }
            DialogHelper.showReasonDialog((Context) withdrawActivity, "", "Cannot transfer the amount because no agency is mapped to your account!", new DialogHelper.ConfirmationListener() {
                @Override
                public final void onPositiveClick() {
                    WithdrawActivity.onClicks$lambda$6$lambda$5$lambda$4();
                }
            });
        }
    }

    public static final void onClicks$lambda$8(WithdrawActivity withdrawActivity, View view) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        Intent intent = new Intent((Context) withdrawActivity, (Class<?>) KycSubmitActivity.class);
        intent.putExtra("edit", true);
        withdrawActivity.launcher.launch(intent);
    }

    public static final void onClicks$lambda$10(WithdrawActivity withdrawActivity, View view) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "this$0");
        Intent intent = new Intent((Context) withdrawActivity, (Class<?>) KycSubmitActivity.class);
        intent.putExtra("edit", true);
        withdrawActivity.launcher.launch(intent);
    }

    public final void showContractDialog(final String contractUrl) {
        try {
            StreamerContractDialogBinding inflate = StreamerContractDialogBinding.inflate(LayoutInflater.from((Context) this));
            Intrinsics.checkNotNullExpressionValue(inflate, "inflate(LayoutInflater.from(context))");
            AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
            builder.setView((View) inflate.getRoot());
            builder.setCancelable(false);
            final AlertDialog create = builder.create();
            Window window = create.getWindow();
            if (window != null) {
                window.setBackgroundDrawableResource(R.color.transparent);
            }
            create.show();
            inflate.viewButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    WithdrawActivity.showContractDialog$lambda$12(WithdrawActivity.this, create, contractUrl, this, view);
                }
            });
            inflate.closeIcon.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    create.dismiss();
                }
            });
        } catch (Exception e) {
            Timber.e(e);
        }
    }

    public static final void showContractDialog$lambda$12(WithdrawActivity withdrawActivity, AlertDialog alertDialog, String str, WithdrawActivity withdrawActivity2, View view) {
        Intrinsics.checkNotNullParameter(withdrawActivity, "$context");
        Intrinsics.checkNotNullParameter(str, "$contractUrl");
        Intrinsics.checkNotNullParameter(withdrawActivity2, "this$0");
        Intent intent = new Intent((Context) withdrawActivity, (Class<?>) ContractWebViewActivity.class);
        intent.putExtra("url", str);
        withdrawActivity2.startActivity(intent);
        alertDialog.dismiss();
    }

    private final void initViews() {
        Toolbar toolbar = getBinding().toolbar;
        Intrinsics.checkNotNullExpressionValue(toolbar, "binding.toolbar");
        this.toolbar = toolbar;
    }

    private final Job observeEvent() {
        return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new WithdrawActivity$observeEvent$1(this, null), 3, (Object) null);
    }

    public final void handleKyc(app.callpe.data.model.Metadata metadata) {
        KycData kycData = metadata.getUser().getKycData();
        String kycStatus = kycData != null ? kycData.getKycStatus() : null;
        View view = ((ActivityWithdrawBinding) getBinding()).transferBtn;
        Intrinsics.checkNotNullExpressionValue(view, "binding.transferBtn");
        view.setVisibility(BaseActivity.INSTANCE.isStreamer() ? 0 : 8);
        KycData kycData2 = metadata.getUser().getKycData();
        if ((kycData2 != null ? kycData2.getKycContractStatus() : null) != null && Intrinsics.areEqual(metadata.getUser().getKycData().getKycContractStatus(), "INITIATED")) {
            View view2 = ((ActivityWithdrawBinding) getBinding()).withdrawBtn;
            Intrinsics.checkNotNullExpressionValue(view2, "binding.withdrawBtn");
            view2.setVisibility(8);
            getViewModel().getContract(true);
        } else {
            View view3 = ((ActivityWithdrawBinding) getBinding()).withdrawBtn;
            Intrinsics.checkNotNullExpressionValue(view3, "binding.withdrawBtn");
            view3.setVisibility(0);
        }
        if (kycStatus != null) {
            switch (kycStatus.hashCode()) {
                case -1159694117:
                    if (kycStatus.equals("SUBMITTED")) {
                        View view4 = ((ActivityWithdrawBinding) getBinding()).kycParent;
                        Intrinsics.checkNotNullExpressionValue(view4, "binding.kycParent");
                        view4.setVisibility(0);
                        LinearLayout linearLayout = ((ActivityWithdrawBinding) getBinding()).kycBtnParent;
                        Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.kycBtnParent");
                        linearLayout.setVisibility(8);
                        String string = getString(2131952165);
                        Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.kyc_submit_message)");
                        ((ActivityWithdrawBinding) getBinding()).textTv.setText(string);
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setEnabled(false);
                        TextView textView = ((ActivityWithdrawBinding) getBinding()).updateKycBtn;
                        Intrinsics.checkNotNullExpressionValue(textView, "binding.updateKycBtn");
                        textView.setVisibility(8);
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setBackgroundColor(ContextCompat.getColor((Context) this, 2131100038));
                        return;
                    }
                    return;
                case 174130302:
                    if (kycStatus.equals("REJECTED")) {
                        View view5 = ((ActivityWithdrawBinding) getBinding()).kycParent;
                        Intrinsics.checkNotNullExpressionValue(view5, "binding.kycParent");
                        view5.setVisibility(0);
                        LinearLayout linearLayout2 = ((ActivityWithdrawBinding) getBinding()).kycBtnParent;
                        Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.kycBtnParent");
                        linearLayout2.setVisibility(0);
                        String string2 = getString(2131952163);
                        Intrinsics.checkNotNullExpressionValue(string2, "getString(R.string.kyc_reject_message)");
                        ((ActivityWithdrawBinding) getBinding()).textTv.setText(string2);
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setEnabled(false);
                        TextView textView2 = ((ActivityWithdrawBinding) getBinding()).updateKycBtn;
                        Intrinsics.checkNotNullExpressionValue(textView2, "binding.updateKycBtn");
                        textView2.setVisibility(8);
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setBackgroundColor(ContextCompat.getColor((Context) this, 2131100038));
                        return;
                    }
                    return;
                case 1746537160:
                    if (!kycStatus.equals("CREATED")) {
                        return;
                    }
                    break;
                case 1967871671:
                    if (kycStatus.equals("APPROVED")) {
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setEnabled(true);
                        View view6 = ((ActivityWithdrawBinding) getBinding()).kycParent;
                        Intrinsics.checkNotNullExpressionValue(view6, "binding.kycParent");
                        view6.setVisibility(8);
                        TextView textView3 = ((ActivityWithdrawBinding) getBinding()).updateKycBtn;
                        Intrinsics.checkNotNullExpressionValue(textView3, "binding.updateKycBtn");
                        textView3.setVisibility(0);
                        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setBackgroundColor(ContextCompat.getColor((Context) this, 2131099815));
                        return;
                    }
                    return;
                default:
                    return;
            }
        }
        View view7 = ((ActivityWithdrawBinding) getBinding()).kycParent;
        Intrinsics.checkNotNullExpressionValue(view7, "binding.kycParent");
        view7.setVisibility(0);
        LinearLayout linearLayout3 = ((ActivityWithdrawBinding) getBinding()).kycBtnParent;
        Intrinsics.checkNotNullExpressionValue(linearLayout3, "binding.kycBtnParent");
        linearLayout3.setVisibility(0);
        String string3 = getString(2131952161);
        Intrinsics.checkNotNullExpressionValue(string3, "getString(R.string.kyc_create_message)");
        ((ActivityWithdrawBinding) getBinding()).textTv.setText(string3);
        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setEnabled(false);
        TextView textView4 = ((ActivityWithdrawBinding) getBinding()).updateKycBtn;
        Intrinsics.checkNotNullExpressionValue(textView4, "binding.updateKycBtn");
        textView4.setVisibility(8);
        ((ActivityWithdrawBinding) getBinding()).withdrawBtn.setBackgroundColor(ContextCompat.getColor((Context) this, 2131100038));
    }

    private final Context getContext() {
        return (Context) this;
    }

    protected void onResume() {
        super.onResume();
        if (resume) {
            resume = false;
            refresh();
        }
    }

    protected void onDestroy() {
        super.onDestroy();
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        Intrinsics.checkNotNullParameter(item, "item");
        if (item.getItemId() != 16908332) {
            return true;
        }
        finish();
        return true;
    }

    @Override
    public ActivityWithdrawBinding inflateLayout(LayoutInflater layoutInflater) {
        Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
        ActivityWithdrawBinding inflate = ActivityWithdrawBinding.inflate(layoutInflater);
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        return inflate;
    }
}