正在查看: Rilo v2.0.21 应用的 NonLiveHomeActivityTypeTwo.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 NonLiveHomeActivityTypeTwo.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.ViewGroup;
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.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.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\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\u0003\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:\u0001|B\u0005¢\u0006\u0002\u0010\u0003J\u0010\u00101\u001a\u0002022\u0006\u00103\u001a\u000204H\u0002J\b\u00105\u001a\u000202H\u0002J\b\u00106\u001a\u000202H\u0002J\b\u00107\u001a\u000208H\u0002J\u0010\u00109\u001a\u0002022\u0006\u0010:\u001a\u00020;H\u0002J\u0010\u0010<\u001a\u0002022\u0006\u0010=\u001a\u00020>H\u0002J\u0010\u0010?\u001a\u00020\u00022\u0006\u0010@\u001a\u00020AH\u0016J\b\u0010B\u001a\u000202H\u0002J\b\u0010C\u001a\u00020DH\u0002J\"\u0010E\u001a\u0002022\u0006\u0010F\u001a\u00020\t2\u0006\u0010G\u001a\u00020\t2\b\u0010H\u001a\u0004\u0018\u00010IH\u0015J\b\u0010J\u001a\u000202H\u0017J\b\u0010K\u001a\u000202H\u0002J\u0012\u0010L\u001a\u0002022\b\u0010M\u001a\u0004\u0018\u00010NH\u0014J\b\u0010O\u001a\u000202H\u0014J\b\u0010P\u001a\u000202H\u0014J+\u0010Q\u001a\u0002022\u0006\u0010F\u001a\u00020\t2\f\u0010R\u001a\b\u0012\u0004\u0012\u00020\u00060\u00052\u0006\u0010S\u001a\u00020TH\u0016¢\u0006\u0002\u0010UJ\b\u0010V\u001a\u000202H\u0014J\b\u0010W\u001a\u000202H\u0014J\u0012\u0010X\u001a\u0002022\b\b\u0002\u0010Y\u001a\u00020ZH\u0002J\b\u0010[\u001a\u000202H\u0002J\b\u0010\\\u001a\u000202H\u0002J\b\u0010]\u001a\u000202H\u0002J\u001d\u0010^\u001a\u00020Z2\u000e\u0010R\u001a\n\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0005H\u0002¢\u0006\u0002\u0010_J\u0010\u0010`\u001a\u00020Z2\u0006\u0010a\u001a\u00020\u0006H\u0002J\b\u0010b\u001a\u000202H\u0002J\u0010\u0010c\u001a\u0002022\u0006\u0010d\u001a\u00020\tH\u0002J\b\u0010e\u001a\u000202H\u0002J(\u0010f\u001a\u0002022\u0006\u0010g\u001a\u00020\u00062\u0006\u0010h\u001a\u00020\u00062\u0006\u0010i\u001a\u00020\u00062\u0006\u0010j\u001a\u00020\u0006H\u0002J\u0016\u0010k\u001a\u0002022\f\u0010l\u001a\b\u0012\u0004\u0012\u00020m0\u0019H\u0002J\u0016\u0010n\u001a\u0002022\f\u0010o\u001a\b\u0012\u0004\u0012\u00020p0\u0019H\u0002J\b\u0010q\u001a\u000202H\u0002J\u000e\u0010r\u001a\u0002022\u0006\u0010s\u001a\u00020ZJ\b\u0010t\u001a\u000202H\u0002J\u0010\u0010u\u001a\u0002022\u0006\u0010v\u001a\u00020wH\u0002J\u0010\u0010x\u001a\u0002022\u0006\u0010y\u001a\u00020zH\u0002J\b\u0010{\u001a\u000202H\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\u0014\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\u00060\u0019X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u00060\u0019X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u001cX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001d\u001a\u00020\u001eX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001f\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\u0010/\u001a\u0004\u0018\u000100X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006}"}, d2 = {"Lapp/callpe/ui/nonliveui/NonLiveHomeActivityTypeTwo;", "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;", "languageList", "mViewPagerAdapter", "Lapp/callpe/ui/nonliveui/NonLiveHomeActivityTypeTwo$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;", "applyCustomLayouts", "", "menu", "Landroid/view/Menu;", "changingMenuTextsAndIcons", "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_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class NonLiveHomeActivityTypeTwo 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 NonLiveHomeActivityTypeTwo() {
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 m2014invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m2013invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m2015invoke() {
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) {
NonLiveHomeActivityTypeTwo.requestPermissionLauncher$lambda$1(NonLiveHomeActivityTypeTwo.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 = NonLiveHomeActivityTypeTwo.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;
}
NonLiveHomeActivityTypeTwo.this.showNotificationView();
NonLiveHomeActivityTypeTwo.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(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, boolean z) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
if (z) {
Timber.d("Permission granted", new Object[0]);
if (nonLiveHomeActivityTypeTwo.permissionArrayGranted(nonLiveHomeActivityTypeTwo.PERMISSIONS)) {
return;
}
nonLiveHomeActivityTypeTwo.requestPermissions(nonLiveHomeActivityTypeTwo.PERMISSION_REQ_FORWARD);
return;
}
ActivityExtKt.toast((Activity) nonLiveHomeActivityTypeTwo, "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", nonLiveHomeActivityTypeTwo.getPackageName());
nonLiveHomeActivityTypeTwo.startActivity(intent);
nonLiveHomeActivityTypeTwo.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();
setNav();
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() {
NonLiveHomeActivityTypeTwo.showNotificationView$lambda$2(NonLiveHomeActivityTypeTwo.this, findViewById);
}
}, 3000L);
}
public static final void showNotificationView$lambda$2(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, CardView cardView) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
Intrinsics.checkNotNullExpressionValue(cardView, "notificationCv");
nonLiveHomeActivityTypeTwo.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) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$3(NonLiveHomeActivityTypeTwo.this, findViewById, view);
}
});
getBinding().profilePic.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$5(NonLiveHomeActivityTypeTwo.this, view);
}
});
getBinding().ongoingCallParent.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$7(NonLiveHomeActivityTypeTwo.this, view);
}
});
getBinding().updateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$8(NonLiveHomeActivityTypeTwo.this, view);
}
});
getBinding().filter.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$9(NonLiveHomeActivityTypeTwo.this, view);
}
});
getBinding().languages.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.onClicks$lambda$10(NonLiveHomeActivityTypeTwo.this, view);
}
});
}
public static final void onClicks$lambda$3(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, CardView cardView, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
ViewPager2 viewPager2 = nonLiveHomeActivityTypeTwo.getBinding().viewPager;
Intrinsics.checkNotNullExpressionValue(viewPager2, "binding.viewPager");
viewPager2.setCurrentItem(2);
cardView.setVisibility(8);
Handler handler = nonLiveHomeActivityTypeTwo.handler;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
}
public static final void onClicks$lambda$5(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
nonLiveHomeActivityTypeTwo.startActivity(new Intent((Context) nonLiveHomeActivityTypeTwo, (Class<?>) NonLiveMyProfileActivity.class));
}
public static final void onClicks$lambda$7(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
VideoDetailModel videoDetails = nonLiveHomeActivityTypeTwo.getViewModel().getVideoDetails();
if (videoDetails != null) {
Intent intent = new Intent(nonLiveHomeActivityTypeTwo.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, nonLiveHomeActivityTypeTwo.getViewModel().getCaller());
intent.putExtra(app.callpe.common.utils.Constants.FCM_DATA, new Gson().toJson(videoDetails));
nonLiveHomeActivityTypeTwo.startActivity(intent);
}
}
public static final void onClicks$lambda$8(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
try {
String string = nonLiveHomeActivityTypeTwo.getString(2131951676);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_package)");
try {
nonLiveHomeActivityTypeTwo.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
} catch (ActivityNotFoundException unused) {
nonLiveHomeActivityTypeTwo.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(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
nonLiveHomeActivityTypeTwo.openMyPreferenceBottomSheet();
}
public static final void onClicks$lambda$10(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
nonLiveHomeActivityTypeTwo.openMyLanguageBottomSheet();
}
private final void initViews() {
ImageView imageView = getBinding().filter;
Intrinsics.checkNotNullExpressionValue(imageView, "binding.filter");
imageView.setVisibility(8);
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;
NavigationView navigationView2 = this.navigationView;
if (navigationView2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("navigationView");
navigationView2 = null;
}
Menu menu = navigationView2.getMenu();
Intrinsics.checkNotNullExpressionValue(menu, "navigationView.menu");
menu.clear();
getMenuInflater().inflate(2131689476, menu);
applyCustomLayouts(menu);
}
private final void applyCustomLayouts(Menu menu) {
int size = menu.size();
for (int i = 0; i < size; i++) {
menu.getItem(i).setActionView(getLayoutInflater().inflate(2131558914, (ViewGroup) null));
}
changingMenuTextsAndIcons();
}
private final void changingMenuTextsAndIcons() {
NavigationView navigationView = this.navigationView;
NavigationView navigationView2 = null;
if (navigationView == null) {
Intrinsics.throwUninitializedPropertyAccessException("navigationView");
navigationView = null;
}
navigationView.setBackgroundResource(2131231881);
NavigationView navigationView3 = this.navigationView;
if (navigationView3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("navigationView");
} else {
navigationView2 = navigationView3;
}
Menu menu = navigationView2.getMenu();
Intrinsics.checkNotNullExpressionValue(menu, "navigationView.menu");
int size = menu.size();
for (int i = 0; i < size; i++) {
MenuItem item = menu.getItem(i);
View actionView = item.getActionView();
if (actionView != null) {
ImageView imageView = (ImageView) actionView.findViewById(2131363165);
TextView textView = (TextView) actionView.findViewById(2131365025);
switch (item.getItemId()) {
case 2131363847:
textView.setText(getString(2131952196));
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231640));
break;
case 2131363848:
textView.setText("My interests");
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231623));
break;
case 2131363849:
textView.setText("My languages");
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231629));
item.setVisible(false);
break;
case 2131363850:
textView.setText("See profile");
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231670));
break;
case 2131363851:
textView.setText(getString(2131952456));
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231681));
break;
case 2131363852:
textView.setText("Terms and conditions");
imageView.setImageDrawable(ContextCompat.getDrawable((Context) this, 2131231715));
break;
}
}
}
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new NonLiveHomeActivityTypeTwo$observeEvent$1(this, null), 3, (Object) null);
}
public 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.NonLiveHomeActivityTypeTwo.setNav():void");
}
public static final void setNav$lambda$13(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
nonLiveHomeActivityTypeTwo.startActivity(new Intent((Context) nonLiveHomeActivityTypeTwo, (Class<?>) NonLiveMyProfileActivity.class));
}
public static final boolean setNav$lambda$17(app.callpe.ui.nonliveui.NonLiveHomeActivityTypeTwo r5, android.view.MenuItem r6) {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.nonliveui.NonLiveHomeActivityTypeTwo.setNav$lambda$17(app.callpe.ui.nonliveui.NonLiveHomeActivityTypeTwo, 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() {
NonLiveHomeActivityTypeTwo.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() {
NonLiveHomeActivityTypeTwo.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(2131362958).setIcon(ContextCompat.getDrawable((Context) this, 2131231609));
((ActivityNonLiveHomeBinding) getBinding()).bottomNavigation.setOnItemSelectedListener(new NavigationBarView.OnItemSelectedListener() {
public final boolean onNavigationItemSelected(MenuItem menuItem) {
boolean upNavigation$lambda$20;
upNavigation$lambda$20 = NonLiveHomeActivityTypeTwo.setUpNavigation$lambda$20(NonLiveHomeActivityTypeTwo.this, menuItem);
return upNavigation$lambda$20;
}
});
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;
if (position == 0) {
binding = NonLiveHomeActivityTypeTwo.this.getBinding();
ImageView imageView = binding.languages;
Intrinsics.checkNotNullExpressionValue(imageView, "binding.languages");
imageView.setVisibility(0);
binding2 = NonLiveHomeActivityTypeTwo.this.getBinding();
binding2.homeTitle.setText(NonLiveHomeActivityTypeTwo.this.getString(2131952049));
return;
}
if (position != 1) {
return;
}
binding3 = NonLiveHomeActivityTypeTwo.this.getBinding();
ImageView imageView2 = binding3.languages;
Intrinsics.checkNotNullExpressionValue(imageView2, "binding.languages");
imageView2.setVisibility(8);
binding4 = NonLiveHomeActivityTypeTwo.this.getBinding();
binding4.homeTitle.setText(NonLiveHomeActivityTypeTwo.this.getString(2131951840));
}
public void onPageSelected(int position) {
ActivityNonLiveHomeBinding binding;
ActivityNonLiveHomeBinding binding2;
if (position == 0) {
binding = NonLiveHomeActivityTypeTwo.this.getBinding();
binding.bottomNavigation.setSelectedItemId(2131362958);
} else {
if (position != 1) {
return;
}
binding2 = NonLiveHomeActivityTypeTwo.this.getBinding();
binding2.bottomNavigation.setSelectedItemId(2131362950);
}
}
});
}
((ActivityNonLiveHomeBinding) getBinding()).fab.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NonLiveHomeActivityTypeTwo.setUpNavigation$lambda$21(NonLiveHomeActivityTypeTwo.this, view);
}
});
}
public static final boolean setUpNavigation$lambda$20(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, MenuItem menuItem) {
ViewPager2 viewPager2;
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
Intrinsics.checkNotNullParameter(menuItem, "item");
int itemId = menuItem.getItemId();
if (itemId == 2131362950) {
ViewPager2 viewPager22 = nonLiveHomeActivityTypeTwo.viewPager;
if (viewPager22 != null) {
viewPager22.setCurrentItem(1);
}
} else if (itemId == 2131362958 && (viewPager2 = nonLiveHomeActivityTypeTwo.viewPager) != null) {
viewPager2.setCurrentItem(0);
}
return true;
}
public static final void setUpNavigation$lambda$21(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, View view) {
ViewPager2 viewPager2;
Intrinsics.checkNotNullParameter(nonLiveHomeActivityTypeTwo, "this$0");
ViewPager2 viewPager22 = nonLiveHomeActivityTypeTwo.viewPager;
if (viewPager22 != null) {
if ((viewPager22 != null ? viewPager22.getAdapter() : null) == null || (viewPager2 = nonLiveHomeActivityTypeTwo.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(NonLiveHomeActivityTypeTwo nonLiveHomeActivityTypeTwo, boolean z, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
nonLiveHomeActivityTypeTwo.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;
} else {
if (valueOf != null && valueOf.intValue() == 1) {
ViewPager2 viewPager23 = this.viewPager;
if (viewPager23 == null) {
return;
}
viewPager23.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);
}
}
public 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/NonLiveHomeActivityTypeTwo$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_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class ViewPager2Adapter extends FragmentStateAdapter {
private final FragmentManager fm;
public int getItemCount() {
return 2;
}
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();
}
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();
}
}