导航菜单

页面标题

页面副标题

Rilo v2.0.21 - YesNoGameActivity.java 源代码

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

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


package app.callpe.ui.user.games.yesnogame;

import android.app.Activity;
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.widget.LinearLayout;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
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.YesNoGameAdapter;
import app.callpe.common.utils.custom.CustomLinearLayoutManager;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.extensions.StringExtKt;
import app.callpe.common.utils.listeners.PaginationListener;
import app.callpe.data.model.YesNoGameModel;
import app.callpe.databinding.YesNoGameFragmentBinding;
import app.callpe.ui.bottomsheet.VerifyNumberSheet;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.payment.WalletActivity;
import app.callpe.ui.user.games.GameViewModel;
import app.callpe.ui.user.games.bottomsheet.GameRulesInfoSheet;
import app.callpe.ui.user.games.bottomsheet.YesNoGameUpdateBottomSheet;
import app.callpe.ui.user.games.yesnogame.YesNoGameActivity;
import com.google.android.material.appbar.AppBarLayout;
import dagger.hilt.android.AndroidEntryPoint;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
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 = {"\u0000h\n\u0002\u0018\u0002\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\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\f\b\u0007\u0018\u0000 32\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u0003:\u0003234B\u0005¢\u0006\u0002\u0010\u0004J\u0010\u0010\u0019\u001a\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u001bH\u0016J\b\u0010\u001c\u001a\u00020\u001dH\u0002J\b\u0010\u001e\u001a\u00020\u001fH\u0002J\b\u0010 \u001a\u00020\u001dH\u0016J\b\u0010!\u001a\u00020\u001dH\u0002J\b\u0010\"\u001a\u00020\u001dH\u0003J\u0012\u0010#\u001a\u00020\u001d2\b\u0010$\u001a\u0004\u0018\u00010%H\u0014J\b\u0010&\u001a\u00020\u001dH\u0014J\u0010\u0010'\u001a\u00020\b2\u0006\u0010(\u001a\u00020)H\u0016J\b\u0010*\u001a\u00020\u001dH\u0014J\b\u0010+\u001a\u00020\u001dH\u0014J\b\u0010,\u001a\u00020\u001dH\u0016J\b\u0010-\u001a\u00020\u001dH\u0002J\b\u0010.\u001a\u00020\u001dH\u0002J\b\u0010/\u001a\u00020\u001dH\u0002J\b\u00100\u001a\u00020\u001dH\u0002J\b\u00101\u001a\u00020\u001dH\u0002R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0082\u000e¢\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\u0014R\u0010\u0010\u0017\u001a\u0004\u0018\u00010\u0018X\u0082\u000e¢\u0006\u0002\n\u0000¨\u00065"}, d2 = {"Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/YesNoGameFragmentBinding;", "Lapp/callpe/ui/user/games/bottomsheet/YesNoGameUpdateBottomSheet$BottomSheetDialogListener;", "()V", "adapter", "Lapp/callpe/adapters/YesNoGameAdapter;", "mobileNumberVerified", "", "resume", "showSpinWheel", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "userLevel", "", "verifyNumberFragment", "Lapp/callpe/ui/bottomsheet/VerifyNumberSheet;", "viewModel", "Lapp/callpe/ui/user/games/GameViewModel;", "getViewModel", "()Lapp/callpe/ui/user/games/GameViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "yesNoUpdateSheet", "Lapp/callpe/ui/user/games/bottomsheet/YesNoGameUpdateBottomSheet;", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initViews", "", "observeEvent", "Lkotlinx/coroutines/Job;", "onBottomSheetDismissed", "onChipClick", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onResume", "onStop", "onUserAction", "openGameRulesBottomSheet", "refresh", "setUpToolbar", "setupRv", "swipeRefresh", "BET_TYPE", "Companion", "GAME_TYPE", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class YesNoGameActivity extends BaseActivity<YesNoGameFragmentBinding> implements YesNoGameUpdateBottomSheet.BottomSheetDialogListener {
    private static boolean refresh;
    private YesNoGameAdapter adapter;
    private boolean mobileNumberVerified;
    private boolean resume;
    private boolean showSpinWheel;
    private Toolbar toolbar;
    private String userLevel = "0";
    private VerifyNumberSheet verifyNumberFragment;

    private final Lazy viewModel;
    private YesNoGameUpdateBottomSheet yesNoUpdateSheet;

    public static final Companion INSTANCE = new Companion(null);
    private static GAME_TYPE tabType = GAME_TYPE.OPEN_EVENT;

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004¨\u0006\u0005"}, d2 = {"Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$BET_TYPE;", "", "(Ljava/lang/String;I)V", "YES", "NO", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum BET_TYPE {
        YES,
        NO
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004¨\u0006\u0005"}, d2 = {"Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$GAME_TYPE;", "", "(Ljava/lang/String;I)V", "OPEN_EVENT", "MY_BETS", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum GAME_TYPE {
        OPEN_EVENT,
        MY_BETS
    }

    public static final void onClicks$lambda$6(View view) {
    }

    @Override
    public void onBottomSheetDismissed() {
    }

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

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

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

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

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

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

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setStatusBarColor(ContextCompat.getColor((Context) this, 2131100053));
        initViews();
        setUpToolbar();
        onChipClick();
        onClicks();
        swipeRefresh();
        observeEvent();
        setupRv();
    }

    private final void onChipClick() {
        getBinding().chipOpenEvent.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                YesNoGameActivity.onChipClick$lambda$0(YesNoGameActivity.this, view);
            }
        });
        getBinding().chipMyBets.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                YesNoGameActivity.onChipClick$lambda$1(YesNoGameActivity.this, view);
            }
        });
    }

    public static final void onChipClick$lambda$0(YesNoGameActivity yesNoGameActivity, View view) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        if (tabType == GAME_TYPE.OPEN_EVENT) {
            return;
        }
        tabType = GAME_TYPE.OPEN_EVENT;
        yesNoGameActivity.getBinding().chipOpenEvent.setChecked(true);
        yesNoGameActivity.refresh();
    }

    public static final void onChipClick$lambda$1(YesNoGameActivity yesNoGameActivity, View view) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        if (tabType == GAME_TYPE.MY_BETS) {
            return;
        }
        tabType = GAME_TYPE.MY_BETS;
        yesNoGameActivity.getBinding().chipMyBets.setChecked(true);
        yesNoGameActivity.refresh();
    }

    private final void setupRv() {
        final RecyclerView.LayoutManager customLinearLayoutManager = new CustomLinearLayoutManager((Context) this);
        ((YesNoGameFragmentBinding) getBinding()).gameRv.setLayoutManager(customLinearLayoutManager);
        this.adapter = new YesNoGameAdapter(null, new YesNoGameAdapter.ItemClickListener() {
            @Override
            public void onItemClick(YesNoGameModel item) {
                Intrinsics.checkNotNullParameter(item, "item");
            }

            @Override
            public void onUpdateButtonClick(YesNoGameModel item, boolean betIsClosed, boolean resultDeclared) {
                GameViewModel viewModel;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet2;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet3;
                GameViewModel viewModel2;
                YesNoGameAdapter yesNoGameAdapter;
                Intrinsics.checkNotNullParameter(item, "item");
                if (resultDeclared) {
                    return;
                }
                if (betIsClosed) {
                    ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                    return;
                }
                int i = 0;
                if (Intrinsics.areEqual(item.getStatus(), "OPEN")) {
                    if (StringExtKt.getTimeLeftString(item.getBetCloseTime()).length() == 0) {
                        yesNoGameAdapter = YesNoGameActivity.this.adapter;
                        if (yesNoGameAdapter != null) {
                            yesNoGameAdapter.updateItemStatus(item);
                        }
                        ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                        return;
                    }
                }
                try {
                    YesNoGameActivity yesNoGameActivity = YesNoGameActivity.this;
                    YesNoGameUpdateBottomSheet.Companion companion = YesNoGameUpdateBottomSheet.INSTANCE;
                    viewModel = yesNoGameActivity.getViewModel();
                    if (viewModel.getBalance() != null) {
                        viewModel2 = yesNoGameActivity.getViewModel();
                        Double balance = viewModel2.getBalance();
                        Intrinsics.checkNotNull(balance);
                        i = (int) balance.doubleValue();
                    }
                    yesNoGameActivity.yesNoUpdateSheet = companion.newInstance(true, false, false, i, item);
                    yesNoGameUpdateBottomSheet = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet != null) {
                        yesNoGameUpdateBottomSheet.setListener(YesNoGameActivity.this);
                    }
                    yesNoGameUpdateBottomSheet2 = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet2 != null) {
                        FragmentManager supportFragmentManager = YesNoGameActivity.this.getSupportFragmentManager();
                        yesNoGameUpdateBottomSheet3 = YesNoGameActivity.this.yesNoUpdateSheet;
                        yesNoGameUpdateBottomSheet2.show(supportFragmentManager, yesNoGameUpdateBottomSheet3 != null ? yesNoGameUpdateBottomSheet3.getTag() : null);
                    }
                } catch (Exception e) {
                    Timber.e(e);
                }
            }

            @Override
            public void onYesButtonItemClick(YesNoGameModel item, boolean betIsClosed, boolean resultDeclared) {
                GameViewModel viewModel;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet2;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet3;
                GameViewModel viewModel2;
                YesNoGameAdapter yesNoGameAdapter;
                Intrinsics.checkNotNullParameter(item, "item");
                if (resultDeclared) {
                    return;
                }
                if (betIsClosed) {
                    ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                    return;
                }
                int i = 0;
                if (Intrinsics.areEqual(item.getStatus(), "OPEN")) {
                    if (StringExtKt.getTimeLeftString(item.getBetCloseTime()).length() == 0) {
                        yesNoGameAdapter = YesNoGameActivity.this.adapter;
                        if (yesNoGameAdapter != null) {
                            yesNoGameAdapter.updateItemStatus(item);
                        }
                        ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                        return;
                    }
                }
                if (item.getUserBetDetails() == null) {
                    YesNoGameActivity yesNoGameActivity = YesNoGameActivity.this;
                    YesNoGameUpdateBottomSheet.Companion companion = YesNoGameUpdateBottomSheet.INSTANCE;
                    viewModel = yesNoGameActivity.getViewModel();
                    if (viewModel.getBalance() != null) {
                        viewModel2 = yesNoGameActivity.getViewModel();
                        Double balance = viewModel2.getBalance();
                        Intrinsics.checkNotNull(balance);
                        i = (int) balance.doubleValue();
                    }
                    yesNoGameActivity.yesNoUpdateSheet = companion.newInstance(false, true, false, i, item);
                    yesNoGameUpdateBottomSheet = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet != null) {
                        yesNoGameUpdateBottomSheet.setListener(YesNoGameActivity.this);
                    }
                    yesNoGameUpdateBottomSheet2 = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet2 != null) {
                        FragmentManager supportFragmentManager = YesNoGameActivity.this.getSupportFragmentManager();
                        yesNoGameUpdateBottomSheet3 = YesNoGameActivity.this.yesNoUpdateSheet;
                        yesNoGameUpdateBottomSheet2.show(supportFragmentManager, yesNoGameUpdateBottomSheet3 != null ? yesNoGameUpdateBottomSheet3.getTag() : null);
                        return;
                    }
                    return;
                }
                Intrinsics.areEqual(item.getStatus(), "CLOSE");
            }

            @Override
            public void onNoButtonItemClick(YesNoGameModel item, boolean betIsClosed, boolean resultDeclared) {
                GameViewModel viewModel;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet2;
                YesNoGameUpdateBottomSheet yesNoGameUpdateBottomSheet3;
                GameViewModel viewModel2;
                YesNoGameAdapter yesNoGameAdapter;
                Intrinsics.checkNotNullParameter(item, "item");
                if (resultDeclared) {
                    return;
                }
                if (betIsClosed) {
                    ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                    return;
                }
                int i = 0;
                if (Intrinsics.areEqual(item.getStatus(), "OPEN")) {
                    if (StringExtKt.getTimeLeftString(item.getBetCloseTime()).length() == 0) {
                        yesNoGameAdapter = YesNoGameActivity.this.adapter;
                        if (yesNoGameAdapter != null) {
                            yesNoGameAdapter.updateItemStatus(item);
                        }
                        ActivityExtKt.toast((Activity) YesNoGameActivity.this, "Betting closed for this event");
                        return;
                    }
                }
                if (item.getUserBetDetails() == null) {
                    YesNoGameActivity yesNoGameActivity = YesNoGameActivity.this;
                    YesNoGameUpdateBottomSheet.Companion companion = YesNoGameUpdateBottomSheet.INSTANCE;
                    viewModel = yesNoGameActivity.getViewModel();
                    if (viewModel.getBalance() != null) {
                        viewModel2 = yesNoGameActivity.getViewModel();
                        Double balance = viewModel2.getBalance();
                        Intrinsics.checkNotNull(balance);
                        i = (int) balance.doubleValue();
                    }
                    yesNoGameActivity.yesNoUpdateSheet = companion.newInstance(false, false, true, i, item);
                    yesNoGameUpdateBottomSheet = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet != null) {
                        yesNoGameUpdateBottomSheet.setListener(YesNoGameActivity.this);
                    }
                    yesNoGameUpdateBottomSheet2 = YesNoGameActivity.this.yesNoUpdateSheet;
                    if (yesNoGameUpdateBottomSheet2 != null) {
                        FragmentManager supportFragmentManager = YesNoGameActivity.this.getSupportFragmentManager();
                        yesNoGameUpdateBottomSheet3 = YesNoGameActivity.this.yesNoUpdateSheet;
                        yesNoGameUpdateBottomSheet2.show(supportFragmentManager, yesNoGameUpdateBottomSheet3 != null ? yesNoGameUpdateBottomSheet3.getTag() : null);
                        return;
                    }
                    return;
                }
                Intrinsics.areEqual(item.getStatus(), "CLOSE");
            }
        }, 1, null);
        ((YesNoGameFragmentBinding) getBinding()).gameRv.setAdapter(this.adapter);
        ((YesNoGameFragmentBinding) getBinding()).gameRv.addOnScrollListener(new PaginationListener(customLinearLayoutManager, this) {
            final YesNoGameActivity this$0;

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

            @Override
            protected void loadMoreItems() {
                GameViewModel viewModel;
                GameViewModel viewModel2;
                if (YesNoGameActivity.INSTANCE.getTabType() == YesNoGameActivity.GAME_TYPE.MY_BETS) {
                    viewModel = this.this$0.getViewModel();
                    viewModel.setLoading(true);
                    viewModel2 = this.this$0.getViewModel();
                    GameViewModel.getMyBetsEventList$default(viewModel2, false, 1, null);
                }
            }

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

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

            @Override
            public void isScrolled(int dx, int dy) {
                boolean z;
                YesNoGameFragmentBinding binding;
                boolean z2 = dy > 0;
                z = this.this$0.showSpinWheel;
                if (z) {
                    binding = this.this$0.getBinding();
                    LinearLayout linearLayout = binding.playAndEarnBtn;
                    Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.playAndEarnBtn");
                    linearLayout.setVisibility(true ^ z2 ? 0 : 8);
                }
            }
        });
    }

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

    private final void onClicks() {
        getBinding().appBar.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
            public final void onOffsetChanged(AppBarLayout appBarLayout, int i) {
                YesNoGameActivity.onClicks$lambda$2(YesNoGameActivity.this, appBarLayout, i);
            }
        });
        getBinding().balanceParent.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                YesNoGameActivity.onClicks$lambda$4(YesNoGameActivity.this, view);
            }
        });
        getBinding().info.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                YesNoGameActivity.onClicks$lambda$5(YesNoGameActivity.this, view);
            }
        });
        getBinding().playAndEarnBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                YesNoGameActivity.onClicks$lambda$6(view);
            }
        });
    }

    public static final void onClicks$lambda$2(YesNoGameActivity yesNoGameActivity, AppBarLayout appBarLayout, int i) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        yesNoGameActivity.getBinding().swipeRefresh.setEnabled(i == 0);
    }

    public static final void onClicks$lambda$4(YesNoGameActivity yesNoGameActivity, View view) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        yesNoGameActivity.startActivity(new Intent((Context) yesNoGameActivity, (Class<?>) WalletActivity.class));
    }

    public static final void onClicks$lambda$5(YesNoGameActivity yesNoGameActivity, View view) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        yesNoGameActivity.openGameRulesBottomSheet();
    }

    private final void openGameRulesBottomSheet() {
        GameRulesInfoSheet newInstance = GameRulesInfoSheet.INSTANCE.newInstance("YES_NO_GAME");
        newInstance.setListener(new GameRulesInfoSheet.BottomSheetDialogListener() {
            @Override
            public void onBottomSheetDismissed() {
            }
        });
        newInstance.show(getSupportFragmentManager(), "gameRulesSheet");
    }

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

    public static final void swipeRefresh$lambda$7(YesNoGameActivity yesNoGameActivity) {
        Intrinsics.checkNotNullParameter(yesNoGameActivity, "this$0");
        yesNoGameActivity.refresh();
        yesNoGameActivity.getBinding().swipeRefresh.setRefreshing(false);
    }

    public final void refresh() {
        getViewModel().getUserWalletBalance();
        GameViewModel.getUserDetails$default(getViewModel(), false, 1, null);
        getViewModel().getCarRaceMetadata();
        if (tabType == GAME_TYPE.OPEN_EVENT) {
            YesNoGameAdapter yesNoGameAdapter = this.adapter;
            if (yesNoGameAdapter != null) {
                yesNoGameAdapter.clear();
            }
            getViewModel().getYesNoGameEvents();
            return;
        }
        getViewModel().setLastPage(false);
        getViewModel().setLoading(false);
        getViewModel().setPage(0);
        getViewModel().getBetsList().clear();
        YesNoGameAdapter yesNoGameAdapter2 = this.adapter;
        if (yesNoGameAdapter2 != null) {
            yesNoGameAdapter2.clear();
        }
        getViewModel().getMyBetsEventList(true);
    }

    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 initViews() {
        Toolbar toolbar = getBinding().toolbar;
        Intrinsics.checkNotNullExpressionValue(toolbar, "binding.toolbar");
        this.toolbar = toolbar;
    }

    protected void onResume() {
        super.onResume();
        if (!this.resume || refresh) {
            refresh();
            refresh = false;
        }
        getViewModel().getUserWalletBalance();
        this.resume = true;
    }

    protected void onStop() {
        super.onStop();
        try {
            VerifyNumberSheet verifyNumberSheet = this.verifyNumberFragment;
            if (verifyNumberSheet != null) {
                verifyNumberSheet.dismiss();
            }
        } catch (Exception e) {
            Timber.e(e);
        }
    }

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

    protected void onDestroy() {
        super.onDestroy();
        refresh = false;
    }

    @Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\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\bR\u001a\u0010\t\u001a\u00020\nX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000e¨\u0006\u000f"}, d2 = {"Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$Companion;", "", "()V", "refresh", "", "getRefresh", "()Z", "setRefresh", "(Z)V", "tabType", "Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$GAME_TYPE;", "getTabType", "()Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$GAME_TYPE;", "setTabType", "(Lapp/callpe/ui/user/games/yesnogame/YesNoGameActivity$GAME_TYPE;)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 getRefresh() {
            return YesNoGameActivity.refresh;
        }

        public final void setRefresh(boolean z) {
            YesNoGameActivity.refresh = z;
        }

        public final GAME_TYPE getTabType() {
            return YesNoGameActivity.tabType;
        }

        public final void setTabType(GAME_TYPE game_type) {
            Intrinsics.checkNotNullParameter(game_type, "<set-?>");
            YesNoGameActivity.tabType = game_type;
        }
    }

    @Override
    public void onUserAction() {
        refresh();
    }
}