导航菜单

页面标题

页面副标题

Biko v2.0.23 - NonLiveHomeActivityTypeThree.java 源代码

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

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


package app.callpe.ui.nonliveui;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
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.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Lifecycle;
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.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import app.callpe.App;
import app.callpe.common.agora.VideoCallEvent;
import app.callpe.common.agora.VideoCallEventType;
import app.callpe.common.utils.DateHelper;
import app.callpe.common.utils.Helper;
import app.callpe.common.utils.InAppUpdate;
import app.callpe.common.utils.badgeMenu.BadgeDrawerToggle;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.InterestResponse;
import app.callpe.data.model.LanguageResponse;
import app.callpe.data.model.StreamerModel;
import app.callpe.data.model.User;
import app.callpe.data.model.VideoDetailModel;
import app.callpe.databinding.ActivityNonLiveHomeBinding;
import app.callpe.service.jobs.JobPriority;
import app.callpe.ui.bottomsheet.InterestAndLanguage;
import app.callpe.ui.call.ZegoVideoCallActivity;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.home.HomeViewModel;
import app.callpe.ui.home.NonLiveChatFragment;
import app.callpe.ui.home.UserAccountFragment;
import app.callpe.ui.home.fragments.ChatListFragment;
import app.callpe.ui.home.fragments.DiscoverFragment;
import app.callpe.ui.home.fragments.SystemChatListFragment;
import app.callpe.ui.nonliveui.fragments.NonLiveAccountFragmentOne;
import app.callpe.ui.user.NonLiveMyProfileActivity;
import com.birjuvachhani.locus.Constants;
import com.bumptech.glide.Glide;
import com.facebook.internal.FacebookRequestErrorClassification;
import com.facebook.internal.NativeProtocol;
import com.google.android.material.badge.BadgeDrawable;
import com.google.android.material.navigation.NavigationBarView;
import com.google.android.material.navigation.NavigationView;
import com.google.gson.Gson;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.ArrayList;
import java.util.Iterator;
import kotlin.Deprecated;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.ArrayIteratorKt;
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 = {"\u0000ì\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\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\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\u0003\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\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0015\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0012\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001yB\u0005¢\u0006\u0002\u0010\u0003J\b\u00102\u001a\u000203H\u0002J\b\u00104\u001a\u000205H\u0002J\u0010\u00106\u001a\u0002032\u0006\u00107\u001a\u000208H\u0002J\u0010\u00109\u001a\u0002032\u0006\u0010:\u001a\u00020;H\u0002J\u0010\u0010<\u001a\u00020\u00022\u0006\u0010=\u001a\u00020>H\u0016J\b\u0010?\u001a\u000203H\u0002J\b\u0010@\u001a\u00020AH\u0002J\"\u0010B\u001a\u0002032\u0006\u0010C\u001a\u00020\t2\u0006\u0010D\u001a\u00020\t2\b\u0010E\u001a\u0004\u0018\u00010FH\u0015J\b\u0010G\u001a\u000203H\u0017J\b\u0010H\u001a\u000203H\u0002J\u0012\u0010I\u001a\u0002032\b\u0010J\u001a\u0004\u0018\u00010KH\u0014J\b\u0010L\u001a\u000203H\u0014J\b\u0010M\u001a\u000203H\u0014J+\u0010N\u001a\u0002032\u0006\u0010C\u001a\u00020\t2\f\u0010O\u001a\b\u0012\u0004\u0012\u00020\u00060\u00052\u0006\u0010P\u001a\u00020QH\u0016¢\u0006\u0002\u0010RJ\b\u0010S\u001a\u000203H\u0014J\b\u0010T\u001a\u000203H\u0014J\u0012\u0010U\u001a\u0002032\b\b\u0002\u0010V\u001a\u00020WH\u0002J\b\u0010X\u001a\u000203H\u0002J\b\u0010Y\u001a\u000203H\u0002J\b\u0010Z\u001a\u000203H\u0002J\u001d\u0010[\u001a\u00020W2\u000e\u0010O\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005H\u0002¢\u0006\u0002\u0010\\J\u0010\u0010]\u001a\u00020W2\u0006\u0010^\u001a\u00020\u0006H\u0002J\b\u0010_\u001a\u000203H\u0002J\u0010\u0010`\u001a\u0002032\u0006\u0010a\u001a\u00020\tH\u0002J\b\u0010b\u001a\u000203H\u0002J(\u0010c\u001a\u0002032\u0006\u0010d\u001a\u00020\u00062\u0006\u0010e\u001a\u00020\u00062\u0006\u0010f\u001a\u00020\u00062\u0006\u0010g\u001a\u00020\u0006H\u0002J \u0010h\u001a\u0002032\u0016\u0010i\u001a\u0012\u0012\u0004\u0012\u00020j0\u0019j\b\u0012\u0004\u0012\u00020j`\u001aH\u0002J \u0010k\u001a\u0002032\u0016\u0010l\u001a\u0012\u0012\u0004\u0012\u00020m0\u0019j\b\u0012\u0004\u0012\u00020m`\u001aH\u0002J\b\u0010n\u001a\u000203H\u0002J\u000e\u0010o\u001a\u0002032\u0006\u0010p\u001a\u00020WJ\b\u0010q\u001a\u000203H\u0002J\u0010\u0010r\u001a\u0002032\u0006\u0010s\u001a\u00020tH\u0002J\u0010\u0010u\u001a\u0002032\u0006\u0010v\u001a\u00020wH\u0002J\b\u0010x\u001a\u000203H\u0002R\u0016\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u0007R\u000e\u0010\b\u001a\u00020\tX\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\tX\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\tX\u0082D¢\u0006\u0002\n\u0000R\u0010\u0010\f\u001a\u0004\u0018\u00010\rX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082.¢\u0006\u0002\n\u0000R\u001c\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0013\"\u0004\b\u0014\u0010\u0015R\u0010\u0010\u0016\u001a\u0004\u0018\u00010\u0017X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u0018\u001a\u0012\u0012\u0004\u0012\u00020\u00060\u0019j\b\u0012\u0004\u0012\u00020\u0006`\u001aX\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u001b\u001a\u0012\u0012\u0004\u0012\u00020\u00060\u0019j\b\u0012\u0004\u0012\u00020\u0006`\u001aX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u001dX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001e\u001a\u00020\u001fX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010 \u001a\u00020!X\u0082\u0004¢\u0006\u0002\n\u0000R\u001e\u0010\"\u001a\u0010\u0012\f\u0012\n $*\u0004\u0018\u00010\u00060\u00060#8\u0002X\u0083\u0004¢\u0006\u0002\n\u0000R\u000e\u0010%\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010&\u001a\u00020'X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010(\u001a\u00020)X\u0082.¢\u0006\u0002\n\u0000R\u001b\u0010*\u001a\u00020+8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b.\u0010/\u001a\u0004\b,\u0010-R\u0010\u00100\u001a\u0004\u0018\u000101X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006z"}, d2 = {"Lapp/callpe/ui/nonliveui/NonLiveHomeActivityTypeThree;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityNonLiveHomeBinding;", "()V", "PERMISSIONS", "", "", "[Ljava/lang/String;", "PERMISSION_NOTIFICATION", "", "PERMISSION_REQ_FORWARD", "PERMISSION_REQ_STAY", "alertDialog", "Landroidx/appcompat/app/AlertDialog;", "drawer", "Landroidx/drawerlayout/widget/DrawerLayout;", "handler", "Landroid/os/Handler;", "getHandler", "()Landroid/os/Handler;", "setHandler", "(Landroid/os/Handler;)V", "inAppUpdate", "Lapp/callpe/common/utils/InAppUpdate;", "interestList", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "languageList", "mViewPagerAdapter", "Lapp/callpe/ui/nonliveui/NonLiveHomeActivityTypeThree$ViewPager2Adapter;", "navigationView", "Lcom/google/android/material/navigation/NavigationView;", "receiver", "Landroid/content/BroadcastReceiver;", "requestPermissionLauncher", "Landroidx/activity/result/ActivityResultLauncher;", "kotlin.jvm.PlatformType", "response", "toggle", "Lapp/callpe/common/utils/badgeMenu/BadgeDrawerToggle;", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "viewModel", "Lapp/callpe/ui/home/HomeViewModel;", "getViewModel", "()Lapp/callpe/ui/home/HomeViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "viewPager", "Landroidx/viewpager2/widget/ViewPager2;", "checkPermissions", "", "getContext", "Landroid/content/Context;", "handleVideoCallEvents", "event", "Lapp/callpe/common/agora/VideoCallEvent;", "hideNotificationView", "notif_cv", "Landroidx/cardview/widget/CardView;", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initViews", "observeEvent", "Lkotlinx/coroutines/Job;", "onActivityResult", "requestCode", "resultCode", "data", "Landroid/content/Intent;", "onBackPressed", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onPause", "onRequestPermissionsResult", NativeProtocol.RESULT_ARGS_PERMISSIONS, "grantResults", "", "(I[Ljava/lang/String;[I)V", "onResume", "onStart", "ongoingCallLayout", "reset", "", "openMyInterestBottomSheet", "openMyLanguageBottomSheet", "openMyPreferenceBottomSheet", "permissionArrayGranted", "([Ljava/lang/String;)Z", "permissionGranted", "permission", "refresh", "requestPermissions", Constants.INTENT_EXTRA_CONFIGURATION, "setNav", "setNotificationValues", "senderImage", "senderName", "message", "messageType", "setUpChosenInterestList", "interests", "Lapp/callpe/data/model/InterestResponse;", "setUpChosenLanguageList", "languages", "Lapp/callpe/data/model/LanguageResponse;", "setUpNavigation", "showBadge", "isVisible", "showNotificationView", "showProfile", "user", "Lapp/callpe/data/model/User;", "showUpdateUI", "metadata", "Lapp/callpe/data/model/Metadata;", "toastNeedPermissions", "ViewPager2Adapter", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class NonLiveHomeActivityTypeThree extends BaseActivity<ActivityNonLiveHomeBinding> {
    private String[] PERMISSIONS;
    private final int PERMISSION_NOTIFICATION;
    private final int PERMISSION_REQ_FORWARD;
    private final int PERMISSION_REQ_STAY;
    private AlertDialog alertDialog;
    private DrawerLayout drawer;
    private Handler handler;
    private InAppUpdate inAppUpdate;
    private ViewPager2Adapter mViewPagerAdapter;
    private NavigationView navigationView;
    private final BroadcastReceiver receiver;
    private final ActivityResultLauncher<String> requestPermissionLauncher;
    private BadgeDrawerToggle toggle;
    private Toolbar toolbar;

    private final Lazy viewModel;
    private ViewPager2 viewPager;
    private String response = "";
    private ArrayList<String> languageList = new ArrayList<>();
    private ArrayList<String> interestList = new ArrayList<>();

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

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

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

            public final CreationExtras m2004invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
            }
        });
        ActivityResultLauncher<String> registerForActivityResult = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.RequestPermission(), new ActivityResultCallback() {
            public final void onActivityResult(Object obj) {
                NonLiveHomeActivityTypeThree.requestPermissionLauncher$lambda$1(NonLiveHomeActivityTypeThree.this, ((Boolean) obj).booleanValue());
            }
        });
        Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul… finish()\n        }\n    }");
        this.requestPermissionLauncher = registerForActivityResult;
        this.PERMISSION_REQ_FORWARD = 1010;
        this.PERMISSION_NOTIFICATION = 1012;
        this.PERMISSION_REQ_STAY = 1011;
        this.PERMISSIONS = new String[]{"android.permission.RECORD_AUDIO", "android.permission.CAMERA", "android.permission.CALL_PHONE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.READ_PHONE_STATE"};
        this.receiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                ViewPager2 viewPager2;
                if (Intrinsics.areEqual(intent != null ? intent.getAction() : null, app.callpe.common.utils.Constants.NOTIFY)) {
                    viewPager2 = NonLiveHomeActivityTypeThree.this.viewPager;
                    if (viewPager2 != null && viewPager2.getCurrentItem() == 1) {
                        return;
                    }
                    intent.setAction("");
                    String stringExtra = intent.getStringExtra("img");
                    String stringExtra2 = intent.getStringExtra(FacebookRequestErrorClassification.KEY_NAME);
                    String stringExtra3 = intent.getStringExtra("message");
                    String stringExtra4 = intent.getStringExtra("message_type");
                    if (stringExtra == null || stringExtra2 == null || stringExtra3 == null || stringExtra4 == null) {
                        return;
                    }
                    NonLiveHomeActivityTypeThree.this.showNotificationView();
                    NonLiveHomeActivityTypeThree.this.setNotificationValues(stringExtra, stringExtra2, stringExtra3, stringExtra4);
                }
            }
        };
    }

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

    public final Handler getHandler() {
        return this.handler;
    }

    public final void setHandler(Handler handler) {
        this.handler = handler;
    }

    public static final void requestPermissionLauncher$lambda$1(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, boolean z) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        if (z) {
            Timber.d("Permission granted", new Object[0]);
            if (nonLiveHomeActivityTypeThree.permissionArrayGranted(nonLiveHomeActivityTypeThree.PERMISSIONS)) {
                return;
            }
            nonLiveHomeActivityTypeThree.requestPermissions(nonLiveHomeActivityTypeThree.PERMISSION_REQ_FORWARD);
            return;
        }
        ActivityExtKt.toast((Activity) nonLiveHomeActivityTypeThree, "Notification permission is necessary for using this app.");
        Intent intent = new Intent();
        intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");
        intent.putExtra("android.provider.extra.APP_PACKAGE", nonLiveHomeActivityTypeThree.getPackageName());
        nonLiveHomeActivityTypeThree.startActivity(intent);
        nonLiveHomeActivityTypeThree.finish();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Activity activity = (Activity) this;
        setWindowFlag(activity, 67108864, false);
        Context context = (Context) this;
        getWindow().setStatusBarColor(ContextCompat.getColor(context, 2131100053));
        SharedPref.setBoolean(context, PrefKeys.APP_ACCESS, true);
        if (Build.VERSION.SDK_INT < 30) {
            this.PERMISSIONS = new String[]{"android.permission.RECORD_AUDIO", "android.permission.CAMERA", "android.permission.CALL_PHONE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.READ_PHONE_STATE", "android.permission.READ_EXTERNAL_STORAGE"};
        } else if (Build.VERSION.SDK_INT >= 33) {
            this.PERMISSIONS = new String[]{"android.permission.RECORD_AUDIO", "android.permission.CAMERA", "android.permission.CALL_PHONE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.READ_PHONE_STATE"};
        }
        LocalBroadcastManager.getInstance(context).registerReceiver(this.receiver, new IntentFilter(app.callpe.common.utils.Constants.NOTIFY));
        this.inAppUpdate = new InAppUpdate(activity);
        initViews();
        observeEvent();
        setUpNavigation();
        onClicks();
        getViewModel().getUserDetails();
    }

    public final void showNotificationView() {
        final CardView findViewById = findViewById(2131363921);
        findViewById.setVisibility(0);
        ChatListFragment.Companion companion = ChatListFragment.INSTANCE;
        ChatListFragment.refreshScreen = true;
        SystemChatListFragment.Companion companion2 = SystemChatListFragment.INSTANCE;
        SystemChatListFragment.refreshScreen = true;
        TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, 0.0f, 1, -1.0f, 1, 0.0f);
        translateAnimation.setDuration(200L);
        findViewById.startAnimation(translateAnimation);
        Looper myLooper = Looper.myLooper();
        Intrinsics.checkNotNull(myLooper);
        Handler handler = new Handler(myLooper);
        this.handler = handler;
        handler.postDelayed(new Runnable() {
            @Override
            public final void run() {
                NonLiveHomeActivityTypeThree.showNotificationView$lambda$2(NonLiveHomeActivityTypeThree.this, findViewById);
            }
        }, 3000L);
    }

    public static final void showNotificationView$lambda$2(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, CardView cardView) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        Intrinsics.checkNotNullExpressionValue(cardView, "notificationCv");
        nonLiveHomeActivityTypeThree.hideNotificationView(cardView);
    }

    private final void hideNotificationView(final CardView notif_cv) {
        TranslateAnimation translateAnimation = new TranslateAnimation(1, 0.0f, 1, 0.0f, 1, 0.0f, 1, -1.0f);
        translateAnimation.setDuration(200L);
        notif_cv.startAnimation(translateAnimation);
        translateAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                notif_cv.setVisibility(8);
            }
        });
    }

    public final void setNotificationValues(String senderImage, String senderName, String message, String messageType) {
        TextView textView = (TextView) findViewById(2131365030);
        TextView textView2 = (TextView) findViewById(2131364859);
        ImageView imageView = (ImageView) findViewById(2131362056);
        textView.setText(senderName);
        Glide.with(getApplicationContext()).load(senderImage).into(imageView);
        switch (messageType.hashCode()) {
            case -908239545:
                if (messageType.equals("GIFT_SENT")) {
                    textView2.setText("Gift Received!");
                    return;
                }
                break;
            case 45045344:
                if (messageType.equals(app.callpe.common.utils.Constants.GIFT_REQUEST)) {
                    textView2.setText("Gift is Requested");
                    return;
                }
                break;
            case 62628790:
                if (messageType.equals("AUDIO")) {
                    textView2.setText(getString(2131951700));
                    return;
                }
                break;
            case 69775675:
                if (messageType.equals(app.callpe.common.utils.Constants.IMAGE)) {
                    textView2.setText(getString(2131952140));
                    return;
                }
                break;
            case 81665115:
                if (messageType.equals(app.callpe.common.utils.Constants.VIDEO)) {
                    textView2.setText(getString(2131953069));
                    return;
                }
                break;
            case 1303595974:
                if (messageType.equals(app.callpe.common.utils.Constants.LOCKED_IMAGE)) {
                    textView2.setText(getString(2131952188));
                    return;
                }
                break;
        }
        textView2.setText(message);
    }

    private final void onClicks() {
        final CardView findViewById = findViewById(2131363921);
        findViewById.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.onClicks$lambda$3(NonLiveHomeActivityTypeThree.this, findViewById, view);
            }
        });
        getBinding().profilePic.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.onClicks$lambda$5(NonLiveHomeActivityTypeThree.this, view);
            }
        });
        getBinding().ongoingCallParent.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.onClicks$lambda$7(NonLiveHomeActivityTypeThree.this, view);
            }
        });
        getBinding().updateBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.onClicks$lambda$8(NonLiveHomeActivityTypeThree.this, view);
            }
        });
        getBinding().filter.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.onClicks$lambda$9(NonLiveHomeActivityTypeThree.this, view);
            }
        });
    }

    public static final void onClicks$lambda$3(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, CardView cardView, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        ViewPager2 viewPager2 = nonLiveHomeActivityTypeThree.getBinding().viewPager;
        Intrinsics.checkNotNullExpressionValue(viewPager2, "binding.viewPager");
        viewPager2.setCurrentItem(2);
        cardView.setVisibility(8);
        Handler handler = nonLiveHomeActivityTypeThree.handler;
        if (handler != null) {
            handler.removeCallbacksAndMessages(null);
        }
    }

    public static final void onClicks$lambda$5(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        nonLiveHomeActivityTypeThree.startActivity(new Intent((Context) nonLiveHomeActivityTypeThree, (Class<?>) NonLiveMyProfileActivity.class));
    }

    public static final void onClicks$lambda$7(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        VideoDetailModel videoDetails = nonLiveHomeActivityTypeThree.getViewModel().getVideoDetails();
        if (videoDetails != null) {
            Intent intent = new Intent(nonLiveHomeActivityTypeThree.getApplicationContext(), (Class<?>) ZegoVideoCallActivity.class);
            intent.putExtra(app.callpe.common.utils.Constants.FROM_NOTIFICATION_CLICK, !App.Companion.isVideoCallScreen());
            intent.putExtra(app.callpe.common.utils.Constants.KEY_CALLING_CHANNEL, videoDetails.getAgoraChannelName());
            intent.putExtra(app.callpe.common.utils.Constants.KEY_CALLING_VIDEO_ID, videoDetails.getId());
            intent.putExtra(app.callpe.common.utils.Constants.KEY_AGORA_ACCESS_TOKEN, videoDetails.getAgoraUserToken());
            intent.putExtra(app.callpe.common.utils.Constants.KEY_CALLER, nonLiveHomeActivityTypeThree.getViewModel().getCaller());
            intent.putExtra(app.callpe.common.utils.Constants.FCM_DATA, new Gson().toJson(videoDetails));
            nonLiveHomeActivityTypeThree.startActivity(intent);
        }
    }

    public static final void onClicks$lambda$8(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        try {
            String string = nonLiveHomeActivityTypeThree.getString(2131951676);
            Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_package)");
            try {
                nonLiveHomeActivityTypeThree.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
            } catch (ActivityNotFoundException unused) {
                nonLiveHomeActivityTypeThree.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
            }
        } catch (Exception unused2) {
        }
    }

    public static final void onClicks$lambda$9(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        nonLiveHomeActivityTypeThree.openMyPreferenceBottomSheet();
    }

    private final void initViews() {
        DrawerLayout drawerLayout = ((ActivityNonLiveHomeBinding) getBinding()).newHomeDrawerLayout;
        Intrinsics.checkNotNullExpressionValue(drawerLayout, "binding.newHomeDrawerLayout");
        this.drawer = drawerLayout;
        NavigationView navigationView = ((ActivityNonLiveHomeBinding) getBinding()).newHomeNavView;
        Intrinsics.checkNotNullExpressionValue(navigationView, "binding.newHomeNavView");
        this.navigationView = navigationView;
        Toolbar toolbar = ((ActivityNonLiveHomeBinding) getBinding()).toolbar;
        Intrinsics.checkNotNullExpressionValue(toolbar, "binding.toolbar");
        this.toolbar = toolbar;
        ((ActivityNonLiveHomeBinding) getBinding()).homeTitle.setTypeface(ResourcesCompat.getFont((Context) this, 2131296258));
    }

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

    private final void showProfile(User user) {
        if (user.getProfile().length() == 0) {
            Glide.with((FragmentActivity) this).load(user.getAvatar()).error(2131231670).into(getBinding().profilePic);
        } else {
            Glide.with((FragmentActivity) this).load(user.getProfile()).error(2131231670).into(getBinding().profilePic);
        }
    }

    private final void setNav() {
        throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.nonliveui.NonLiveHomeActivityTypeThree.setNav():void");
    }

    public static final void setNav$lambda$11(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        nonLiveHomeActivityTypeThree.startActivity(new Intent((Context) nonLiveHomeActivityTypeThree, (Class<?>) NonLiveMyProfileActivity.class));
    }

    public static final boolean setNav$lambda$15(app.callpe.ui.nonliveui.NonLiveHomeActivityTypeThree r5, android.view.MenuItem r6) {
        throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.nonliveui.NonLiveHomeActivityTypeThree.setNav$lambda$15(app.callpe.ui.nonliveui.NonLiveHomeActivityTypeThree, android.view.MenuItem):boolean");
    }

    public final void refresh() {
        getViewModel().getUserDetails();
        this.languageList.clear();
        this.interestList.clear();
    }

    private final void openMyInterestBottomSheet() {
        InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(true, this.interestList, new ArrayList<>());
        newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
            @Override
            public void onBottomSheetDismissed() {
                NonLiveHomeActivityTypeThree.this.refresh();
            }
        });
        newInstance.show(getSupportFragmentManager(), "BottomSheet");
    }

    private final void openMyLanguageBottomSheet() {
        InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(false, new ArrayList<>(), this.languageList);
        newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
            @Override
            public void onBottomSheetDismissed() {
                NonLiveHomeActivityTypeThree.this.refresh();
            }
        });
        newInstance.show(getSupportFragmentManager(), "BottomSheet");
    }

    private final void openMyPreferenceBottomSheet() {
        if (this.viewPager != null) {
            try {
                Fragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("f0");
                if (findFragmentByTag != null) {
                    if (findFragmentByTag instanceof DiscoverFragment) {
                        ((DiscoverFragment) findFragmentByTag).filterAndSortBottomSheet();
                    }
                    Unit unit = Unit.INSTANCE;
                }
            } catch (Exception e) {
                Timber.e(e);
                Unit unit2 = Unit.INSTANCE;
            }
        }
    }

    public final void setUpChosenLanguageList(ArrayList<LanguageResponse> languages) {
        Iterator<LanguageResponse> it = languages.iterator();
        while (it.hasNext()) {
            this.languageList.add(it.next().getLanguage());
        }
    }

    public final void setUpChosenInterestList(ArrayList<InterestResponse> interests) {
        Iterator<InterestResponse> it = interests.iterator();
        while (it.hasNext()) {
            this.interestList.add(it.next().getInterest());
        }
    }

    private final void setUpNavigation() {
        this.viewPager = ((ActivityNonLiveHomeBinding) getBinding()).viewPager;
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "supportFragmentManager");
        Lifecycle lifecycle = getLifecycle();
        Intrinsics.checkNotNullExpressionValue(lifecycle, "lifecycle");
        RecyclerView.Adapter viewPager2Adapter = new ViewPager2Adapter(supportFragmentManager, lifecycle);
        this.mViewPagerAdapter = viewPager2Adapter;
        ViewPager2 viewPager2 = this.viewPager;
        if (viewPager2 != null) {
            viewPager2.setAdapter(viewPager2Adapter);
        }
        ViewPager2 viewPager22 = this.viewPager;
        if (viewPager22 != null) {
            viewPager22.setUserInputEnabled(false);
        }
        ViewPager2 viewPager23 = this.viewPager;
        if (viewPager23 != null) {
            viewPager23.setOffscreenPageLimit(4);
        }
        Menu menu = ((ActivityNonLiveHomeBinding) getBinding()).bottomNavigation.getMenu();
        Intrinsics.checkNotNullExpressionValue(menu, "binding.bottomNavigation.menu");
        menu.findItem(2131362948).setVisible(true);
        Context context = (Context) this;
        menu.findItem(2131362958).setIcon(ContextCompat.getDrawable(context, 2131231618));
        menu.findItem(2131362950).setIcon(ContextCompat.getDrawable(context, 2131231560));
        ((ActivityNonLiveHomeBinding) getBinding()).bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
            public final boolean onNavigationItemSelected(MenuItem menuItem) {
                boolean upNavigation$lambda$18;
                upNavigation$lambda$18 = NonLiveHomeActivityTypeThree.setUpNavigation$lambda$18(NonLiveHomeActivityTypeThree.this, menuItem);
                return upNavigation$lambda$18;
            }
        });
        ViewPager2 viewPager24 = this.viewPager;
        if (viewPager24 != null) {
            viewPager24.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
                public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
                    ActivityNonLiveHomeBinding binding;
                    ActivityNonLiveHomeBinding binding2;
                    ActivityNonLiveHomeBinding binding3;
                    ActivityNonLiveHomeBinding binding4;
                    ActivityNonLiveHomeBinding binding5;
                    ActivityNonLiveHomeBinding binding6;
                    if (position == 0) {
                        binding = NonLiveHomeActivityTypeThree.this.getBinding();
                        ImageView imageView = binding.filter;
                        Intrinsics.checkNotNullExpressionValue(imageView, "binding.filter");
                        imageView.setVisibility(0);
                        binding2 = NonLiveHomeActivityTypeThree.this.getBinding();
                        binding2.homeTitle.setText("Home Screen");
                        return;
                    }
                    if (position == 1) {
                        binding3 = NonLiveHomeActivityTypeThree.this.getBinding();
                        ImageView imageView2 = binding3.filter;
                        Intrinsics.checkNotNullExpressionValue(imageView2, "binding.filter");
                        imageView2.setVisibility(8);
                        binding4 = NonLiveHomeActivityTypeThree.this.getBinding();
                        binding4.homeTitle.setText(NonLiveHomeActivityTypeThree.this.getString(2131951840));
                        return;
                    }
                    if (position != 2) {
                        return;
                    }
                    binding5 = NonLiveHomeActivityTypeThree.this.getBinding();
                    ImageView imageView3 = binding5.filter;
                    Intrinsics.checkNotNullExpressionValue(imageView3, "binding.filter");
                    imageView3.setVisibility(8);
                    binding6 = NonLiveHomeActivityTypeThree.this.getBinding();
                    binding6.homeTitle.setText("Info");
                }

                public void onPageSelected(int position) {
                    ActivityNonLiveHomeBinding binding;
                    ActivityNonLiveHomeBinding binding2;
                    ActivityNonLiveHomeBinding binding3;
                    if (position == 0) {
                        binding = NonLiveHomeActivityTypeThree.this.getBinding();
                        binding.bottomNavigation.setSelectedItemId(2131362958);
                    } else if (position == 1) {
                        binding2 = NonLiveHomeActivityTypeThree.this.getBinding();
                        binding2.bottomNavigation.setSelectedItemId(2131362950);
                    } else {
                        if (position != 2) {
                            return;
                        }
                        binding3 = NonLiveHomeActivityTypeThree.this.getBinding();
                        binding3.bottomNavigation.setSelectedItemId(2131362948);
                    }
                }
            });
        }
        ((ActivityNonLiveHomeBinding) getBinding()).fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveHomeActivityTypeThree.setUpNavigation$lambda$19(NonLiveHomeActivityTypeThree.this, view);
            }
        });
    }

    public static final boolean setUpNavigation$lambda$18(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, MenuItem menuItem) {
        ViewPager2 viewPager2;
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        Intrinsics.checkNotNullParameter(menuItem, "item");
        int itemId = menuItem.getItemId();
        if (itemId == 2131362948) {
            ViewPager2 viewPager22 = nonLiveHomeActivityTypeThree.viewPager;
            if (viewPager22 != null) {
                viewPager22.setCurrentItem(2);
            }
        } else if (itemId == 2131362950) {
            ViewPager2 viewPager23 = nonLiveHomeActivityTypeThree.viewPager;
            if (viewPager23 != null) {
                viewPager23.setCurrentItem(1);
            }
        } else if (itemId == 2131362958 && (viewPager2 = nonLiveHomeActivityTypeThree.viewPager) != null) {
            viewPager2.setCurrentItem(0);
        }
        return true;
    }

    public static final void setUpNavigation$lambda$19(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, View view) {
        ViewPager2 viewPager2;
        Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeThree, "this$0");
        ViewPager2 viewPager22 = nonLiveHomeActivityTypeThree.viewPager;
        if (viewPager22 != null) {
            if ((viewPager22 != null ? viewPager22.getAdapter() : null) == null || (viewPager2 = nonLiveHomeActivityTypeThree.viewPager) == null) {
                return;
            }
            viewPager2.getCurrentItem();
        }
    }

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

    public final void showBadge(boolean isVisible) {
        BadgeDrawable orCreateBadge = getBinding().bottomNavigation.getOrCreateBadge(2131362950);
        Intrinsics.checkNotNullExpressionValue(orCreateBadge, "binding.bottomNavigation…Badge(R.id.fragment_chat)");
        orCreateBadge.setVisible(isVisible);
    }

    public final void handleVideoCallEvents(VideoCallEvent event) {
        VideoDetailModel videoDetailModel;
        if (event.getEvent() == VideoCallEventType.CALL_STARTED) {
            ongoingCallLayout$default(this, false, 1, null);
            return;
        }
        if (event.getEvent() == VideoCallEventType.CALL_ENDED) {
            ongoingCallLayout(true);
            return;
        }
        if (event.getEvent() == VideoCallEventType.CALL_INFO) {
            Timber.i("viewModel.timerSet " + getViewModel().getTimerSet(), new Object[0]);
            if (getViewModel().getTimerSet() || (videoDetailModel = event.getVideoDetailModel()) == null) {
                return;
            }
            getViewModel().setVideoDetails(videoDetailModel);
            getViewModel().setCaller(event.getCaller());
            String startTime = videoDetailModel.getStartTime();
            if (startTime != null) {
                setWindowFlag((Activity) this, 67108864, false);
                Context context = (Context) this;
                getWindow().setStatusBarColor(ContextCompat.getColor(context, 2131100026));
                TextView textView = ((ActivityNonLiveHomeBinding) getBinding()).callerName;
                StreamerModel streamerDetails = videoDetailModel.getStreamerDetails();
                textView.setText(streamerDetails != null ? streamerDetails.getName() : null);
                LinearLayout linearLayout = ((ActivityNonLiveHomeBinding) getBinding()).ongoingCallParent;
                Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.ongoingCallParent");
                linearLayout.setVisibility(0);
                getViewModel().setTimerSet(true);
                getViewModel().setStartTime(DateHelper.convertIsoStringToMills$default(DateHelper.INSTANCE, startTime, null, 2, null));
                ((ActivityNonLiveHomeBinding) getBinding()).timerLeft.setStartTime(getViewModel().getStartTime());
                SharedPref.setString(context, PrefKeys.START_TIME, startTime);
            }
        }
    }

    static void ongoingCallLayout$default(NonLiveHomeActivityTypeThree nonLiveHomeActivityTypeThree, boolean z, int i, Object obj) {
        if ((i & 1) != 0) {
            z = false;
        }
        nonLiveHomeActivityTypeThree.ongoingCallLayout(z);
    }

    private final void ongoingCallLayout(boolean reset) {
        getViewModel().setTimerSet(false);
        getViewModel().setStartTime(-1L);
        if (reset) {
            setWindowFlag((Activity) this, 67108864, false);
            getWindow().setStatusBarColor(ContextCompat.getColor((Context) this, 2131099815));
            LinearLayout linearLayout = ((ActivityNonLiveHomeBinding) getBinding()).ongoingCallParent;
            Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.ongoingCallParent");
            linearLayout.setVisibility(8);
            return;
        }
        setWindowFlag((Activity) this, 67108864, false);
        getWindow().setStatusBarColor(ContextCompat.getColor((Context) this, 2131100026));
        LinearLayout linearLayout2 = ((ActivityNonLiveHomeBinding) getBinding()).ongoingCallParent;
        Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.ongoingCallParent");
        linearLayout2.setVisibility(0);
    }

    @Deprecated(message = "Deprecated in Java")
    public void onBackPressed() {
        ViewPager2 viewPager2 = this.viewPager;
        if (viewPager2 != null) {
            if ((viewPager2 != null ? viewPager2.getAdapter() : null) != null) {
                ViewPager2 viewPager22 = this.viewPager;
                Integer valueOf = viewPager22 != null ? Integer.valueOf(viewPager22.getCurrentItem()) : null;
                if (valueOf != null && valueOf.intValue() == 0) {
                    super.onBackPressed();
                    finish();
                    return;
                }
                if (valueOf != null && valueOf.intValue() == 1) {
                    ViewPager2 viewPager23 = this.viewPager;
                    if (viewPager23 == null) {
                        return;
                    }
                    viewPager23.setCurrentItem(0);
                    return;
                }
                if (valueOf != null && valueOf.intValue() == 2) {
                    ViewPager2 viewPager24 = this.viewPager;
                    if (viewPager24 == null) {
                        return;
                    }
                    viewPager24.setCurrentItem(0);
                    return;
                }
                super.onBackPressed();
                finish();
                return;
            }
        }
        super.onBackPressed();
    }

    private final void checkPermissions() {
        if (Build.VERSION.SDK_INT >= 33) {
            this.requestPermissionLauncher.launch("android.permission.POST_NOTIFICATIONS");
        } else {
            if (permissionArrayGranted(this.PERMISSIONS)) {
                return;
            }
            requestPermissions(this.PERMISSION_REQ_FORWARD);
        }
    }

    private final boolean permissionArrayGranted(String[] permissions) {
        SharedPref.getBoolean((Context) this, PrefKeys.LOCATION_PERMISSION_ASKED);
        if (permissions == null) {
            permissions = this.PERMISSIONS;
        }
        Iterator it = ArrayIteratorKt.iterator(permissions);
        while (it.hasNext()) {
            String str = (String) it.next();
            if (!permissionGranted(str)) {
                Timber.e("Permission not granted " + str, new Object[0]);
                if (!Intrinsics.areEqual(str, "android.permission.ACCESS_COARSE_LOCATION") && !Intrinsics.areEqual(str, "android.permission.ACCESS_FINE_LOCATION")) {
                    return false;
                }
            }
        }
        return true;
    }

    private final boolean permissionGranted(String permission) {
        Timber.e("permission name " + permission, new Object[0]);
        return ContextCompat.checkSelfPermission((Context) this, permission) == 0;
    }

    private final void requestPermissions(int request) {
        ActivityCompat.requestPermissions((Activity) this, this.PERMISSIONS, request);
    }

    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        Intrinsics.checkNotNullParameter(permissions, NativeProtocol.RESULT_ARGS_PERMISSIONS);
        Intrinsics.checkNotNullParameter(grantResults, "grantResults");
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (requestCode == this.PERMISSION_REQ_FORWARD || requestCode == this.PERMISSION_REQ_STAY) {
            boolean permissionArrayGranted = permissionArrayGranted(permissions);
            if ((permissionArrayGranted && requestCode == this.PERMISSION_REQ_FORWARD) || permissionArrayGranted) {
                return;
            }
            toastNeedPermissions();
        }
    }

    private final void toastNeedPermissions() {
        Toast.makeText((Context) this, 2131952354, 1).show();
        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.fromParts("package", getPackageName(), null));
        startActivityForResult(intent, JobPriority.MID);
    }

    @Deprecated(message = "Deprecated in Java")
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 500) {
            checkPermissions();
        } else if (requestCode == this.PERMISSION_NOTIFICATION) {
            checkPermissions();
        }
        InAppUpdate inAppUpdate = this.inAppUpdate;
        if (inAppUpdate != null) {
            inAppUpdate.onActivityResult(requestCode, resultCode, data);
        }
    }

    private final void showUpdateUI(app.callpe.data.model.Metadata metadata) {
        Context context = (Context) this;
        if (metadata.getAppVersion() > Helper.getVersionCode(context) && !metadata.getAppForceUpdate()) {
            ((ActivityNonLiveHomeBinding) getBinding()).viewPager.setPadding(0, 0, 0, Helper.dpToPx(context, 56.0f));
            LinearLayout linearLayout = ((ActivityNonLiveHomeBinding) getBinding()).updateParent;
            Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.updateParent");
            linearLayout.setVisibility(0);
            return;
        }
        LinearLayout linearLayout2 = ((ActivityNonLiveHomeBinding) getBinding()).updateParent;
        Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.updateParent");
        linearLayout2.setVisibility(8);
    }

    @Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0010\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016J\u000e\u0010\u000b\u001a\u00020\b2\u0006\u0010\f\u001a\u00020\nJ\b\u0010\r\u001a\u00020\nH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lapp/callpe/ui/nonliveui/NonLiveHomeActivityTypeThree$ViewPager2Adapter;", "Landroidx/viewpager2/adapter/FragmentStateAdapter;", "fm", "Landroidx/fragment/app/FragmentManager;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "(Landroidx/fragment/app/FragmentManager;Landroidx/lifecycle/Lifecycle;)V", "createFragment", "Landroidx/fragment/app/Fragment;", "position", "", "getItem", "currentItem", "getItemCount", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class ViewPager2Adapter extends FragmentStateAdapter {
        private final FragmentManager fm;

        public int getItemCount() {
            return 3;
        }

        public ViewPager2Adapter(FragmentManager fragmentManager, Lifecycle lifecycle) {
            super(fragmentManager, lifecycle);
            Intrinsics.checkNotNullParameter(fragmentManager, "fm");
            Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
            this.fm = fragmentManager;
        }

        public Fragment createFragment(int position) {
            if (position == 0) {
                return new DiscoverFragment();
            }
            if (position == 1) {
                return new NonLiveChatFragment();
            }
            if (position == 2) {
                return new NonLiveAccountFragmentOne();
            }
            return new UserAccountFragment();
        }

        public final Fragment getItem(int currentItem) {
            Object obj = this.fm.getFragments().get(currentItem);
            Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type androidx.fragment.app.Fragment");
            return (Fragment) obj;
        }
    }

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

    @Override
    protected void onStart() {
        super.onStart();
        LocalBroadcastManager.getInstance((Context) this).registerReceiver(this.receiver, new IntentFilter(app.callpe.common.utils.Constants.NOTIFY));
    }

    protected void onResume() {
        super.onResume();
        LocalBroadcastManager.getInstance((Context) this).registerReceiver(this.receiver, new IntentFilter(app.callpe.common.utils.Constants.NOTIFY));
        InAppUpdate inAppUpdate = this.inAppUpdate;
        if (inAppUpdate != null) {
            inAppUpdate.onResume();
        }
    }

    protected void onPause() {
        super.onPause();
        LocalBroadcastManager.getInstance((Context) this).unregisterReceiver(this.receiver);
    }

    protected void onDestroy() {
        AlertDialog alertDialog = this.alertDialog;
        if (alertDialog != null) {
            alertDialog.dismiss();
        }
        InAppUpdate inAppUpdate = this.inAppUpdate;
        if (inAppUpdate != null) {
            inAppUpdate.onDestroy();
        }
        super.onDestroy();
    }
}