导航菜单

页面标题

页面副标题

Rilo v2.0.21 - UnblockRequestsActivity.java 源代码

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

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


package app.callpe.ui.home.vitok;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
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.adapters.UnblockUserRequestAdapter;
import app.callpe.common.utils.custom.CustomLinearLayoutManager;
import app.callpe.databinding.ActivityUnblockRequestsBinding;
import app.callpe.ui.SplashActivity;
import app.callpe.ui.home.AccountViewModel;
import dagger.hilt.android.AndroidEntryPoint;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
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 = {"\u0000P\n\u0002\u0018\u0002\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\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u000f\u001a\u00020\u0010H\u0002J\b\u0010\u0011\u001a\u00020\u0012H\u0002J\b\u0010\u0013\u001a\u00020\u0014H\u0002J\b\u0010\u0015\u001a\u00020\u0012H\u0016J\b\u0010\u0016\u001a\u00020\u0012H\u0002J\u0012\u0010\u0017\u001a\u00020\u00122\b\u0010\u0018\u001a\u0004\u0018\u00010\u0019H\u0014J\b\u0010\u001a\u001a\u00020\u0012H\u0014J\u0010\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001eH\u0016J\b\u0010\u001f\u001a\u00020\u0012H\u0002J\b\u0010 \u001a\u00020\u0012H\u0002J\b\u0010!\u001a\u00020\u0012H\u0002J\b\u0010\"\u001a\u00020\u0012H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082.¢\u0006\u0002\n\u0000R\u001b\u0010\t\u001a\u00020\n8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\r\u0010\u000e\u001a\u0004\b\u000b\u0010\f¨\u0006#"}, d2 = {"Lapp/callpe/ui/home/vitok/UnblockRequestsActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "()V", "binding", "Lapp/callpe/databinding/ActivityUnblockRequestsBinding;", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "unblockUserRequestAdapter", "Lapp/callpe/adapters/UnblockUserRequestAdapter;", "viewModel", "Lapp/callpe/ui/home/AccountViewModel;", "getViewModel", "()Lapp/callpe/ui/home/AccountViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "getContext", "Landroid/content/Context;", "initViews", "", "observeEvent", "Lkotlinx/coroutines/Job;", "onBackPressed", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onOptionsItemSelected", "", "item", "Landroid/view/MenuItem;", "refresh", "setUpToolbar", "setupRv", "swipeRefresh", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class UnblockRequestsActivity extends Hilt_UnblockRequestsActivity {
    private ActivityUnblockRequestsBinding binding;
    private Toolbar toolbar;
    private UnblockUserRequestAdapter unblockUserRequestAdapter;

    private final Lazy viewModel;

    private final void onClicks() {
    }

    public UnblockRequestsActivity() {
        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 m1766invoke() {
                return componentActivity.getViewModelStore();
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

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

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

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

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityUnblockRequestsBinding inflate = ActivityUnblockRequestsBinding.inflate(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        this.binding = inflate;
        if (inflate == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            inflate = null;
        }
        setContentView((View) inflate.getRoot());
        initViews();
        setUpToolbar();
        setupRv();
        swipeRefresh();
        observeEvent();
        onClicks();
        refresh();
    }

    private final void setupRv() {
        RecyclerView.LayoutManager customLinearLayoutManager = new CustomLinearLayoutManager((Context) this);
        ActivityUnblockRequestsBinding activityUnblockRequestsBinding = this.binding;
        UnblockUserRequestAdapter unblockUserRequestAdapter = null;
        if (activityUnblockRequestsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityUnblockRequestsBinding = null;
        }
        activityUnblockRequestsBinding.rv.setLayoutManager(customLinearLayoutManager);
        this.unblockUserRequestAdapter = new UnblockUserRequestAdapter(null, new UnblockRequestsActivity$setupRv$1(this), 1, null);
        ActivityUnblockRequestsBinding activityUnblockRequestsBinding2 = this.binding;
        if (activityUnblockRequestsBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityUnblockRequestsBinding2 = null;
        }
        RecyclerView recyclerView = activityUnblockRequestsBinding2.rv;
        UnblockUserRequestAdapter unblockUserRequestAdapter2 = this.unblockUserRequestAdapter;
        if (unblockUserRequestAdapter2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("unblockUserRequestAdapter");
        } else {
            unblockUserRequestAdapter = unblockUserRequestAdapter2;
        }
        recyclerView.setAdapter(unblockUserRequestAdapter);
    }

    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() {
        ActivityUnblockRequestsBinding activityUnblockRequestsBinding = this.binding;
        if (activityUnblockRequestsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityUnblockRequestsBinding = null;
        }
        activityUnblockRequestsBinding.swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            public final void onRefresh() {
                UnblockRequestsActivity.swipeRefresh$lambda$0(UnblockRequestsActivity.this);
            }
        });
    }

    public static final void swipeRefresh$lambda$0(UnblockRequestsActivity unblockRequestsActivity) {
        Intrinsics.checkNotNullParameter(unblockRequestsActivity, "this$0");
        ActivityUnblockRequestsBinding activityUnblockRequestsBinding = unblockRequestsActivity.binding;
        if (activityUnblockRequestsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityUnblockRequestsBinding = null;
        }
        activityUnblockRequestsBinding.swipeRefresh.setRefreshing(false);
        unblockRequestsActivity.refresh();
    }

    public final void refresh() {
        UnblockUserRequestAdapter unblockUserRequestAdapter = this.unblockUserRequestAdapter;
        if (unblockUserRequestAdapter == null) {
            Intrinsics.throwUninitializedPropertyAccessException("unblockUserRequestAdapter");
            unblockUserRequestAdapter = null;
        }
        unblockUserRequestAdapter.clear();
        getViewModel().getUnblockUserRequest();
    }

    private final void initViews() {
        ActivityUnblockRequestsBinding activityUnblockRequestsBinding = this.binding;
        if (activityUnblockRequestsBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityUnblockRequestsBinding = null;
        }
        Toolbar toolbar = activityUnblockRequestsBinding.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 UnblockRequestsActivity$observeEvent$1(this, null), 3, (Object) null);
    }

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

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

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

    public void onBackPressed() {
        if (isTaskRoot()) {
            Intent intent = new Intent((Context) this, (Class<?>) SplashActivity.class);
            intent.addFlags(67108864);
            startActivity(intent);
            finish();
            return;
        }
        super.onBackPressed();
    }
}