正在查看: Rilo v2.0.21 应用的 PremiumStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 PremiumStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.user;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import app.callpe.App;
import app.callpe.adapters.StreamerListAdapter;
import app.callpe.common.utils.custom.CustomGridLayoutManager;
import app.callpe.common.utils.listeners.PaginationListener;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.StreamerStatusModel;
import app.callpe.databinding.ActivityPremiumStreamerBinding;
import app.callpe.ui.bottomsheet.InterestAndLanguage;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.home.HomeViewModel;
import app.callpe.ui.home.fragments.StreamerListFragment;
import app.callpe.ui.home.fragments.TopRatedFragment;
import com.facebook.internal.NativeProtocol;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.ArrayList;
import java.util.List;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import timber.log.Timber;
@Metadata(d1 = {"\u0000\u0082\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\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\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u001f\u001a\u00020 H\u0002J\b\u0010!\u001a\u00020\"H\u0002J\u0010\u0010#\u001a\u00020\u00022\u0006\u0010$\u001a\u00020%H\u0016J\b\u0010&\u001a\u00020\"H\u0002J\b\u0010'\u001a\u00020\"H\u0002J\b\u0010(\u001a\u00020)H\u0002J\b\u0010*\u001a\u00020\"H\u0002J\u0012\u0010+\u001a\u00020\"2\b\u0010,\u001a\u0004\u0018\u00010-H\u0014J\b\u0010.\u001a\u00020\"H\u0014J\u0010\u0010/\u001a\u00020\t2\u0006\u00100\u001a\u000201H\u0016J\b\u00102\u001a\u00020\"H\u0014J\b\u00103\u001a\u00020\"H\u0002J\b\u00104\u001a\u00020\"H\u0002J\b\u00105\u001a\u00020\"H\u0002J\b\u00106\u001a\u00020\"H\u0002J\b\u00107\u001a\u00020\"H\u0002J\b\u00108\u001a\u00020\"H\u0002J\b\u00109\u001a\u00020\"H\u0002J \u0010:\u001a\u00020\"2\u0016\u0010;\u001a\u0012\u0012\u0004\u0012\u00020<0\u0017j\b\u0012\u0004\u0012\u00020<`\u0018H\u0002R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\n\u001a\u0004\u0018\u00010\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u0017\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00100\u000f¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u0012R\u000e\u0010\u0013\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082.¢\u0006\u0002\n\u0000R\u001e\u0010\u0016\u001a\u0012\u0012\u0004\u0012\u00020\u00100\u0017j\b\u0012\u0004\u0012\u00020\u0010`\u0018X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0019\u001a\u00020\u001a8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001d\u0010\u001e\u001a\u0004\b\u001b\u0010\u001c¨\u0006="}, d2 = {"Lapp/callpe/ui/user/PremiumStreamerActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityPremiumStreamerBinding;", "()V", "adapter", "Lapp/callpe/adapters/StreamerListAdapter;", "bottomSheetFragment", "Lapp/callpe/ui/bottomsheet/InterestAndLanguage;", "firstRechargeDone", "", "gridLayoutManager", "Lapp/callpe/common/utils/custom/CustomGridLayoutManager;", "hideCallRate", "hideStreamerCallRate", NativeProtocol.RESULT_ARGS_PERMISSIONS, "", "", "getPermissions", "()Ljava/util/List;", "screenType", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "userSelectedLanguageList", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "viewModel", "Lapp/callpe/ui/home/HomeViewModel;", "getViewModel", "()Lapp/callpe/ui/home/HomeViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "getContext", "Landroid/content/Context;", "handleUpdateButtonVisibility", "", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initValues", "initViews", "observeEvent", "Lkotlinx/coroutines/Job;", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onResume", "pollStreamerStatus", "refresh", "refreshMeta", "setUpToolbar", "setupRv", "showLanguageAddPopUp", "swipeRefresh", "updateOnlineStatus", "list", "Lapp/callpe/data/model/StreamerStatusModel;", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class PremiumStreamerActivity extends BaseActivity<ActivityPremiumStreamerBinding> {
private StreamerListAdapter adapter;
private InterestAndLanguage bottomSheetFragment;
private boolean firstRechargeDone;
private CustomGridLayoutManager gridLayoutManager;
private boolean hideCallRate;
private boolean hideStreamerCallRate;
private Toolbar toolbar;
private final Lazy viewModel;
private final List<String> permissions = CollectionsKt.listOf(new String[]{"android.permission.CAMERA", "android.permission.RECORD_AUDIO"});
private ArrayList<String> userSelectedLanguageList = new ArrayList<>();
private String screenType = "";
public PremiumStreamerActivity() {
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 m2230invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m2229invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m2231invoke() {
CreationExtras creationExtras;
Function0 function02 = function0;
return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
}
});
}
@Override
public ActivityPremiumStreamerBinding inflateLayout(LayoutInflater layoutInflater) {
Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
ActivityPremiumStreamerBinding inflate = ActivityPremiumStreamerBinding.inflate(layoutInflater);
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
return inflate;
}
public final List<String> getPermissions() {
return this.permissions;
}
public final HomeViewModel getViewModel() {
return (HomeViewModel) this.viewModel.getValue();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setWindowFlag((Activity) this, 67108864, false);
getWindow().setStatusBarColor(ContextCompat.getColor((Context) this, 2131100053));
this.screenType = String.valueOf(getIntent().getStringExtra("screenType"));
initViews();
initValues();
setUpToolbar();
setupRv();
swipeRefresh();
observeEvent();
onClicks();
refresh();
pollStreamerStatus();
}
private final void initValues() {
Context context = (Context) this;
this.firstRechargeDone = SharedPref.getBoolean(context, PrefKeys.FIRST_RECHARGE_DONE);
boolean z = SharedPref.getBoolean(context, PrefKeys.HIDE_CALL_RATE);
this.hideCallRate = z;
this.hideStreamerCallRate = z;
}
private final void setupRv() {
Context context = (Context) this;
String string = SharedPref.getString(context, PrefKeys.INTEREST_KEY_TEXT);
this.gridLayoutManager = new CustomGridLayoutManager(context, BaseActivity.currentListViewType);
String str = this.screenType;
int hashCode = str.hashCode();
if (hashCode == -1278563672) {
if (str.equals("LOW_RATES")) {
TextView textView = ((ActivityPremiumStreamerBinding) getBinding()).title;
Intent intent = getIntent();
textView.setText(intent != null ? intent.getStringExtra("lowRateValue") : null);
View view = ((ActivityPremiumStreamerBinding) getBinding()).chooseLanguage;
Intrinsics.checkNotNullExpressionValue(view, "binding.chooseLanguage");
view.setVisibility(8);
((ActivityPremiumStreamerBinding) getBinding()).rv.setLayoutManager(this.gridLayoutManager);
StreamerListAdapter streamerListAdapter = new StreamerListAdapter(null, new PremiumStreamerActivity$setupRv$3(this), false, this.hideStreamerCallRate, false, 21, null);
this.adapter = streamerListAdapter;
streamerListAdapter.setInterestKeyText(string);
((ActivityPremiumStreamerBinding) getBinding()).rv.setAdapter(this.adapter);
RecyclerView recyclerView = ((ActivityPremiumStreamerBinding) getBinding()).rv;
final CustomGridLayoutManager customGridLayoutManager = this.gridLayoutManager;
recyclerView.addOnScrollListener(new PaginationListener(customGridLayoutManager) {
@Override
public void isScrolled(int dx, int dy) {
}
{
super((LinearLayoutManager) customGridLayoutManager, 20);
}
@Override
protected void loadMoreItems() {
HomeViewModel viewModel;
HomeViewModel viewModel2;
viewModel = PremiumStreamerActivity.this.getViewModel();
viewModel.setLoadingLowRateStreamer(true);
viewModel2 = PremiumStreamerActivity.this.getViewModel();
viewModel2.getLowRateStreamerList(true);
}
@Override
public boolean isLastPage() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLastPageLowRateStreamer();
}
@Override
public boolean isLoading() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLoadingLowRateStreamer();
}
});
return;
}
return;
}
if (hashCode == -1144404696) {
if (str.equals("MY_LANGUAGES")) {
((ActivityPremiumStreamerBinding) getBinding()).title.setText(getString(2131952335));
((ActivityPremiumStreamerBinding) getBinding()).rv.setLayoutManager(this.gridLayoutManager);
StreamerListAdapter streamerListAdapter2 = new StreamerListAdapter(null, new PremiumStreamerActivity$setupRv$5(this), false, this.hideStreamerCallRate, this.firstRechargeDone, 5, null);
this.adapter = streamerListAdapter2;
streamerListAdapter2.setInterestKeyText(string);
((ActivityPremiumStreamerBinding) getBinding()).rv.setAdapter(this.adapter);
RecyclerView recyclerView2 = ((ActivityPremiumStreamerBinding) getBinding()).rv;
final CustomGridLayoutManager customGridLayoutManager2 = this.gridLayoutManager;
recyclerView2.addOnScrollListener(new PaginationListener(customGridLayoutManager2) {
@Override
public void isScrolled(int dx, int dy) {
}
{
super((LinearLayoutManager) customGridLayoutManager2, 20);
}
@Override
protected void loadMoreItems() {
HomeViewModel viewModel;
HomeViewModel viewModel2;
viewModel = PremiumStreamerActivity.this.getViewModel();
viewModel.setLoadingMyLanguageStreamer(true);
viewModel2 = PremiumStreamerActivity.this.getViewModel();
viewModel2.getMyLanguageStreamerList(true);
}
@Override
public boolean isLastPage() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLastPageMyLanguageStreamer();
}
@Override
public boolean isLoading() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLoadingMyLanguageStreamer();
}
});
return;
}
return;
}
if (hashCode == 399530551 && str.equals("PREMIUM")) {
((ActivityPremiumStreamerBinding) getBinding()).title.setText(getString(2131952453));
View view2 = ((ActivityPremiumStreamerBinding) getBinding()).chooseLanguage;
Intrinsics.checkNotNullExpressionValue(view2, "binding.chooseLanguage");
view2.setVisibility(8);
((ActivityPremiumStreamerBinding) getBinding()).rv.setLayoutManager(this.gridLayoutManager);
StreamerListAdapter streamerListAdapter3 = new StreamerListAdapter(null, new PremiumStreamerActivity$setupRv$1(this), false, this.hideStreamerCallRate, false, 21, null);
this.adapter = streamerListAdapter3;
streamerListAdapter3.setInterestKeyText(string);
((ActivityPremiumStreamerBinding) getBinding()).rv.setAdapter(this.adapter);
RecyclerView recyclerView3 = ((ActivityPremiumStreamerBinding) getBinding()).rv;
final CustomGridLayoutManager customGridLayoutManager3 = this.gridLayoutManager;
recyclerView3.addOnScrollListener(new PaginationListener(customGridLayoutManager3) {
@Override
public void isScrolled(int dx, int dy) {
}
{
super((LinearLayoutManager) customGridLayoutManager3, 20);
}
@Override
protected void loadMoreItems() {
HomeViewModel viewModel;
HomeViewModel viewModel2;
viewModel = PremiumStreamerActivity.this.getViewModel();
viewModel.setLoadingPremiumStreamer(true);
viewModel2 = PremiumStreamerActivity.this.getViewModel();
viewModel2.getPremiumStreamerList(true);
}
@Override
public boolean isLastPage() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLastPagePremiumStreamer();
}
@Override
public boolean isLoading() {
HomeViewModel viewModel;
viewModel = PremiumStreamerActivity.this.getViewModel();
return viewModel.getIsLoadingPremiumStreamer();
}
});
}
}
public final void refreshMeta() {
getViewModel().getUserDetails();
}
private final void setUpToolbar() {
try {
Toolbar toolbar = this.toolbar;
if (toolbar == null) {
Intrinsics.throwUninitializedPropertyAccessException("toolbar");
toolbar = null;
}
setSupportActionBar(toolbar);
ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
} catch (Exception e) {
Timber.e(e, "setUpToolbar: Error ", new Object[0]);
}
}
private final void swipeRefresh() {
getBinding().swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
public final void onRefresh() {
PremiumStreamerActivity.swipeRefresh$lambda$0(PremiumStreamerActivity.this);
}
});
}
public static final void swipeRefresh$lambda$0(PremiumStreamerActivity premiumStreamerActivity) {
Intrinsics.checkNotNullParameter(premiumStreamerActivity, "this$0");
premiumStreamerActivity.getBinding().swipeRefresh.setRefreshing(false);
premiumStreamerActivity.refresh();
}
public final void refresh() {
StreamerListAdapter streamerListAdapter = this.adapter;
if (streamerListAdapter != null) {
streamerListAdapter.clear();
}
String str = this.screenType;
int hashCode = str.hashCode();
if (hashCode != -1278563672) {
if (hashCode != -1144404696) {
if (hashCode == 399530551 && str.equals("PREMIUM")) {
getViewModel().setLastPagePremiumStreamer(false);
getViewModel().setLoadingPremiumStreamer(false);
getViewModel().setPagePremiumStreamer(0);
getViewModel().getPremiumStreamerList().clear();
getViewModel().getPremiumStreamerList(true);
}
} else if (str.equals("MY_LANGUAGES")) {
getViewModel().setLastPageMyLanguageStreamer(false);
getViewModel().setLoadingMyLanguageStreamer(false);
getViewModel().setPageMyLanguageStreamer(0);
getViewModel().getMyLanguageStreamerList().clear();
getViewModel().getMyLanguageStreamerList(true);
getViewModel().getUserDetails();
}
} else if (str.equals("LOW_RATES")) {
getViewModel().setLastPageLowRateStreamer(false);
getViewModel().setLoadingLowRateStreamer(false);
getViewModel().setPageLowRateStreamer(0);
getViewModel().getLowRateStreamerList().clear();
getViewModel().getLowRateStreamerList(true);
}
getViewModel().getUserDetails();
}
private final void onClicks() {
getBinding().chooseLanguage.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
PremiumStreamerActivity.onClicks$lambda$1(PremiumStreamerActivity.this, view);
}
});
}
public static final void onClicks$lambda$1(PremiumStreamerActivity premiumStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(premiumStreamerActivity, "this$0");
premiumStreamerActivity.showLanguageAddPopUp();
}
private final void showLanguageAddPopUp() {
try {
InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(false, new ArrayList<>(), this.userSelectedLanguageList);
newInstance.setCancelable(false);
newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
@Override
public void onBottomSheetDismissed() {
PremiumStreamerActivity.this.refresh();
TopRatedFragment.INSTANCE.setRefreshMyLanguageStreamersOnly(true);
StreamerListFragment.Companion.setRefreshMyLanguageStreamersOnly(true);
}
});
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new PremiumStreamerActivity$showLanguageAddPopUp$2(newInstance, this, null), 3, (Object) null);
} catch (Exception e) {
Timber.e(e);
}
}
private final void initViews() {
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 PremiumStreamerActivity$observeEvent$1(this, null), 3, (Object) null);
}
public final void handleUpdateButtonVisibility() {
if (Intrinsics.areEqual(this.screenType, "MY_LANGUAGES")) {
View view = getBinding().chooseLanguage;
Intrinsics.checkNotNullExpressionValue(view, "binding.chooseLanguage");
view.setVisibility(0);
}
}
private final void pollStreamerStatus() {
if (!App.Companion.getStatusApiPingEnabled()) {
getViewModel().getStreamersOnlineStatus();
} else {
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new PremiumStreamerActivity$pollStreamerStatus$1(this, null), 3, (Object) null);
}
}
public final void updateOnlineStatus(ArrayList<StreamerStatusModel> list) {
StreamerListAdapter streamerListAdapter = this.adapter;
if (streamerListAdapter != null) {
streamerListAdapter.updateOnlineStatus(list);
}
}
private final Context getContext() {
return (Context) this;
}
protected void onDestroy() {
super.onDestroy();
}
protected void onResume() {
super.onResume();
getViewModel().getUserDetails();
}
public boolean onOptionsItemSelected(MenuItem item) {
Intrinsics.checkNotNullParameter(item, "item");
if (item.getItemId() != 16908332) {
return true;
}
finish();
return true;
}
}