正在查看: Biko v2.0.23 应用的 HomeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 HomeActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.home;
import android.R;
import android.app.Activity;
import android.app.NotificationManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
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.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
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.helper_functions.AdjustAnalyticsHelper;
import app.callpe.common.utils.helper_functions.LocationUtils;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.StreamerModel;
import app.callpe.data.model.User;
import app.callpe.data.model.VideoDetailModel;
import app.callpe.databinding.ActivityHomeBinding;
import app.callpe.db.LocalDB;
import app.callpe.service.ApiService;
import app.callpe.service.jobs.JobPriority;
import app.callpe.ui.SplashActivity;
import app.callpe.ui.bottomsheet.InterestAndLanguage;
import app.callpe.ui.bottomsheet.VerifyNumberSheet;
import app.callpe.ui.call.RtcScreenHandler;
import app.callpe.ui.home.fragments.ChatListFragment;
import app.callpe.ui.home.fragments.GameFragment;
import app.callpe.ui.home.fragments.LiveStreamersFragment;
import app.callpe.ui.home.fragments.NewHomeFragment;
import app.callpe.ui.home.fragments.StreamerListFragment;
import app.callpe.ui.home.fragments.SystemChatListFragment;
import app.callpe.ui.login.LoginActivity;
import com.adjust.sdk.Adjust;
import com.adjust.sdk.Constants;
import com.adjust.sdk.OnDeviceIdsRead;
import com.android.installreferrer.api.InstallReferrerClient;
import com.android.installreferrer.api.InstallReferrerStateListener;
import com.android.installreferrer.api.ReferrerDetails;
import com.bumptech.glide.Glide;
import com.facebook.internal.FacebookRequestErrorClassification;
import com.facebook.internal.NativeProtocol;
import com.google.android.gms.location.LocationRequest;
import com.google.android.material.badge.BadgeDrawable;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
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 javax.inject.Inject;
import kotlin.Deprecated;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
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 = {"\u0000\u008e\u0002\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\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\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\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\b\b\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\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\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\u0006\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\u0014\n\u0002\u0018\u0002\n\u0002\b\n\b\u0007\u0018\u0000 £\u00012\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0004£\u0001¤\u0001B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010S\u001a\u00020TH\u0002J\u0010\u0010U\u001a\u00020 2\u0006\u0010V\u001a\u00020WH\u0003J\b\u0010X\u001a\u00020TH\u0002J\b\u0010Y\u001a\u00020TH\u0002J\b\u0010Z\u001a\u00020TH\u0002J\b\u0010[\u001a\u00020TH\u0002J\b\u0010\\\u001a\u00020TH\u0002J\b\u0010]\u001a\u00020WH\u0002J\u0010\u0010^\u001a\u00020T2\b\b\u0002\u0010_\u001a\u00020 J\b\u0010`\u001a\u00020TH\u0002J\u0010\u0010a\u001a\u00020T2\u0006\u0010b\u001a\u00020cH\u0002J\u0010\u0010d\u001a\u00020T2\u0006\u0010e\u001a\u00020fH\u0002J\u0010\u0010g\u001a\u00020T2\u0006\u0010h\u001a\u00020iH\u0002J\u0010\u0010j\u001a\u00020T2\u0006\u0010k\u001a\u00020lH\u0002J\u0010\u0010m\u001a\u00020\u00022\u0006\u0010n\u001a\u00020oH\u0016J\b\u0010p\u001a\u00020TH\u0002J\b\u0010q\u001a\u00020 H\u0002J\b\u0010r\u001a\u00020TH\u0002J\u0012\u0010s\u001a\u00020T2\b\u0010t\u001a\u0004\u0018\u00010\u0006H\u0002J\b\u0010u\u001a\u00020vH\u0002J\"\u0010w\u001a\u00020T2\u0006\u0010x\u001a\u00020\t2\u0006\u0010y\u001a\u00020\t2\b\u0010z\u001a\u0004\u0018\u00010{H\u0015J\b\u0010|\u001a\u00020TH\u0017J\b\u0010}\u001a\u00020TH\u0002J\u0013\u0010~\u001a\u00020T2\t\u0010\u007f\u001a\u0005\u0018\u00010\u0080\u0001H\u0014J\t\u0010\u0081\u0001\u001a\u00020TH\u0014J\t\u0010\u0082\u0001\u001a\u00020TH\u0014J0\u0010\u0083\u0001\u001a\u00020T2\u0006\u0010x\u001a\u00020\t2\r\u0010\u0084\u0001\u001a\b\u0012\u0004\u0012\u00020\u00060\u00052\b\u0010\u0085\u0001\u001a\u00030\u0086\u0001H\u0016¢\u0006\u0003\u0010\u0087\u0001J\t\u0010\u0088\u0001\u001a\u00020TH\u0014J\t\u0010\u0089\u0001\u001a\u00020TH\u0014J\u0014\u0010\u008a\u0001\u001a\u00020T2\t\b\u0002\u0010\u008b\u0001\u001a\u00020 H\u0002J\t\u0010\u008c\u0001\u001a\u00020TH\u0002J\u0014\u0010\u008d\u0001\u001a\u00020T2\t\b\u0001\u0010\u008e\u0001\u001a\u00020\tH\u0002J\t\u0010\u008f\u0001\u001a\u00020TH\u0002J-\u0010\u0090\u0001\u001a\u00020T2\u0007\u0010\u0091\u0001\u001a\u00020\u00062\u0007\u0010\u0092\u0001\u001a\u00020\u00062\u0007\u0010\u0093\u0001\u001a\u00020\u00062\u0007\u0010\u0094\u0001\u001a\u00020\u0006H\u0002J\t\u0010\u0095\u0001\u001a\u00020TH\u0002J\t\u0010\u0096\u0001\u001a\u00020TH\u0002J\u0010\u0010\u0097\u0001\u001a\u00020T2\u0007\u0010\u0098\u0001\u001a\u00020 J\u0019\u0010\u0099\u0001\u001a\u00020T2\u000e\u0010\u009a\u0001\u001a\t\u0012\u0004\u0012\u00020T0\u009b\u0001H\u0002J\u0011\u0010\u009c\u0001\u001a\u00020T2\u0006\u0010V\u001a\u00020WH\u0003J\u0011\u0010\u009d\u0001\u001a\u00020T2\u0006\u0010b\u001a\u00020cH\u0002J\t\u0010\u009e\u0001\u001a\u00020TH\u0002J\u0011\u0010\u009f\u0001\u001a\u00020T2\u0006\u0010e\u001a\u00020fH\u0002J\u0011\u0010 \u0001\u001a\u00020T2\u0006\u0010b\u001a\u00020cH\u0002J\t\u0010¡\u0001\u001a\u00020TH\u0002J\t\u0010¢\u0001\u001a\u00020TH\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\u001e\u0010\u000e\u001a\u00020\u000f8\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0010\u0010\u0011\"\u0004\b\u0012\u0010\u0013R\u0010\u0010\u0014\u001a\u0004\u0018\u00010\u0015X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0017X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\u0018\u001a\u0004\u0018\u00010\rX\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010\u0019\u001a\u0004\u0018\u00010\u001aX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001b\u0010\u001c\"\u0004\b\u001d\u0010\u001eR\u000e\u0010\u001f\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010!\u001a\u0004\u0018\u00010\"X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010#\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010$\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010%\u001a\u00020&8\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*R\u000e\u0010+\u001a\u00020,X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010-\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010.\u001a\u00020/X\u0082.¢\u0006\u0002\n\u0000R\u000e\u00100\u001a\u000201X\u0082.¢\u0006\u0002\n\u0000R\u000e\u00102\u001a\u000203X\u0082.¢\u0006\u0002\n\u0000R\u000e\u00104\u001a\u000205X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u00106\u001a\u0004\u0018\u000107X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u00108\u001a\u0010\u0012\f\u0012\n :*\u0004\u0018\u00010\u00060\u0006098\u0002X\u0083\u0004¢\u0006\u0002\n\u0000R\u000e\u0010;\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010<\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010=\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010>\u001a\u00020?X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010@\u001a\u00020AX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010B\u001a\u00020 X\u0082\u000e¢\u0006\u0002\n\u0000R$\u0010C\u001a\u00020\u00068\u0006@\u0006X\u0087.¢\u0006\u0014\n\u0000\u0012\u0004\bD\u0010\u0003\u001a\u0004\bE\u0010F\"\u0004\bG\u0010HR\u0010\u0010I\u001a\u0004\u0018\u00010JX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010K\u001a\u00020L8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bO\u0010P\u001a\u0004\bM\u0010NR\u0010\u0010Q\u001a\u0004\u0018\u00010RX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006¥\u0001"}, d2 = {"Lapp/callpe/ui/home/HomeActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityHomeBinding;", "()V", "PERMISSIONS", "", "", "[Ljava/lang/String;", "PERMISSION_NOTIFICATION", "", "PERMISSION_REQ_FORWARD", "PERMISSION_REQ_STAY", "alertDialog", "Landroidx/appcompat/app/AlertDialog;", "apiService", "Lapp/callpe/service/ApiService;", "getApiService", "()Lapp/callpe/service/ApiService;", "setApiService", "(Lapp/callpe/service/ApiService;)V", "bottomSheetFragment", "Lapp/callpe/ui/bottomsheet/InterestAndLanguage;", "drawer", "Landroidx/drawerlayout/widget/DrawerLayout;", "fullScreenIntentDialog", "handler", "Landroid/os/Handler;", "getHandler", "()Landroid/os/Handler;", "setHandler", "(Landroid/os/Handler;)V", "hideFakeTab", "", "inAppUpdate", "Lapp/callpe/common/utils/InAppUpdate;", "isLive", "liveStreaming", "localDB", "Lapp/callpe/db/LocalDB;", "getLocalDB", "()Lapp/callpe/db/LocalDB;", "setLocalDB", "(Lapp/callpe/db/LocalDB;)V", "locationManager", "Landroid/location/LocationManager;", "locationPermissionAlreadyAsked", "locationRequest", "Lcom/google/android/gms/location/LocationRequest;", "mViewPagerAdapter", "Lapp/callpe/ui/home/HomeActivity$ViewPager2Adapter;", "navigationView", "Lcom/google/android/material/navigation/NavigationView;", "receiver", "Landroid/content/BroadcastReceiver;", "referrerClient", "Lcom/android/installreferrer/api/InstallReferrerClient;", "requestPermissionLauncher", "Landroidx/activity/result/ActivityResultLauncher;", "kotlin.jvm.PlatformType", "response", "showGameTab", "threePicUI", "toggle", "Lapp/callpe/common/utils/badgeMenu/BadgeDrawerToggle;", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "updateLanguage", "userId", "getUserId$annotations", "getUserId", "()Ljava/lang/String;", "setUserId", "(Ljava/lang/String;)V", "verifyNumberFragment", "Lapp/callpe/ui/bottomsheet/VerifyNumberSheet;", "viewModel", "Lapp/callpe/ui/home/HomeViewModel;", "getViewModel", "()Lapp/callpe/ui/home/HomeViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "viewPager", "Landroidx/viewpager2/widget/ViewPager2;", "askLocationPermission", "", "canUseFullScreenIntentCheck", "context", "Landroid/content/Context;", "checkForFSI", "checkForNavUpdate", "checkNotificationPermission", "fetchAdjustMarketingId", "fetchLocation", "getContext", "getMetaData", "onlyMetaData", "handleFsiPermissionGiven", "handlePopUp", "user", "Lapp/callpe/data/model/User;", "handleRandomCallBtnInFragments", "metadata", "Lapp/callpe/data/model/Metadata;", "handleVideoCallEvents", "event", "Lapp/callpe/common/agora/VideoCallEvent;", "hideNotificationView", "notif_cv", "Landroidx/cardview/widget/CardView;", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initViews", "isNewUiAppOrPaymentModeOn", "isStreamerApp", "makeReferrerApiCall", "installSource", "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", Constants.REFERRER, "setFabText", "text", "setNav", "setNotificationValues", "senderImage", "senderName", "message", "messageType", "setUpNavigation", "setUpOdioNavigation", "showBadge", "isVisible", "showExitDialog", "onBackPress", "Lkotlin/Function0;", "showFullScreenNotificationPermissionDialog", "showLanguageAddPopUp", "showNotificationView", "showUpdateUI", "showVerifyOTPPopUp", "toastNeedPermissions", "updateLanguageList", "Companion", "ViewPager2Adapter", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class HomeActivity extends BaseActivity<ActivityHomeBinding> {
public static final Companion INSTANCE = new Companion(null);
private static boolean appOpenForLanguage;
private static boolean appOpenForOTP;
private static boolean referrerCalled;
private String[] PERMISSIONS;
private final int PERMISSION_NOTIFICATION;
private final int PERMISSION_REQ_FORWARD;
private final int PERMISSION_REQ_STAY;
private AlertDialog alertDialog;
@Inject
public ApiService apiService;
private InterestAndLanguage bottomSheetFragment;
private DrawerLayout drawer;
private AlertDialog fullScreenIntentDialog;
private Handler handler;
private InAppUpdate inAppUpdate;
private boolean isLive;
private boolean liveStreaming;
@Inject
public LocalDB localDB;
private LocationManager locationManager;
private boolean locationPermissionAlreadyAsked;
private LocationRequest locationRequest;
private ViewPager2Adapter mViewPagerAdapter;
private NavigationView navigationView;
private final BroadcastReceiver receiver;
private InstallReferrerClient referrerClient;
private final ActivityResultLauncher<String> requestPermissionLauncher;
private boolean showGameTab;
private boolean threePicUI;
private BadgeDrawerToggle toggle;
private Toolbar toolbar;
private boolean updateLanguage;
@Inject
public String userId;
private VerifyNumberSheet verifyNumberFragment;
private final Lazy viewModel;
private ViewPager2 viewPager;
private String response = "";
private boolean hideFakeTab = true;
public static void getUserId$annotations() {
}
public HomeActivity() {
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 m1365invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m1364invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m1366invoke() {
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) {
HomeActivity.requestPermissionLauncher$lambda$0(((Boolean) obj).booleanValue());
}
});
Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul…inish()*/\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.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"};
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 = HomeActivity.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;
}
HomeActivity.this.showNotificationView();
HomeActivity.this.setNotificationValues(stringExtra, stringExtra2, stringExtra3, stringExtra4);
}
}
};
}
public final ApiService getApiService() {
ApiService apiService = this.apiService;
if (apiService != null) {
return apiService;
}
Intrinsics.throwUninitializedPropertyAccessException("apiService");
return null;
}
public final void setApiService(ApiService apiService) {
Intrinsics.checkNotNullParameter(apiService, "<set-?>");
this.apiService = apiService;
}
public final LocalDB getLocalDB() {
LocalDB localDB = this.localDB;
if (localDB != null) {
return localDB;
}
Intrinsics.throwUninitializedPropertyAccessException("localDB");
return null;
}
public final void setLocalDB(LocalDB localDB) {
Intrinsics.checkNotNullParameter(localDB, "<set-?>");
this.localDB = localDB;
}
public final String getUserId() {
String str = this.userId;
if (str != null) {
return str;
}
Intrinsics.throwUninitializedPropertyAccessException("userId");
return null;
}
public final void setUserId(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.userId = str;
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u000b\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\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\n\u0010\u0006\"\u0004\b\u000b\u0010\bR\u001a\u0010\f\u001a\u00020\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u0006\"\u0004\b\u000e\u0010\b¨\u0006\u000f"}, d2 = {"Lapp/callpe/ui/home/HomeActivity$Companion;", "", "()V", "appOpenForLanguage", "", "getAppOpenForLanguage", "()Z", "setAppOpenForLanguage", "(Z)V", "appOpenForOTP", "getAppOpenForOTP", "setAppOpenForOTP", "referrerCalled", "getReferrerCalled", "setReferrerCalled", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final boolean getAppOpenForOTP() {
return HomeActivity.appOpenForOTP;
}
public final void setAppOpenForOTP(boolean z) {
HomeActivity.appOpenForOTP = z;
}
public final boolean getAppOpenForLanguage() {
return HomeActivity.appOpenForLanguage;
}
public final void setAppOpenForLanguage(boolean z) {
HomeActivity.appOpenForLanguage = z;
}
public final boolean getReferrerCalled() {
return HomeActivity.referrerCalled;
}
public final void setReferrerCalled(boolean z) {
HomeActivity.referrerCalled = z;
}
}
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$0(boolean z) {
if (z) {
Timber.d("Permission granted", new Object[0]);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Object systemService = getSystemService("location");
Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.location.LocationManager");
this.locationManager = (LocationManager) systemService;
checkForFSI();
isStreamerApp();
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.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"};
} else if (Build.VERSION.SDK_INT >= 33) {
this.PERMISSIONS = new String[]{"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"};
}
LocalBroadcastManager.getInstance(context).registerReceiver(this.receiver, new IntentFilter(app.callpe.common.utils.Constants.NOTIFY));
this.inAppUpdate = new InAppUpdate(activity);
initViews();
checkNotificationPermission();
observeEvent();
setNav();
setUpNavigation();
setUpOdioNavigation();
onClicks();
getViewModel().getUserDetails();
getViewModel().getReviewTags();
getViewModel().observeCallEvents();
getViewModel().getBonus(context);
getViewModel().setVip(SharedPref.getBoolean(context, PrefKeys.IS_VIP));
fetchAdjustMarketingId();
askLocationPermission();
AdjustAnalyticsHelper.INSTANCE.setUserIdToAnalytics(context, getUserId());
Log.d("UserId Main", getUserId());
}
private final void askLocationPermission() {
if (SharedPref.getBoolean((Context) this, PrefKeys.NEVER_ASK_GPS, false)) {
fetchLocation();
} else {
if (this.locationPermissionAlreadyAsked) {
return;
}
LocationUtils.INSTANCE.showPermissionRationaleDialog(false, (Activity) this, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m1367invoke();
return Unit.INSTANCE;
}
public final void m1367invoke() {
HomeActivity.this.fetchLocation();
}
});
this.locationPermissionAlreadyAsked = true;
}
}
public final void makeReferrerApiCall(String installSource) {
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new HomeActivity$makeReferrerApiCall$1(installSource, this, null), 3, (Object) null);
}
private final void isStreamerApp() {
if (LoginActivity.INSTANCE.isVitok()) {
Intent intent = new Intent((Context) this, (Class<?>) SplashActivity.class);
intent.addFlags(268468224);
startActivity(intent);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
}
private final void referrer() {
try {
String string = SharedPref.getString((Context) this, PrefKeys.REFERRER);
if (string == null) {
string = "";
}
if (string.length() == 0) {
InstallReferrerClient build = InstallReferrerClient.newBuilder((Context) this).build();
this.referrerClient = build;
if (build != null) {
build.startConnection(new InstallReferrerStateListener() {
@Override
public void onInstallReferrerSetupFinished(int responseCode) {
InstallReferrerClient installReferrerClient;
ReferrerDetails installReferrer;
HomeViewModel viewModel;
if (responseCode != 0) {
if (responseCode == 1) {
Timber.e("Fail to establish connection", new Object[0]);
return;
} else {
if (responseCode != 2) {
return;
}
Timber.e("Feature not supported..", new Object[0]);
return;
}
}
try {
installReferrerClient = HomeActivity.this.referrerClient;
if (installReferrerClient != null && (installReferrer = installReferrerClient.getInstallReferrer()) != null) {
String installReferrer2 = installReferrer.getInstallReferrer();
SharedPref.setString((Context) HomeActivity.this, PrefKeys.REFERRER, installReferrer2);
Timber.e("referrer " + installReferrer2, new Object[0]);
viewModel = HomeActivity.this.getViewModel();
Intrinsics.checkNotNullExpressionValue(installReferrer2, "referrerUrl");
viewModel.sendReferrer(installReferrer2);
}
} catch (Exception e) {
Timber.e(e);
}
}
@Override
public void onInstallReferrerServiceDisconnected() {
Timber.e("Service disconnected..", new Object[0]);
}
});
}
} else {
getViewModel().sendReferrer(string);
}
} catch (Exception e) {
Timber.e(e);
}
}
private final void fetchAdjustMarketingId() {
if (AdjustAnalyticsHelper.INSTANCE.isAdjustSdkEnabled()) {
Context context = (Context) this;
String string = SharedPref.getString(context, PrefKeys.ADJUST_ADVERTISEMENT_ID);
final String string2 = SharedPref.getString(context, PrefKeys.ADJUST_ADID);
String str = string;
if (!(str == null || str.length() == 0)) {
String str2 = string2;
if (!(str2 == null || str2.length() == 0)) {
return;
}
}
Adjust.getGoogleAdId(getApplicationContext(), new OnDeviceIdsRead() {
@Override
public final void onGoogleAdIdRead(String str3) {
HomeActivity.fetchAdjustMarketingId$lambda$3(HomeActivity.this, string2, str3);
}
});
}
}
public static final void fetchAdjustMarketingId$lambda$3(HomeActivity homeActivity, String str, String str2) {
Unit unit;
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
String adid = Adjust.getAdid();
Timber.i("ADVERTISING ADJUST ID " + adid, new Object[0]);
if (str2 != null) {
if (Intrinsics.areEqual(str2, "00000000-0000-0000-0000-000000000000")) {
String str3 = adid;
if (!(str3 == null || str3.length() == 0)) {
String str4 = str;
if (str4 == null || str4.length() == 0) {
homeActivity.getViewModel().sendAdjustMarketingId(null, adid, (Context) homeActivity);
}
}
} else {
homeActivity.getViewModel().sendAdjustMarketingId(str2, adid, (Context) homeActivity);
Timber.i("ADVERTISING ID " + str2, new Object[0]);
}
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
String str5 = adid;
if (str5 == null || str5.length() == 0) {
return;
}
homeActivity.getViewModel().sendAdjustMarketingId(null, adid, (Context) homeActivity);
}
}
public final void showNotificationView() {
final CardView findViewById = findViewById(2131363921);
findViewById.setVisibility(0);
ChatListFragment.refreshScreen = true;
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() {
HomeActivity.showNotificationView$lambda$4(HomeActivity.this, findViewById);
}
}, 3000L);
}
public static final void showNotificationView$lambda$4(HomeActivity homeActivity, CardView cardView) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
Intrinsics.checkNotNullExpressionValue(cardView, "notificationCv");
homeActivity.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) {
HomeActivity.onClicks$lambda$5(HomeActivity.this, findViewById, view);
}
});
getBinding().ongoingCallParent.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeActivity.onClicks$lambda$8(HomeActivity.this, view);
}
});
getBinding().updateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeActivity.onClicks$lambda$9(HomeActivity.this, view);
}
});
}
public static final void onClicks$lambda$5(HomeActivity homeActivity, CardView cardView, View view) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
ViewPager2 viewPager2 = homeActivity.getBinding().viewPager;
Intrinsics.checkNotNullExpressionValue(viewPager2, "binding.viewPager");
if (LoginActivity.INSTANCE.isNewUIApp()) {
if (homeActivity.liveStreaming) {
viewPager2.setCurrentItem(2);
} else {
viewPager2.setCurrentItem(1);
}
} else if (homeActivity.liveStreaming) {
viewPager2.setCurrentItem(2);
} else {
viewPager2.setCurrentItem(1);
}
cardView.setVisibility(8);
Handler handler = homeActivity.handler;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
}
public static final void onClicks$lambda$8(HomeActivity homeActivity, View view) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
VideoDetailModel videoDetails = homeActivity.getViewModel().getVideoDetails();
if (videoDetails != null) {
Context applicationContext = homeActivity.getApplicationContext();
Intrinsics.checkNotNullExpressionValue(applicationContext, "applicationContext");
Intent rtcScreenIntent = RtcScreenHandler.getRtcScreenIntent(applicationContext, RtcScreenHandler.getRtcScreenType$default(null, 1, null));
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.FROM_NOTIFICATION_CLICK, !App.Companion.isVideoCallScreen());
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.KEY_CALLING_CHANNEL, videoDetails.getAgoraChannelName());
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.KEY_CALLING_VIDEO_ID, videoDetails.getId());
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.KEY_AGORA_ACCESS_TOKEN, videoDetails.getAgoraUserToken());
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.KEY_CALLER, homeActivity.getViewModel().getCaller());
String callType = videoDetails.getCallType();
if (callType != null && Intrinsics.areEqual(callType, "AUDIO")) {
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.KEY_CALL_TYPE, "AUDIO");
}
rtcScreenIntent.putExtra(app.callpe.common.utils.Constants.FCM_DATA, new Gson().toJson(videoDetails));
homeActivity.startActivity(rtcScreenIntent);
}
}
public static final void onClicks$lambda$9(HomeActivity homeActivity, View view) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
try {
String string = homeActivity.getString(2131951676);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_package)");
try {
homeActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
} catch (ActivityNotFoundException unused) {
homeActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
}
} catch (Exception unused2) {
}
}
private final void initViews() {
DrawerLayout drawerLayout = getBinding().newHomeDrawerLayout;
Intrinsics.checkNotNullExpressionValue(drawerLayout, "binding.newHomeDrawerLayout");
this.drawer = drawerLayout;
NavigationView navigationView = getBinding().newHomeNavView;
Intrinsics.checkNotNullExpressionValue(navigationView, "binding.newHomeNavView");
this.navigationView = navigationView;
Toolbar toolbar = getBinding().toolbar;
Intrinsics.checkNotNullExpressionValue(toolbar, "binding.toolbar");
this.toolbar = toolbar;
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new HomeActivity$observeEvent$1(this, null), 3, (Object) null);
}
public final void handleRandomCallBtnInFragments(app.callpe.data.model.Metadata metadata) {
try {
for (Fragment fragment : getSupportFragmentManager().getFragments()) {
if (fragment instanceof NewHomeFragment) {
((NewHomeFragment) fragment).handleRandomCallBtnInFragments(metadata);
}
}
} catch (Exception e) {
Timber.e("Error: " + e, new Object[0]);
}
}
public final void handlePopUp(User user) {
user.getLanguages().isEmpty();
if (this.updateLanguage) {
this.updateLanguage = false;
SharedPref.saveStrings((Context) this, PrefKeys.USER_LANGUAGES, user.selectedLanguages());
}
}
private final void setNav() {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity.setNav():void");
}
public static final boolean setNav$lambda$10(HomeActivity homeActivity, MenuItem menuItem) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
Intrinsics.checkNotNullParameter(menuItem, "item");
int itemId = menuItem.getItemId();
DrawerLayout drawerLayout = homeActivity.drawer;
if (drawerLayout == null) {
Intrinsics.throwUninitializedPropertyAccessException("drawer");
drawerLayout = null;
}
drawerLayout.closeDrawer(8388611);
if (itemId != 2131363847) {
return true;
}
homeActivity.getViewModel().signOut(homeActivity.getContext());
return true;
}
private final void setUpOdioNavigation() {
if (LoginActivity.INSTANCE.isOdioApps()) {
boolean z = this.liveStreaming;
if (z && this.showGameTab) {
View view = getBinding().bottomNavigationOdioWithLivePlusGame;
Intrinsics.checkNotNullExpressionValue(view, "binding.bottomNavigationOdioWithLivePlusGame");
view.setVisibility(0);
View view2 = getBinding().bottomNavigationOdioWithLive;
Intrinsics.checkNotNullExpressionValue(view2, "binding.bottomNavigationOdioWithLive");
view2.setVisibility(8);
View view3 = getBinding().bottomNavigationOdioWithGame;
Intrinsics.checkNotNullExpressionValue(view3, "binding.bottomNavigationOdioWithGame");
view3.setVisibility(8);
View view4 = getBinding().bottomNavigationOdio;
Intrinsics.checkNotNullExpressionValue(view4, "binding.bottomNavigationOdio");
view4.setVisibility(8);
View view5 = getBinding().bottomNavigation;
Intrinsics.checkNotNullExpressionValue(view5, "binding.bottomNavigation");
view5.setVisibility(8);
} else if (z) {
View view6 = getBinding().bottomNavigationOdioWithLivePlusGame;
Intrinsics.checkNotNullExpressionValue(view6, "binding.bottomNavigationOdioWithLivePlusGame");
view6.setVisibility(8);
View view7 = getBinding().bottomNavigationOdioWithLive;
Intrinsics.checkNotNullExpressionValue(view7, "binding.bottomNavigationOdioWithLive");
view7.setVisibility(0);
View view8 = getBinding().bottomNavigationOdioWithGame;
Intrinsics.checkNotNullExpressionValue(view8, "binding.bottomNavigationOdioWithGame");
view8.setVisibility(8);
View view9 = getBinding().bottomNavigationOdio;
Intrinsics.checkNotNullExpressionValue(view9, "binding.bottomNavigationOdio");
view9.setVisibility(8);
View view10 = getBinding().bottomNavigation;
Intrinsics.checkNotNullExpressionValue(view10, "binding.bottomNavigation");
view10.setVisibility(8);
} else if (this.showGameTab) {
View view11 = getBinding().bottomNavigationOdioWithLivePlusGame;
Intrinsics.checkNotNullExpressionValue(view11, "binding.bottomNavigationOdioWithLivePlusGame");
view11.setVisibility(8);
View view12 = getBinding().bottomNavigationOdioWithLive;
Intrinsics.checkNotNullExpressionValue(view12, "binding.bottomNavigationOdioWithLive");
view12.setVisibility(8);
View view13 = getBinding().bottomNavigationOdioWithGame;
Intrinsics.checkNotNullExpressionValue(view13, "binding.bottomNavigationOdioWithGame");
view13.setVisibility(0);
View view14 = getBinding().bottomNavigationOdio;
Intrinsics.checkNotNullExpressionValue(view14, "binding.bottomNavigationOdio");
view14.setVisibility(8);
View view15 = getBinding().bottomNavigation;
Intrinsics.checkNotNullExpressionValue(view15, "binding.bottomNavigation");
view15.setVisibility(8);
} else {
View view16 = getBinding().bottomNavigationOdioWithLivePlusGame;
Intrinsics.checkNotNullExpressionValue(view16, "binding.bottomNavigationOdioWithLivePlusGame");
view16.setVisibility(8);
View view17 = getBinding().bottomNavigationOdioWithLive;
Intrinsics.checkNotNullExpressionValue(view17, "binding.bottomNavigationOdioWithLive");
view17.setVisibility(8);
View view18 = getBinding().bottomNavigationOdioWithGame;
Intrinsics.checkNotNullExpressionValue(view18, "binding.bottomNavigationOdioWithGame");
view18.setVisibility(8);
View view19 = getBinding().bottomNavigationOdio;
Intrinsics.checkNotNullExpressionValue(view19, "binding.bottomNavigationOdio");
view19.setVisibility(0);
View view20 = getBinding().bottomNavigation;
Intrinsics.checkNotNullExpressionValue(view20, "binding.bottomNavigation");
view20.setVisibility(8);
}
} else {
View view21 = getBinding().bottomNavigationOdioWithLivePlusGame;
Intrinsics.checkNotNullExpressionValue(view21, "binding.bottomNavigationOdioWithLivePlusGame");
view21.setVisibility(8);
View view22 = getBinding().bottomNavigationOdioWithLive;
Intrinsics.checkNotNullExpressionValue(view22, "binding.bottomNavigationOdioWithLive");
view22.setVisibility(8);
View view23 = getBinding().bottomNavigationOdioWithGame;
Intrinsics.checkNotNullExpressionValue(view23, "binding.bottomNavigationOdioWithGame");
view23.setVisibility(8);
View view24 = getBinding().bottomNavigationOdio;
Intrinsics.checkNotNullExpressionValue(view24, "binding.bottomNavigationOdio");
view24.setVisibility(8);
View view25 = getBinding().bottomNavigation;
Intrinsics.checkNotNullExpressionValue(view25, "binding.bottomNavigation");
view25.setVisibility(0);
}
getBinding().bottomNavigationOdio.setOnItemSelected(new Function1<Integer, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke(((Number) obj).intValue());
return Unit.INSTANCE;
}
public final void invoke(int r2) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity$setUpOdioNavigation$1.invoke(int):void");
}
});
getBinding().bottomNavigationOdioWithLivePlusGame.setOnItemSelected(new Function1<Integer, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke(((Number) obj).intValue());
return Unit.INSTANCE;
}
public final void invoke(int r2) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity$setUpOdioNavigation$2.invoke(int):void");
}
});
getBinding().bottomNavigationOdioWithLive.setOnItemSelected(new Function1<Integer, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke(((Number) obj).intValue());
return Unit.INSTANCE;
}
public final void invoke(int r2) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity$setUpOdioNavigation$3.invoke(int):void");
}
});
getBinding().bottomNavigationOdioWithGame.setOnItemSelected(new Function1<Integer, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke(((Number) obj).intValue());
return Unit.INSTANCE;
}
public final void invoke(int r2) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity$setUpOdioNavigation$4.invoke(int):void");
}
});
}
private final void setUpNavigation() {
this.hideFakeTab = true;
Context context = (Context) this;
this.threePicUI = SharedPref.getBoolean(context, PrefKeys.THREE_PIC_UI);
this.liveStreaming = SharedPref.getBoolean(context, PrefKeys.LIVE_STREAMING);
this.isLive = SharedPref.getBoolean(context, PrefKeys.IS_LIVE);
this.showGameTab = SharedPref.getBoolean(context, PrefKeys.SHOW_GAMES) && this.isLive;
if (LoginActivity.INSTANCE.isNewUIApp()) {
((ActivityHomeBinding) getBinding()).bottomNavigation.getMenu().clear();
((ActivityHomeBinding) getBinding()).bottomNavigation.inflateMenu(2131689484);
if (!this.liveStreaming) {
((ActivityHomeBinding) getBinding()).bottomNavigation.getMenu().findItem(2131362960).setVisible(false);
}
((ActivityHomeBinding) getBinding()).bottomNavigation.getMenu().findItem(2131362956).setVisible(this.showGameTab);
} else {
((ActivityHomeBinding) getBinding()).bottomNavigation.getMenu().findItem(2131362960).setVisible(this.liveStreaming);
((ActivityHomeBinding) getBinding()).bottomNavigation.getMenu().findItem(2131362956).setVisible(this.showGameTab);
}
this.viewPager = ((ActivityHomeBinding) getBinding()).viewPager;
boolean z = this.liveStreaming;
boolean z2 = this.showGameTab;
boolean z3 = this.isLive;
FragmentManager supportFragmentManager = getSupportFragmentManager();
Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "supportFragmentManager");
Lifecycle lifecycle = getLifecycle();
Intrinsics.checkNotNullExpressionValue(lifecycle, "lifecycle");
RecyclerView.Adapter viewPager2Adapter = new ViewPager2Adapter(z, z2, z3, 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);
}
((ActivityHomeBinding) getBinding()).bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
public final boolean onNavigationItemSelected(MenuItem menuItem) {
boolean upNavigation$lambda$11;
upNavigation$lambda$11 = HomeActivity.setUpNavigation$lambda$11(HomeActivity.this, menuItem);
return upNavigation$lambda$11;
}
});
ViewPager2 viewPager24 = this.viewPager;
if (viewPager24 != null) {
viewPager24.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
public void onPageSelected(int r13) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.home.HomeActivity$setUpNavigation$2.onPageSelected(int):void");
}
});
}
((ActivityHomeBinding) getBinding()).fab.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeActivity.setUpNavigation$lambda$12(HomeActivity.this, view);
}
});
}
public static final boolean setUpNavigation$lambda$11(HomeActivity homeActivity, MenuItem menuItem) {
ViewPager2 viewPager2;
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
Intrinsics.checkNotNullParameter(menuItem, "item");
boolean z = homeActivity.liveStreaming;
if (z && homeActivity.showGameTab) {
switch (menuItem.getItemId()) {
case 2131362948:
ViewPager2 viewPager22 = homeActivity.viewPager;
if (viewPager22 != null) {
viewPager22.setCurrentItem(4);
break;
}
break;
case 2131362950:
ViewPager2 viewPager23 = homeActivity.viewPager;
if (viewPager23 != null) {
viewPager23.setCurrentItem(2);
break;
}
break;
case 2131362956:
ViewPager2 viewPager24 = homeActivity.viewPager;
if (viewPager24 != null) {
viewPager24.setCurrentItem(3);
break;
}
break;
case 2131362958:
ViewPager2 viewPager25 = homeActivity.viewPager;
if (viewPager25 != null) {
viewPager25.setCurrentItem(0);
break;
}
break;
case 2131362960:
ViewPager2 viewPager26 = homeActivity.viewPager;
if (viewPager26 != null) {
viewPager26.setCurrentItem(1);
break;
}
break;
}
} else if (homeActivity.showGameTab) {
switch (menuItem.getItemId()) {
case 2131362948:
ViewPager2 viewPager27 = homeActivity.viewPager;
if (viewPager27 != null) {
viewPager27.setCurrentItem(3);
break;
}
break;
case 2131362950:
ViewPager2 viewPager28 = homeActivity.viewPager;
if (viewPager28 != null) {
viewPager28.setCurrentItem(1);
break;
}
break;
case 2131362956:
ViewPager2 viewPager29 = homeActivity.viewPager;
if (viewPager29 != null) {
viewPager29.setCurrentItem(2);
break;
}
break;
case 2131362958:
ViewPager2 viewPager210 = homeActivity.viewPager;
if (viewPager210 != null) {
viewPager210.setCurrentItem(0);
break;
}
break;
}
} else if (z) {
switch (menuItem.getItemId()) {
case 2131362948:
ViewPager2 viewPager211 = homeActivity.viewPager;
if (viewPager211 != null) {
viewPager211.setCurrentItem(3);
break;
}
break;
case 2131362950:
ViewPager2 viewPager212 = homeActivity.viewPager;
if (viewPager212 != null) {
viewPager212.setCurrentItem(2);
break;
}
break;
case 2131362958:
ViewPager2 viewPager213 = homeActivity.viewPager;
if (viewPager213 != null) {
viewPager213.setCurrentItem(0);
break;
}
break;
case 2131362960:
ViewPager2 viewPager214 = homeActivity.viewPager;
if (viewPager214 != null) {
viewPager214.setCurrentItem(1);
break;
}
break;
}
} else {
int itemId = menuItem.getItemId();
if (itemId == 2131362948) {
ViewPager2 viewPager215 = homeActivity.viewPager;
if (viewPager215 != null) {
viewPager215.setCurrentItem(2);
}
} else if (itemId == 2131362950) {
ViewPager2 viewPager216 = homeActivity.viewPager;
if (viewPager216 != null) {
viewPager216.setCurrentItem(1);
}
} else if (itemId == 2131362958 && (viewPager2 = homeActivity.viewPager) != null) {
viewPager2.setCurrentItem(0);
}
}
return true;
}
public static final void setUpNavigation$lambda$12(HomeActivity homeActivity, View view) {
ViewPager2 viewPager2;
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
ViewPager2 viewPager22 = homeActivity.viewPager;
if (viewPager22 != null) {
if ((viewPager22 != null ? viewPager22.getAdapter() : null) == null || (viewPager2 = homeActivity.viewPager) == null) {
return;
}
viewPager2.getCurrentItem();
}
}
public static void getMetaData$default(HomeActivity homeActivity, boolean z, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
homeActivity.getMetaData(z);
}
public final void getMetaData(boolean onlyMetaData) {
if (onlyMetaData) {
getViewModel().getUserDetails();
} else {
getViewModel().getUserDetails();
getViewModel().getUserUnUsedCards();
}
}
private final Context getContext() {
return (Context) this;
}
private final void setFabText(int text) {
getBinding().fab.setText(text);
if (getBinding().fab.isExtended()) {
return;
}
getBinding().fab.extend();
}
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 = ((ActivityHomeBinding) getBinding()).callerName;
StreamerModel streamerDetails = videoDetailModel.getStreamerDetails();
textView.setText(streamerDetails != null ? streamerDetails.getName() : null);
LinearLayout linearLayout = ((ActivityHomeBinding) getBinding()).ongoingCallParent;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.ongoingCallParent");
linearLayout.setVisibility(0);
getViewModel().setTimerSet(true);
getViewModel().setStartTime(DateHelper.convertIsoStringToMills$default(DateHelper.INSTANCE, startTime, null, 2, null));
((ActivityHomeBinding) getBinding()).timerLeft.setStartTime(getViewModel().getStartTime());
SharedPref.setString(context, PrefKeys.START_TIME, startTime);
}
}
}
static void ongoingCallLayout$default(HomeActivity homeActivity, boolean z, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
homeActivity.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 = ((ActivityHomeBinding) 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 = ((ActivityHomeBinding) 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;
if (viewPager22 != null && viewPager22.getCurrentItem() == 0) {
showExitDialog(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m1369invoke();
return Unit.INSTANCE;
}
public final void m1369invoke() {
super/*app.callpe.ui.home.Hilt_HomeActivity*/.onBackPressed();
HomeActivity.this.finish();
}
});
return;
}
ViewPager2 viewPager23 = this.viewPager;
if (viewPager23 != null) {
viewPager23.setCurrentItem(0);
}
getBinding().bottomNavigationOdio.setItemActiveIndex(0);
getBinding().bottomNavigationOdioWithLivePlusGame.setItemActiveIndex(0);
getBinding().bottomNavigationOdioWithLive.setItemActiveIndex(0);
getBinding().bottomNavigationOdioWithGame.setItemActiveIndex(0);
return;
}
}
showExitDialog(new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m1370invoke();
return Unit.INSTANCE;
}
public final void m1370invoke() {
super/*app.callpe.ui.home.Hilt_HomeActivity*/.onBackPressed();
}
});
}
private final void showExitDialog(final Function0<Unit> onBackPress) {
try {
MaterialAlertDialogBuilder materialAlertDialogBuilder = new MaterialAlertDialogBuilder((Context) this);
materialAlertDialogBuilder.setMessage("Are you sure you want to close app?").setPositiveButton(getString(2131953093), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
HomeActivity.showExitDialog$lambda$15(onBackPress, dialogInterface, i);
}
}).setNegativeButton(getString(2131952360), new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
HomeActivity.showExitDialog$lambda$16(dialogInterface, i);
}
}).create();
this.alertDialog = materialAlertDialogBuilder.show();
} catch (Exception e) {
Timber.e(e);
onBackPress.invoke();
}
}
public static final void showExitDialog$lambda$15(Function0 function0, DialogInterface dialogInterface, int i) {
Intrinsics.checkNotNullParameter(function0, "$onBackPress");
if (dialogInterface != null) {
dialogInterface.dismiss();
}
function0.invoke();
}
public static final void showExitDialog$lambda$16(DialogInterface dialogInterface, int i) {
Intrinsics.checkNotNullParameter(dialogInterface, "dialogInterface");
dialogInterface.dismiss();
}
private final void checkNotificationPermission() {
if (Build.VERSION.SDK_INT >= 33) {
this.requestPermissionLauncher.launch("android.permission.POST_NOTIFICATIONS");
}
}
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 == 100123) {
boolean z = false;
if (!(grantResults.length == 0)) {
int length = grantResults.length;
int i = 0;
while (true) {
if (i >= length) {
z = true;
break;
} else {
if (!(grantResults[i] == 0)) {
break;
} else {
i++;
}
}
}
if (z) {
fetchLocation();
return;
}
}
fetchLocation();
}
}
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);
LocationUtils.INSTANCE.handleActivityResult((Activity) this, requestCode, resultCode, data, true, new Function0<Unit>() {
{
super(0);
}
public Object invoke() {
m1368invoke();
return Unit.INSTANCE;
}
public final void m1368invoke() {
HomeActivity.this.fetchLocation();
}
});
if (requestCode == 500) {
checkNotificationPermission();
} else if (requestCode == this.PERMISSION_NOTIFICATION) {
checkNotificationPermission();
}
InAppUpdate inAppUpdate = this.inAppUpdate;
if (inAppUpdate != null) {
inAppUpdate.onActivityResult(requestCode, resultCode, data);
}
}
public final void showUpdateUI(app.callpe.data.model.Metadata metadata) {
Context context = (Context) this;
if (metadata.getAppVersion() > Helper.getVersionCode(context) && !metadata.getAppForceUpdate()) {
((ActivityHomeBinding) getBinding()).viewPager.setPadding(0, 0, 0, Helper.dpToPx(context, 56.0f));
LinearLayout linearLayout = ((ActivityHomeBinding) getBinding()).updateParent;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.updateParent");
linearLayout.setVisibility(0);
return;
}
LinearLayout linearLayout2 = ((ActivityHomeBinding) getBinding()).updateParent;
Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.updateParent");
linearLayout2.setVisibility(8);
}
public final boolean isNewUiAppOrPaymentModeOn() {
return LoginActivity.INSTANCE.isNewUIApp() || BaseActivity.isPaymentAppMode;
}
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\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-\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0003\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t¢\u0006\u0002\u0010\nJ\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eH\u0016J\u000e\u0010\u000f\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\u000eJ\b\u0010\u0011\u001a\u00020\u000eH\u0016R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Lapp/callpe/ui/home/HomeActivity$ViewPager2Adapter;", "Landroidx/viewpager2/adapter/FragmentStateAdapter;", "liveStreaming", "", "showGameTab", "isLive", "fm", "Landroidx/fragment/app/FragmentManager;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "(ZZZLandroidx/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;
private final boolean isLive;
private final boolean liveStreaming;
private final boolean showGameTab;
public ViewPager2Adapter(boolean z, boolean z2, boolean z3, FragmentManager fragmentManager, Lifecycle lifecycle) {
super(fragmentManager, lifecycle);
Intrinsics.checkNotNullParameter(fragmentManager, "fm");
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
this.liveStreaming = z;
this.showGameTab = z2;
this.isLive = z3;
this.fm = fragmentManager;
}
public Fragment createFragment(int position) {
if (LoginActivity.INSTANCE.isOdioApps()) {
boolean z = this.liveStreaming;
if (z && this.showGameTab) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new LiveStreamersFragment();
}
if (position == 2) {
return new ChatListFragment();
}
if (position == 3) {
return new GameFragment();
}
if (position == 4) {
return new UserAccountFragment();
}
} else if (z) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new LiveStreamersFragment();
}
if (position == 2) {
return new ChatListFragment();
}
if (position == 3) {
return new UserAccountFragment();
}
} else if (this.showGameTab) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new ChatListFragment();
}
if (position == 2) {
return new GameFragment();
}
if (position == 3) {
return new UserAccountFragment();
}
} else {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new ChatListFragment();
}
if (position == 2) {
return new UserAccountFragment();
}
}
} else {
boolean z2 = this.liveStreaming;
if (z2 && this.showGameTab) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new LiveStreamersFragment();
}
if (position == 2) {
return new ChatListFragment();
}
if (position == 3) {
return new GameFragment();
}
if (position == 4) {
return new UserAccountFragment();
}
} else if (this.showGameTab) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new ChatListFragment();
}
if (position == 2) {
return new GameFragment();
}
if (position == 3) {
return new UserAccountFragment();
}
} else if (z2) {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new LiveStreamersFragment();
}
if (position == 2) {
return new ChatListFragment();
}
if (position == 3) {
return new UserAccountFragment();
}
} else {
if (position == 0) {
if (new HomeActivity().isNewUiAppOrPaymentModeOn()) {
if (!this.isLive) {
return new StreamerListFragment();
}
return new NewHomeFragment();
}
return new NewHomeFragment();
}
if (position == 1) {
return new ChatListFragment();
}
if (position == 2) {
return new UserAccountFragment();
}
}
}
return new UserAccountFragment();
}
public int getItemCount() {
if (LoginActivity.INSTANCE.isOdioApps()) {
boolean z = this.liveStreaming;
if (!z || !this.showGameTab) {
if (!z && !this.showGameTab) {
return 3;
}
return 4;
}
return 5;
}
boolean z2 = this.liveStreaming;
if (!z2 || !this.showGameTab) {
if (!this.showGameTab && !z2) {
return 3;
}
return 4;
}
return 5;
}
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 ActivityHomeBinding inflateLayout(LayoutInflater layoutInflater) {
Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
ActivityHomeBinding inflate = ActivityHomeBinding.inflate(layoutInflater);
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
return inflate;
}
private final void showLanguageAddPopUp(User user) {
if (!user.getLanguages().isEmpty() || appOpenForLanguage) {
return;
}
appOpenForLanguage = true;
InterestAndLanguage interestAndLanguage = this.bottomSheetFragment;
if (interestAndLanguage != null && interestAndLanguage.isVisible()) {
return;
}
InterestAndLanguage interestAndLanguage2 = this.bottomSheetFragment;
if (interestAndLanguage2 != null && interestAndLanguage2.isAdded()) {
return;
}
try {
InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(false, new ArrayList<>(), new ArrayList<>());
this.bottomSheetFragment = newInstance;
if (newInstance != null) {
newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
@Override
public void onBottomSheetDismissed() {
HomeViewModel viewModel;
viewModel = HomeActivity.this.getViewModel();
viewModel.getUserDetails();
HomeActivity.this.updateLanguage = true;
HomeActivity.this.updateLanguageList();
}
});
}
InterestAndLanguage interestAndLanguage3 = this.bottomSheetFragment;
if (interestAndLanguage3 != null) {
interestAndLanguage3.show(getSupportFragmentManager(), "BottomSheet");
}
} catch (Exception e) {
Timber.e(e);
}
}
public final void updateLanguageList() {
getViewModel().updateLanguageList();
}
private final void showVerifyOTPPopUp(User user) {
String mobile = user.getMobile();
if ((mobile == null || mobile.length() == 0) && user.getFirstRechargeDone() && !appOpenForOTP) {
Context context = (Context) this;
if (SharedPref.getBoolean(context, PrefKeys.VERIFICATION_HIDE_POPUP)) {
return;
}
Integer num = SharedPref.getInt(context, PrefKeys.VERIFICATION_APP_OPEN_COUNT, 5);
Timber.e("verifyAppOpen " + num, new Object[0]);
appOpenForOTP = true;
VerifyNumberSheet verifyNumberSheet = this.verifyNumberFragment;
if (verifyNumberSheet != null && verifyNumberSheet.isVisible()) {
return;
}
VerifyNumberSheet verifyNumberSheet2 = this.verifyNumberFragment;
if (verifyNumberSheet2 != null && verifyNumberSheet2.isAdded()) {
return;
}
if (num != null) {
try {
if (num.intValue() == 5) {
VerifyNumberSheet newInstance$default = VerifyNumberSheet.Companion.newInstance$default(VerifyNumberSheet.INSTANCE, false, 1, null);
this.verifyNumberFragment = newInstance$default;
if (newInstance$default != null) {
newInstance$default.setListener(new VerifyNumberSheet.BottomSheetDialogListener() {
@Override
public void onBottomSheetDismissed() {
}
});
}
VerifyNumberSheet verifyNumberSheet3 = this.verifyNumberFragment;
if (verifyNumberSheet3 != null) {
verifyNumberSheet3.show(getSupportFragmentManager(), "BottomSheet");
}
num = 0;
}
} catch (Exception e) {
Timber.e(e);
return;
}
}
SharedPref.setInt((Context) this, PrefKeys.VERIFICATION_APP_OPEN_COUNT, Integer.valueOf(num.intValue() + 1).intValue());
}
}
public final void fetchLocation() {
if (BaseActivity.INSTANCE.isNotLive()) {
return;
}
LocationUtils.INSTANCE.getLocation(false, (Context) this, getApiService(), new Function2<Double, Double, Unit>() {
{
super(2);
}
public Object invoke(Object obj, Object obj2) {
invoke(((Number) obj).doubleValue(), ((Number) obj2).doubleValue());
return Unit.INSTANCE;
}
public final void invoke(double d, double d2) {
HomeViewModel viewModel;
HomeViewModel viewModel2;
HomeViewModel viewModel3;
HomeViewModel viewModel4;
Timber.d("Received location: " + d + ", " + d2, new Object[0]);
viewModel = HomeActivity.this.getViewModel();
viewModel.setLat(d);
viewModel2 = HomeActivity.this.getViewModel();
viewModel2.setLon(d2);
HomeActivity homeActivity = HomeActivity.this;
Context context = (Context) homeActivity;
viewModel3 = homeActivity.getViewModel();
SharedPref.setFloat(context, PrefKeys.LAST_KNOWN_LAT, (float) viewModel3.getLat());
HomeActivity homeActivity2 = HomeActivity.this;
Context context2 = (Context) homeActivity2;
viewModel4 = homeActivity2.getViewModel();
SharedPref.setFloat(context2, PrefKeys.LAST_KNOWN_LON, (float) viewModel4.getLon());
}
});
}
@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();
handleFsiPermissionGiven();
LocalBroadcastManager.getInstance((Context) this).registerReceiver(this.receiver, new IntentFilter(app.callpe.common.utils.Constants.NOTIFY));
InAppUpdate inAppUpdate = this.inAppUpdate;
if (inAppUpdate != null) {
inAppUpdate.onResume();
}
checkForNavUpdate();
}
private final void checkForNavUpdate() {
Context context = (Context) this;
if (SharedPref.getBoolean(context, PrefKeys.NAV_CHANGE_REFLECTED) || !SharedPref.getBoolean(context, PrefKeys.FIRST_RECHARGE_DONE)) {
return;
}
SharedPref.setBoolean(context, PrefKeys.NAV_CHANGE_REFLECTED, true);
startActivity(new Intent(context, (Class<?>) SplashActivity.class));
}
protected void onPause() {
super.onPause();
LocalBroadcastManager.getInstance((Context) this).unregisterReceiver(this.receiver);
}
protected void onDestroy() {
appOpenForLanguage = false;
appOpenForOTP = false;
referrerCalled = false;
AdjustAnalyticsHelper.INSTANCE.setAdjustConfigDataSentToServer(false);
super.onDestroy();
try {
AlertDialog alertDialog = this.alertDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
InAppUpdate inAppUpdate = this.inAppUpdate;
if (inAppUpdate != null) {
inAppUpdate.onDestroy();
}
InterestAndLanguage interestAndLanguage = this.bottomSheetFragment;
if (interestAndLanguage != null) {
interestAndLanguage.dismiss();
}
} catch (Exception e) {
Timber.e(e);
}
}
private final void checkForFSI() {
Context context = (Context) this;
if (!SharedPref.getBoolean(context, PrefKeys.FIRST_RECHARGE_DONE, false) && Build.VERSION.SDK_INT >= 34) {
if (!canUseFullScreenIntentCheck(context)) {
showFullScreenNotificationPermissionDialog(context);
return;
}
AlertDialog alertDialog = this.fullScreenIntentDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
this.fullScreenIntentDialog = null;
}
}
private final void handleFsiPermissionGiven() {
if (Build.VERSION.SDK_INT < 34 || !canUseFullScreenIntentCheck((Context) this)) {
return;
}
try {
AlertDialog alertDialog = this.fullScreenIntentDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
this.fullScreenIntentDialog = null;
} catch (Exception e) {
Timber.e("Error: " + e, new Object[0]);
}
}
private final boolean canUseFullScreenIntentCheck(Context context) {
Object systemService = context.getSystemService("notification");
Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.app.NotificationManager");
return ((NotificationManager) systemService).canUseFullScreenIntent();
}
private final void showFullScreenNotificationPermissionDialog(final Context context) {
try {
AlertDialog alertDialog = this.fullScreenIntentDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
AlertDialog create = new AlertDialog.Builder(context).setTitle("Permission Required").setMessage("This app requires permission to show full-screen notifications. Please allow this permission in settings.").setPositiveButton("Allow", new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
HomeActivity.showFullScreenNotificationPermissionDialog$lambda$18(HomeActivity.this, context, dialogInterface, i);
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
}).setCancelable(false).create();
this.fullScreenIntentDialog = create;
if (create != null) {
create.show();
}
} catch (Exception e) {
Timber.e("Error: " + e, new Object[0]);
}
}
public static final void showFullScreenNotificationPermissionDialog$lambda$18(HomeActivity homeActivity, Context context, DialogInterface dialogInterface, int i) {
Intrinsics.checkNotNullParameter(homeActivity, "this$0");
Intrinsics.checkNotNullParameter(context, "$context");
try {
homeActivity.startActivity(new Intent("android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT").setData(Uri.parse("package:" + homeActivity.getPackageName())));
} catch (Exception e) {
Toast.makeText(context, "Error: " + e, 0).show();
}
}
}