正在查看: Biko v2.0.23 应用的 SettingsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 SettingsActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.misc;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContract;
import androidx.activity.result.contract.ActivityResultContracts;
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 app.callpe.App;
import app.callpe.common.utils.FabManager;
import app.callpe.common.utils.InternetSpeedTest;
import app.callpe.common.utils.LoadingDialog;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.extensions.ContextExtKt;
import app.callpe.common.utils.helper_functions.DialogHelper;
import app.callpe.common.utils.helper_functions.Utils;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.BandwidthInfo;
import app.callpe.data.model.User;
import app.callpe.databinding.ActivitySettingsBinding;
import app.callpe.databinding.DeleteConfirmDialogBinding;
import app.callpe.db.LocalDB;
import app.callpe.rtc.RtcManagerFactory;
import app.callpe.service.PingService;
import app.callpe.ui.chat.SupportChatActivity;
import app.callpe.ui.dialog.TextToSpeechDialogFragment;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.home.HomeViewModel;
import app.callpe.ui.home.StreamerHomeActivity;
import app.callpe.ui.home.fragments.FavouriteV2Fragment;
import app.callpe.ui.home.fragments.NearbyStreamersFragment;
import app.callpe.ui.home.fragments.NewStreamersListFragment;
import app.callpe.ui.home.fragments.StreamerListFragment;
import app.callpe.ui.login.LoginActivity;
import app.callpe.ui.user.SearchUserActivity;
import app.module.common.rtcmanager.RtcManager;
import com.asynctaskcoffee.audiorecorder.R;
import com.google.android.material.button.MaterialButton;
import com.google.gson.Gson;
import com.techiness.progressdialoglibrary.ProgressDialog;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.Locale;
import javax.inject.Inject;
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.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import timber.log.Timber;
@Metadata(d1 = {"\u0000\u0084\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\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010/\u001a\u000200H\u0002J\u0010\u00101\u001a\u0002002\u0006\u0010\u0004\u001a\u00020\u0005H\u0002J\b\u00102\u001a\u000200H\u0002J\b\u00103\u001a\u000200H\u0002J\b\u00104\u001a\u000200H\u0002J\u001c\u00105\u001a\u0002002\b\b\u0002\u00106\u001a\u00020\u00072\b\b\u0002\u00107\u001a\u00020\u0007H\u0002J\b\u00108\u001a\u000200H\u0002J\u0010\u00109\u001a\u00020\u00022\u0006\u0010:\u001a\u00020;H\u0016J\b\u0010<\u001a\u00020=H\u0002J\b\u0010>\u001a\u000200H\u0003J\u0012\u0010?\u001a\u0002002\b\u0010@\u001a\u0004\u0018\u00010AH\u0014J\b\u0010B\u001a\u000200H\u0014J\b\u0010C\u001a\u000200H\u0014J\u0010\u0010D\u001a\u0002002\u0006\u0010E\u001a\u00020FH\u0002J\b\u0010G\u001a\u000200H\u0002J\u0010\u0010H\u001a\u0002002\u0006\u0010I\u001a\u00020\u0007H\u0002J\u0010\u0010J\u001a\u0002002\u0006\u0010K\u001a\u00020\u0007H\u0002J\u0010\u0010L\u001a\u0002002\u0006\u0010M\u001a\u00020\u0007H\u0002J\u0010\u0010N\u001a\u0002002\u0006\u0010O\u001a\u00020\u0007H\u0002J\u0010\u0010P\u001a\u0002002\u0006\u0010Q\u001a\u00020RH\u0002J\b\u0010S\u001a\u000200H\u0002J\b\u0010T\u001a\u000200H\u0002J\b\u0010U\u001a\u000200H\u0002R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R \u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\tX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010\u0013\u001a\u0004\u0018\u00010\u0014X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0015\u0010\u0016\"\u0004\b\u0017\u0010\u0018R\u000e\u0010\u0019\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001a\u001a\u0004\u0018\u00010\u001bX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u001c\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b \u0010!\u001a\u0004\b\u001e\u0010\u001fR\u000e\u0010\"\u001a\u00020\u0007X\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\u0014\u0010)\u001a\b\u0012\u0004\u0012\u00020\n0\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010*\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010+\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010,\u001a\u0004\u0018\u00010-X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010.\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006V"}, d2 = {"Lapp/callpe/ui/misc/SettingsActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivitySettingsBinding;", "()V", "bandwidthInfo", "Lapp/callpe/data/model/BandwidthInfo;", "beautyTokenReceived", "", "chatLauncher", "Landroidx/activity/result/ActivityResultLauncher;", "Landroid/content/Intent;", "getChatLauncher", "()Landroidx/activity/result/ActivityResultLauncher;", "setChatLauncher", "(Landroidx/activity/result/ActivityResultLauncher;)V", "communityGuidelinesUrl", "", "complianceStatementUrl", "contentModerationPolicyUrl", "customDialog", "Landroid/app/AlertDialog;", "getCustomDialog", "()Landroid/app/AlertDialog;", "setCustomDialog", "(Landroid/app/AlertDialog;)V", "firstRechargeDone", "haltedUserMetadata", "Lapp/callpe/ui/home/HomeViewModel$UserEvent$UserMetaData;", "homeViewModel", "Lapp/callpe/ui/home/HomeViewModel;", "getHomeViewModel", "()Lapp/callpe/ui/home/HomeViewModel;", "homeViewModel$delegate", "Lkotlin/Lazy;", "isPolicyListVisible", "localDB", "Lapp/callpe/db/LocalDB;", "getLocalDB", "()Lapp/callpe/db/LocalDB;", "setLocalDB", "(Lapp/callpe/db/LocalDB;)V", "overlayPermissionLauncher", "pricingPolicyUrl", "privacyPolicyUrl", "rtcManager", "Lapp/module/common/rtcmanager/RtcManager;", "termsAndConditionsUrl", "checkForOverlayPermissionChange", "", "checkInternetSpeedTest", "clearDb", "forUser", "getSharedPrefValues", "handleListGridSelection", "gridSelected", "refresh", "handleLogsSwitch", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "observeEvent", "Lkotlinx/coroutines/Job;", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onResume", "setCheckBoxValues", "user", "Lapp/callpe/data/model/User;", "showAccountDeleteConfirmDialog", "showAgeStatus", "showAge", "showCityStatus", "showCity", "showOnlineOrOfflineBtn", "online", "showSearchOption", "callpeAdmin", "showSupportServiceForUsers", "metadata", "Lapp/callpe/data/model/Metadata;", "showViews", "starServiceFunc", "stopServiceFunc", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class SettingsActivity extends BaseActivity<ActivitySettingsBinding> {
private BandwidthInfo bandwidthInfo;
private boolean beautyTokenReceived;
private ActivityResultLauncher<Intent> chatLauncher;
private AlertDialog customDialog;
private boolean firstRechargeDone;
private HomeViewModel.UserEvent.UserMetaData haltedUserMetadata;
private final Lazy homeViewModel;
private boolean isPolicyListVisible;
@Inject
public LocalDB localDB;
private ActivityResultLauncher<Intent> overlayPermissionLauncher;
private RtcManager rtcManager;
private String termsAndConditionsUrl = "";
private String privacyPolicyUrl = "";
private String communityGuidelinesUrl = "";
private String pricingPolicyUrl = "";
private String complianceStatementUrl = "";
private String contentModerationPolicyUrl = "";
public SettingsActivity() {
final ComponentActivity componentActivity = (ComponentActivity) this;
final Function0 function0 = null;
this.homeViewModel = new ViewModelLazy(Reflection.getOrCreateKotlinClass(HomeViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
public final ViewModelStore m1968invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m1967invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m1969invoke() {
CreationExtras creationExtras;
Function0 function02 = function0;
return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
}
});
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
SettingsActivity.overlayPermissionLauncher$lambda$0(SettingsActivity.this, (ActivityResult) obj);
}
});
Intrinsics.checkNotNullExpressionValue(registerForActivityResult, "registerForActivityResul…)\n }\n }");
this.overlayPermissionLauncher = registerForActivityResult;
ActivityResultLauncher<Intent> registerForActivityResult2 = registerForActivityResult((ActivityResultContract) new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
public final void onActivityResult(Object obj) {
Intrinsics.checkNotNullParameter((ActivityResult) obj, "result");
}
});
Intrinsics.checkNotNullExpressionValue(registerForActivityResult2, "registerForActivityResul… ActivityResult ->\n\n }");
this.chatLauncher = registerForActivityResult2;
}
public final HomeViewModel getHomeViewModel() {
return (HomeViewModel) this.homeViewModel.getValue();
}
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 static final void overlayPermissionLauncher$lambda$0(SettingsActivity settingsActivity, ActivityResult activityResult) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Context context = (Context) settingsActivity;
if (Settings.canDrawOverlays(context)) {
((ActivitySettingsBinding) settingsActivity.getBinding()).logsSwitch.setChecked(true);
SharedPref.setBoolean(context, PrefKeys.LOGGING_ENABLED, true);
App.Companion companion = App.Companion;
App.loggingEnabled = true;
FabManager.INSTANCE.initialize(context);
return;
}
((ActivitySettingsBinding) settingsActivity.getBinding()).logsSwitch.setChecked(false);
SharedPref.setBoolean(context, PrefKeys.LOGGING_ENABLED, false);
ActivityExtKt.toast((Activity) settingsActivity, "Overlay permission denied!");
}
@Override
public ActivitySettingsBinding inflateLayout(LayoutInflater layoutInflater) {
Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
ActivitySettingsBinding inflate = ActivitySettingsBinding.inflate(layoutInflater);
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
return inflate;
}
public final ActivityResultLauncher<Intent> getChatLauncher() {
return this.chatLauncher;
}
public final void setChatLauncher(ActivityResultLauncher<Intent> activityResultLauncher) {
Intrinsics.checkNotNullParameter(activityResultLauncher, "<set-?>");
this.chatLauncher = activityResultLauncher;
}
public final AlertDialog getCustomDialog() {
return this.customDialog;
}
public final void setCustomDialog(AlertDialog alertDialog) {
this.customDialog = alertDialog;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getBinding().getRoot());
if (BaseActivity.INSTANCE.isStreamer()) {
this.rtcManager = RtcManagerFactory.createManager$default(null, "ZEGO", 1, null);
}
observeEvent();
getSharedPrefValues();
forUser();
showViews();
onClicks();
getHomeViewModel().getUserDetails();
if (BaseActivity.INSTANCE.isStreamer()) {
getHomeViewModel().getTokenForBeautyVideo();
}
}
private final void getSharedPrefValues() {
int intValue;
Context context = (Context) this;
this.bandwidthInfo = (BandwidthInfo) new Gson().fromJson(SharedPref.getString(context, PrefKeys.INTERNET_BANDWIDTH_CONFIG), BandwidthInfo.class);
String string = SharedPref.getString(context, PrefKeys.TERMS_AND_CONDITIONS);
if (string == null) {
string = "";
}
this.termsAndConditionsUrl = string;
String string2 = SharedPref.getString(context, PrefKeys.PRIVACY_POLICY);
if (string2 == null) {
string2 = "";
}
this.privacyPolicyUrl = string2;
String string3 = SharedPref.getString(context, PrefKeys.COMMUNITY_GUIDELINES);
if (string3 == null) {
string3 = "";
}
this.communityGuidelinesUrl = string3;
String string4 = SharedPref.getString(context, PrefKeys.PRICING_POLICY);
if (string4 == null) {
string4 = "";
}
this.pricingPolicyUrl = string4;
String string5 = SharedPref.getString(context, PrefKeys.COMPLIANCE_STATEMENT);
if (string5 == null) {
string5 = "";
}
this.complianceStatementUrl = string5;
String string6 = SharedPref.getString(context, PrefKeys.CONTENT_MODERATION_POLICY);
this.contentModerationPolicyUrl = string6 != null ? string6 : "";
this.firstRechargeDone = SharedPref.getBoolean(context, PrefKeys.FIRST_RECHARGE_DONE);
Integer num = SharedPref.getInt(context, PrefKeys.CURRENT_LIST_VIEW_TYPE);
BaseActivity.Companion companion = BaseActivity.INSTANCE;
if (num != null && num.intValue() == -1) {
intValue = 1;
} else {
Intrinsics.checkNotNullExpressionValue(num, "currentView");
intValue = num.intValue();
}
BaseActivity.currentListViewType = intValue;
}
private final void showViews() {
LinearLayout linearLayout = getBinding().logsSwitchParent;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.logsSwitchParent");
linearLayout.setVisibility(App.isDevelopmentEnv ? 0 : 8);
LinearLayout linearLayout2 = getBinding().showMyCityParent;
Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.showMyCityParent");
linearLayout2.setVisibility(BaseActivity.INSTANCE.isStreamer() ? 0 : 8);
LinearLayout linearLayout3 = getBinding().hideMyAgeParent;
Intrinsics.checkNotNullExpressionValue(linearLayout3, "binding.hideMyAgeParent");
linearLayout3.setVisibility(BaseActivity.INSTANCE.isStreamer() ? 0 : 8);
if (!BaseActivity.INSTANCE.isStreamer() && !BaseActivity.isAgent && !LoginActivity.INSTANCE.isKandyApps() && !LoginActivity.INSTANCE.isFixyApps() && !LoginActivity.INSTANCE.isOdioApps() && !LoginActivity.INSTANCE.isVliveApps() && !BaseActivity.isPaymentAppMode && this.firstRechargeDone) {
LinearLayout linearLayout4 = getBinding().changeUiStyleParent;
Intrinsics.checkNotNullExpressionValue(linearLayout4, "binding.changeUiStyleParent");
linearLayout4.setVisibility(0);
View view = getBinding().v2;
Intrinsics.checkNotNullExpressionValue(view, "binding.v2");
view.setVisibility(0);
}
if (BaseActivity.currentListViewType == 2) {
handleListGridSelection$default(this, true, false, 2, null);
} else {
handleListGridSelection$default(this, false, false, 3, null);
}
if (BaseActivity.isUser) {
TextView textView = getBinding().reportProblem;
Intrinsics.checkNotNullExpressionValue(textView, "binding.reportProblem");
textView.setVisibility(0);
View view2 = getBinding().viewBelowReportAProblem;
Intrinsics.checkNotNullExpressionValue(view2, "binding.viewBelowReportAProblem");
view2.setVisibility(0);
return;
}
TextView textView2 = getBinding().reportProblem;
Intrinsics.checkNotNullExpressionValue(textView2, "binding.reportProblem");
textView2.setVisibility(8);
View view3 = getBinding().viewBelowReportAProblem;
Intrinsics.checkNotNullExpressionValue(view3, "binding.viewBelowReportAProblem");
view3.setVisibility(8);
}
private final void onClicks() {
getBinding().back.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$2(SettingsActivity.this, view);
}
});
getBinding().btnSwitch.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean onClicks$lambda$3;
onClicks$lambda$3 = SettingsActivity.onClicks$lambda$3(view, motionEvent);
return onClicks$lambda$3;
}
});
getBinding().btnSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$6(SettingsActivity.this, view);
}
});
getBinding().userDndCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$7(SettingsActivity.this, view);
}
});
getBinding().randomCallCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$8(SettingsActivity.this, view);
}
});
getBinding().aiEffectsCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$9(SettingsActivity.this, view);
}
});
getBinding().noLivestreamCallCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$10(SettingsActivity.this, view);
}
});
getBinding().onlyPremiumUserCallCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$11(SettingsActivity.this, view);
}
});
getBinding().blockListBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$13(SettingsActivity.this, view);
}
});
getBinding().logOutBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$14(SettingsActivity.this, view);
}
});
getBinding().privacyPolicyBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$16(SettingsActivity.this, view);
}
});
getBinding().aboutUsBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$18(SettingsActivity.this, view);
}
});
getBinding().termsofUseBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$20(SettingsActivity.this, view);
}
});
getBinding().pricingPolicyBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$22(SettingsActivity.this, view);
}
});
getBinding().communityGuidelines.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$24(SettingsActivity.this, view);
}
});
getBinding().complianceStatement.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$26(SettingsActivity.this, view);
}
});
getBinding().contentModerationPolicy.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$28(SettingsActivity.this, view);
}
});
getBinding().streamerCodeOfConduct.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$30(SettingsActivity.this, view);
}
});
getBinding().streamerAgreement.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$32(SettingsActivity.this, view);
}
});
getBinding().searchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$34(SettingsActivity.this, view);
}
});
getBinding().deleteAccount.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$35(SettingsActivity.this, view);
}
});
getBinding().supportServiceBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$36(SettingsActivity.this, view);
}
});
getBinding().testingBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$38(SettingsActivity.this, view);
}
});
getBinding().uploadLog.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$39(SettingsActivity.this, view);
}
});
getBinding().audioCallCheckbox.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$40(SettingsActivity.this, view);
}
});
getBinding().ourPolicyBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$41(SettingsActivity.this, view);
}
});
getBinding().listLay.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$42(SettingsActivity.this, view);
}
});
getBinding().gridLay.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$43(SettingsActivity.this, view);
}
});
getBinding().logsSwitch.setOnTouchListener(new View.OnTouchListener() {
@Override
public final boolean onTouch(View view, MotionEvent motionEvent) {
boolean onClicks$lambda$44;
onClicks$lambda$44 = SettingsActivity.onClicks$lambda$44(view, motionEvent);
return onClicks$lambda$44;
}
});
getBinding().logsSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$45(SettingsActivity.this, view);
}
});
getBinding().reportProblem.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$47(SettingsActivity.this, view);
}
});
getBinding().ageBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$48(SettingsActivity.this, view);
}
});
getBinding().cityBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.onClicks$lambda$49(SettingsActivity.this, view);
}
});
}
public static final void onClicks$lambda$2(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.finish();
}
public static final boolean onClicks$lambda$3(View view, MotionEvent motionEvent) {
return motionEvent.getAction() == 2;
}
public static final void onClicks$lambda$6(SettingsActivity settingsActivity, View view) {
Unit unit;
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
boolean isChecked = settingsActivity.getBinding().btnSwitch.isChecked();
if (isChecked) {
BandwidthInfo bandwidthInfo = settingsActivity.bandwidthInfo;
if (bandwidthInfo != null) {
if (bandwidthInfo.getCheckBandwidth()) {
BandwidthInfo bandwidthInfo2 = settingsActivity.bandwidthInfo;
Intrinsics.checkNotNull(bandwidthInfo2);
settingsActivity.checkInternetSpeedTest(bandwidthInfo2);
} else {
settingsActivity.getHomeViewModel().goOnlineOrOffline(true);
settingsActivity.getBinding().statusTxt.setText(2131953093);
}
unit = Unit.INSTANCE;
} else {
unit = null;
}
if (unit == null) {
settingsActivity.getHomeViewModel().goOnlineOrOffline(true);
settingsActivity.getBinding().statusTxt.setText(2131953093);
}
StreamerHomeActivity.INSTANCE.setUserOnline(true);
StreamerHomeActivity.INSTANCE.setUserOffline(false);
} else if (BaseActivity.INSTANCE.isStreamer()) {
settingsActivity.getHomeViewModel().goOnlineOrOffline(false);
settingsActivity.getBinding().statusTxt.setText(2131952360);
StreamerHomeActivity.INSTANCE.setUserOffline(true);
StreamerHomeActivity.INSTANCE.setUserOnline(false);
}
settingsActivity.getBinding().btnSwitch.setChecked(!isChecked);
}
public static final void onClicks$lambda$7(final SettingsActivity settingsActivity, View view) {
String str;
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (!((ActivitySettingsBinding) settingsActivity.getBinding()).userDndCheckbox.isChecked()) {
settingsActivity.getHomeViewModel().goOnlineOrOffline(true);
return;
}
if (BaseActivity.isPaymentAppMode) {
str = settingsActivity.getString(2131953049) + '?';
} else {
str = settingsActivity.getString(2131953050) + '?';
}
((ActivitySettingsBinding) settingsActivity.getBinding()).userDndCheckbox.setChecked(false);
DialogHelper.showReasonDialog((Context) settingsActivity, "", str, true, settingsActivity.getString(2131953093), settingsActivity.getString(2131952360), new DialogHelper.Listener() {
@Override
public void onPositiveClick() {
ActivitySettingsBinding binding;
HomeViewModel homeViewModel;
binding = SettingsActivity.this.getBinding();
binding.userDndCheckbox.setChecked(true);
homeViewModel = SettingsActivity.this.getHomeViewModel();
homeViewModel.goOnlineOrOffline(false);
}
@Override
public void onNegativeClick() {
ActivitySettingsBinding binding;
binding = SettingsActivity.this.getBinding();
binding.userDndCheckbox.setChecked(false);
}
});
}
public static final void onClicks$lambda$8(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (settingsActivity.getBinding().randomCallCheckbox.isChecked()) {
settingsActivity.getHomeViewModel().setRandomCall(true);
} else {
settingsActivity.getHomeViewModel().setRandomCall(false);
}
}
public static final void onClicks$lambda$9(final SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (!((ActivitySettingsBinding) settingsActivity.getBinding()).aiEffectsCheckbox.isChecked()) {
DialogHelper.showReasonDialog((Context) settingsActivity, "", settingsActivity.getString(2131951664) + '?', true, settingsActivity.getString(2131953093), settingsActivity.getString(2131952360), new DialogHelper.Listener() {
@Override
public void onPositiveClick() {
ActivitySettingsBinding binding;
RtcManager rtcManager;
binding = SettingsActivity.this.getBinding();
binding.aiEffectsCheckbox.setChecked(false);
rtcManager = SettingsActivity.this.rtcManager;
if (rtcManager != null) {
rtcManager.disableAiEffects((Context) SettingsActivity.this);
}
SettingsActivity settingsActivity2 = SettingsActivity.this;
Activity activity = (Activity) settingsActivity2;
String string = settingsActivity2.getString(2131952530);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.restarting_app)");
ActivityExtKt.toast(activity, string);
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope(SettingsActivity.this), (CoroutineContext) null, (CoroutineStart) null, new SettingsActivity$onClicks$6$1$onPositiveClick$1(SettingsActivity.this, null), 3, (Object) null);
}
@Override
public void onNegativeClick() {
ActivitySettingsBinding binding;
binding = SettingsActivity.this.getBinding();
binding.aiEffectsCheckbox.setChecked(true);
}
});
return;
}
((ActivitySettingsBinding) settingsActivity.getBinding()).aiEffectsCheckbox.setChecked(true);
RtcManager rtcManager = settingsActivity.rtcManager;
if (rtcManager != null) {
rtcManager.enableAIEffects((Context) settingsActivity);
}
String string = settingsActivity.getString(2131952530);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.restarting_app)");
ActivityExtKt.toast((Activity) settingsActivity, string);
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) settingsActivity), (CoroutineContext) null, (CoroutineStart) null, new SettingsActivity$onClicks$6$2(settingsActivity, null), 3, (Object) null);
}
public static final void onClicks$lambda$10(final SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (!((ActivitySettingsBinding) settingsActivity.getBinding()).noLivestreamCallCheckbox.isChecked()) {
settingsActivity.getHomeViewModel().noCallsDuringLivestream(false);
return;
}
((ActivitySettingsBinding) settingsActivity.getBinding()).noLivestreamCallCheckbox.setChecked(false);
DialogHelper.showReasonDialog((Context) settingsActivity, "", settingsActivity.getString(2131952362) + '?', true, settingsActivity.getString(2131953093), settingsActivity.getString(2131952360), new DialogHelper.Listener() {
@Override
public void onPositiveClick() {
ActivitySettingsBinding binding;
HomeViewModel homeViewModel;
binding = SettingsActivity.this.getBinding();
binding.noLivestreamCallCheckbox.setChecked(true);
homeViewModel = SettingsActivity.this.getHomeViewModel();
homeViewModel.noCallsDuringLivestream(true);
}
@Override
public void onNegativeClick() {
ActivitySettingsBinding binding;
HomeViewModel homeViewModel;
binding = SettingsActivity.this.getBinding();
binding.noLivestreamCallCheckbox.setChecked(false);
homeViewModel = SettingsActivity.this.getHomeViewModel();
homeViewModel.noCallsDuringLivestream(false);
}
});
}
public static final void onClicks$lambda$11(final SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (!settingsActivity.getBinding().onlyPremiumUserCallCheckbox.isChecked()) {
settingsActivity.getHomeViewModel().onlyPremiumUserCall(false);
return;
}
settingsActivity.getBinding().onlyPremiumUserCallCheckbox.setChecked(false);
try {
TextToSpeechDialogFragment.INSTANCE.newInstance("इसे चालू करने से आपका कॉल फ्लो काफी कम हो सकता है, क्या आप फिर भी इसे चालू करना चाहते हैं?\n\nEnabling this can significantly reduce your call flow, Do you still want to enable?", "Yes", "No", new Function1<Boolean, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke(((Boolean) obj).booleanValue());
return Unit.INSTANCE;
}
public final void invoke(boolean z) {
ActivitySettingsBinding binding;
HomeViewModel homeViewModel;
ActivitySettingsBinding binding2;
HomeViewModel homeViewModel2;
if (z) {
binding2 = SettingsActivity.this.getBinding();
binding2.onlyPremiumUserCallCheckbox.setChecked(true);
homeViewModel2 = SettingsActivity.this.getHomeViewModel();
homeViewModel2.onlyPremiumUserCall(true);
return;
}
binding = SettingsActivity.this.getBinding();
binding.onlyPremiumUserCallCheckbox.setChecked(false);
homeViewModel = SettingsActivity.this.getHomeViewModel();
homeViewModel.onlyPremiumUserCall(false);
}
}).show(settingsActivity.getSupportFragmentManager(), "textToSpeechDialog");
} catch (Exception e) {
Timber.e(e);
}
}
public static final void onClicks$lambda$13(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.startActivity(new Intent((Context) settingsActivity, (Class<?>) BlockListActivity.class));
}
public static final void onClicks$lambda$14(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.getHomeViewModel().signOut((Context) settingsActivity);
}
public static final void onClicks$lambda$16(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.privacyPolicyUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$18(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", "https://callpe.app/");
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$20(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.termsAndConditionsUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$22(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.pricingPolicyUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$24(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.communityGuidelinesUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$26(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.complianceStatementUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$28(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.contentModerationPolicyUrl);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$30(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.getString(2131952609));
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$32(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Intent intent = new Intent((Context) settingsActivity, (Class<?>) WebViewActivity.class);
intent.putExtra("url", settingsActivity.getString(2131952605));
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$34(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.startActivity(new Intent((Context) settingsActivity, (Class<?>) SearchUserActivity.class));
}
public static final void onClicks$lambda$35(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.showAccountDeleteConfirmDialog();
}
public static final void onClicks$lambda$36(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.chatLauncher.launch(new Intent((Context) settingsActivity, (Class<?>) SupportChatActivity.class));
}
public static final void onClicks$lambda$38(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Context context = (Context) settingsActivity;
if (!ContextExtKt.isConnected(context)) {
Activity activity = (Activity) settingsActivity;
String string = settingsActivity.getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.check_internet_connection)");
ActivityExtKt.toast(activity, string);
return;
}
Intent intent = new Intent(context, (Class<?>) DeviceTestingActivity.class);
intent.putExtra("token", settingsActivity.getHomeViewModel().getBeautyToken());
intent.putExtra("roomId", settingsActivity.getHomeViewModel().getBeautyRoomId());
intent.putExtra("rtcProvider", settingsActivity.getHomeViewModel().getRtcProvider());
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$39(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Context context = (Context) settingsActivity;
if (!ContextExtKt.isConnected(context)) {
Activity activity = (Activity) settingsActivity;
String string = settingsActivity.getString(2131951841);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.check_internet_connection)");
ActivityExtKt.toast(activity, string);
return;
}
LoadingDialog.showLoadingDialog(context, "Uploading logs", "This will take few minutes.");
RtcManager rtcManager = settingsActivity.rtcManager;
if (rtcManager != null) {
rtcManager.uploadLog(new SettingsActivity$onClicks$24$1(settingsActivity, view));
}
}
public static final void onClicks$lambda$40(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (settingsActivity.getBinding().audioCallCheckbox.isChecked()) {
settingsActivity.getHomeViewModel().setVoiceCallCheckBox(true);
} else {
settingsActivity.getHomeViewModel().setVoiceCallCheckBox(false);
}
}
public static final void onClicks$lambda$41(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
boolean z = !settingsActivity.isPolicyListVisible;
settingsActivity.isPolicyListVisible = z;
if (z) {
settingsActivity.getBinding().dropDownIcon.setRotation(180.0f);
} else {
settingsActivity.getBinding().dropDownIcon.setRotation(0.0f);
}
LinearLayout linearLayout = settingsActivity.getBinding().policiesList;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.policiesList");
linearLayout.setVisibility(settingsActivity.isPolicyListVisible ? 0 : 8);
}
public static final void onClicks$lambda$42(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (BaseActivity.currentListViewType == 1) {
return;
}
handleListGridSelection$default(settingsActivity, false, true, 1, null);
}
public static final void onClicks$lambda$43(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (BaseActivity.currentListViewType == 2) {
return;
}
settingsActivity.handleListGridSelection(true, true);
}
public static final boolean onClicks$lambda$44(View view, MotionEvent motionEvent) {
return motionEvent.getAction() == 2;
}
public static final void onClicks$lambda$45(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.handleLogsSwitch();
}
public static final void onClicks$lambda$47(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
Context context = (Context) settingsActivity;
String string = SharedPref.getString(context, PrefKeys.GRIEVANCE_FORM_URL);
Intent intent = new Intent(context, (Class<?>) WebViewActivity.class);
intent.putExtra("url", string);
settingsActivity.startActivity(intent);
}
public static final void onClicks$lambda$48(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (settingsActivity.getBinding().ageBtn.isChecked()) {
settingsActivity.getHomeViewModel().showAndHideAge(true);
} else {
settingsActivity.getHomeViewModel().showAndHideAge(false);
}
}
public static final void onClicks$lambda$49(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
if (settingsActivity.getBinding().cityBtn.isChecked()) {
settingsActivity.getHomeViewModel().showAndHideMyCity(true);
} else {
settingsActivity.getHomeViewModel().showAndHideMyCity(false);
}
}
private final void checkInternetSpeedTest(BandwidthInfo bandwidthInfo) {
ProgressDialog progressDialog = new ProgressDialog((Context) this, 0, 2, (DefaultConstructorMarker) null);
progressDialog.setMessage("Checking Network Status...");
progressDialog.setCancelable(false);
progressDialog.show();
String speedTestDownloadUrl = bandwidthInfo.getSpeedTestDownloadUrl();
if (speedTestDownloadUrl == null) {
speedTestDownloadUrl = "http://speedtest.tele2.net/1MB.zip";
}
String str = speedTestDownloadUrl;
String speedTestUploadUrl = bandwidthInfo.getSpeedTestUploadUrl();
if (speedTestUploadUrl == null) {
speedTestUploadUrl = "https://store1.gofile.io/uploadFile";
}
InternetSpeedTest.INSTANCE.checkSpeed(str, speedTestUploadUrl, bandwidthInfo.getMinDownloadSpeedInKBps(), bandwidthInfo.getMinUploadSpeedInKBps(), new SettingsActivity$checkInternetSpeedTest$1(progressDialog, this));
}
public final void showAgeStatus(boolean showAge) {
getBinding().ageBtn.setChecked(showAge);
}
public final void showCityStatus(boolean showCity) {
getBinding().cityBtn.setChecked(showCity);
}
private final void handleLogsSwitch() {
if (((ActivitySettingsBinding) getBinding()).logsSwitch.isChecked()) {
Context context = (Context) this;
if (Settings.canDrawOverlays(context)) {
SharedPref.setBoolean(context, PrefKeys.LOGGING_ENABLED, true);
App.Companion companion = App.Companion;
App.loggingEnabled = true;
FabManager.INSTANCE.initialize(context);
FabManager.INSTANCE.showFab();
return;
}
((ActivitySettingsBinding) getBinding()).logsSwitch.setChecked(false);
DialogHelper.showReasonDialog(context, "", "This will redirect you to overlay permission settings. Please make sure to search for " + getString(2131951675) + " and enable it.\nAre you sure you want to give the permission ?", true, getString(2131953093), getString(2131952360), new DialogHelper.Listener() {
@Override
public void onPositiveClick() {
ActivityResultLauncher activityResultLauncher;
if (Settings.canDrawOverlays((Context) SettingsActivity.this)) {
return;
}
Intent intent = new Intent("android.settings.action.MANAGE_OVERLAY_PERMISSION", Uri.parse("package:" + SettingsActivity.this.getPackageName()));
activityResultLauncher = SettingsActivity.this.overlayPermissionLauncher;
activityResultLauncher.launch(intent);
}
@Override
public void onNegativeClick() {
ActivitySettingsBinding binding;
binding = SettingsActivity.this.getBinding();
binding.logsSwitch.setChecked(false);
FabManager.INSTANCE.hideFab();
App.Companion companion2 = App.Companion;
App.loggingEnabled = false;
}
});
return;
}
SharedPref.setBoolean((Context) this, PrefKeys.LOGGING_ENABLED, false);
FabManager.INSTANCE.hideFab();
App.Companion companion2 = App.Companion;
App.loggingEnabled = false;
}
private final void checkForOverlayPermissionChange() {
Context context = (Context) this;
if (!Settings.canDrawOverlays(context)) {
((ActivitySettingsBinding) getBinding()).logsSwitch.setChecked(false);
} else {
((ActivitySettingsBinding) getBinding()).logsSwitch.setChecked(SharedPref.getBoolean(context, PrefKeys.LOGGING_ENABLED));
}
}
static void handleListGridSelection$default(SettingsActivity settingsActivity, boolean z, boolean z2, int i, Object obj) {
if ((i & 1) != 0) {
z = false;
}
if ((i & 2) != 0) {
z2 = false;
}
settingsActivity.handleListGridSelection(z, z2);
}
private final void handleListGridSelection(boolean gridSelected, boolean refresh) {
try {
if (gridSelected) {
((ActivitySettingsBinding) getBinding()).gridLay.setBackgroundResource(2131232078);
((ActivitySettingsBinding) getBinding()).listLay.setBackgroundResource(0);
((ActivitySettingsBinding) getBinding()).gridIcon.setColorFilter(ContextCompat.getColor((Context) this, 2131099815));
((ActivitySettingsBinding) getBinding()).listIcon.setColorFilter(ContextCompat.getColor((Context) this, R.color.black_70));
SharedPref.setInt((Context) this, PrefKeys.CURRENT_LIST_VIEW_TYPE, 2);
BaseActivity.Companion companion = BaseActivity.INSTANCE;
BaseActivity.currentListViewType = 2;
} else {
((ActivitySettingsBinding) getBinding()).listLay.setBackgroundResource(2131232078);
((ActivitySettingsBinding) getBinding()).gridLay.setBackgroundResource(0);
((ActivitySettingsBinding) getBinding()).listIcon.setColorFilter(ContextCompat.getColor((Context) this, 2131099815));
((ActivitySettingsBinding) getBinding()).gridIcon.setColorFilter(ContextCompat.getColor((Context) this, R.color.black_70));
BaseActivity.Companion companion2 = BaseActivity.INSTANCE;
BaseActivity.currentListViewType = 1;
SharedPref.setInt((Context) this, PrefKeys.CURRENT_LIST_VIEW_TYPE, 1);
}
if (refresh) {
NewStreamersListFragment.INSTANCE.setGridUiUpdatedForNewStreamerListScreen(true);
FavouriteV2Fragment.INSTANCE.setGridUiUpdatedForFollowerListScreen(true);
StreamerListFragment.INSTANCE.setGridUiUpdatedForStreamerListScreen(true);
NearbyStreamersFragment.INSTANCE.setGridUiUpdatedForNewStreamerListScreen(true);
}
} catch (Exception e) {
Timber.e(e);
}
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new SettingsActivity$observeEvent$1(this, null), 3, (Object) null);
}
public final void clearDb() {
LocalDB.databaseWriteExecutor.execute(new Runnable() {
@Override
public final void run() {
SettingsActivity.clearDb$lambda$51(SettingsActivity.this);
}
});
Context context = (Context) this;
SharedPref.setInt(context, PrefKeys.USER_BET_AMOUNT, 1);
SharedPref.setBoolean(context, PrefKeys.NAV_CHANGE_REFLECTED, false);
}
public static final void clearDb$lambda$51(SettingsActivity settingsActivity) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.getLocalDB().groupChatDao().dropGroupNotification();
}
public final void setCheckBoxValues(User user) {
getBinding().randomCallCheckbox.setChecked(user.getRandomCalls());
getBinding().noLivestreamCallCheckbox.setChecked(user.getNoCallsDuringLivestream());
getBinding().onlyPremiumUserCallCheckbox.setChecked(user.getOnlyPremiumUsers());
if (!BaseActivity.INSTANCE.isStreamer() || LoginActivity.INSTANCE.isKandy() || LoginActivity.INSTANCE.isFixy() || LoginActivity.INSTANCE.isOdio()) {
return;
}
LinearLayout linearLayout = getBinding().onlyPremiumUserCallParentLayout;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.onlyPremiumUserCallParentLayout");
linearLayout.setVisibility(user.getRateControl() ^ true ? 0 : 8);
View view = getBinding().viewBelowOnlyPremiumCall;
Intrinsics.checkNotNullExpressionValue(view, "binding.viewBelowOnlyPremiumCall");
view.setVisibility(user.getRateControl() ^ true ? 0 : 8);
}
public final void showSupportServiceForUsers(app.callpe.data.model.Metadata metadata) {
User user = metadata.getUser();
int rechargeCount = user.getRechargeCount();
boolean disableSupportChat = user.getDisableSupportChat();
LinearLayout linearLayout = getBinding().supportServiceParent;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.supportServiceParent");
linearLayout.setVisibility(!BaseActivity.INSTANCE.isStreamer() && !BaseActivity.isAgent && rechargeCount > 0 && !disableSupportChat ? 0 : 8);
}
public final void showSearchOption(boolean callpeAdmin) {
TextView textView = getBinding().searchBtn;
Intrinsics.checkNotNullExpressionValue(textView, "binding.searchBtn");
textView.setVisibility(callpeAdmin ? 0 : 8);
}
private final void forUser() {
if (!BaseActivity.INSTANCE.isStreamer() && !BaseActivity.isAgent) {
((ActivitySettingsBinding) getBinding()).userDndCheckbox.setVisibility(0);
((ActivitySettingsBinding) getBinding()).statusTxt.setVisibility(8);
((ActivitySettingsBinding) getBinding()).btnSwitch.setVisibility(8);
((ActivitySettingsBinding) getBinding()).onlineTv.setText(getString(2131951950));
LinearLayout linearLayout = ((ActivitySettingsBinding) getBinding()).userUrls;
Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.userUrls");
linearLayout.setVisibility(0);
LinearLayout linearLayout2 = ((ActivitySettingsBinding) getBinding()).streamerUrls;
Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.streamerUrls");
linearLayout2.setVisibility(8);
TextView textView = ((ActivitySettingsBinding) getBinding()).blockListBtn;
Intrinsics.checkNotNullExpressionValue(textView, "binding.blockListBtn");
textView.setVisibility(8);
}
if (BaseActivity.INSTANCE.isStreamer()) {
TextView textView2 = ((ActivitySettingsBinding) getBinding()).blockListBtn;
Intrinsics.checkNotNullExpressionValue(textView2, "binding.blockListBtn");
textView2.setVisibility(0);
LinearLayout linearLayout3 = ((ActivitySettingsBinding) getBinding()).aiEffectsParentLayout;
Intrinsics.checkNotNullExpressionValue(linearLayout3, "binding.aiEffectsParentLayout");
linearLayout3.setVisibility(0);
View view = ((ActivitySettingsBinding) getBinding()).v3;
Intrinsics.checkNotNullExpressionValue(view, "binding.v3");
view.setVisibility(0);
CheckBox checkBox = ((ActivitySettingsBinding) getBinding()).aiEffectsCheckbox;
RtcManager rtcManager = this.rtcManager;
checkBox.setChecked(rtcManager != null && rtcManager.isAIEffectsEnabled((Context) this));
LinearLayout linearLayout4 = ((ActivitySettingsBinding) getBinding()).noLivestreamCallParentLayout;
Intrinsics.checkNotNullExpressionValue(linearLayout4, "binding.noLivestreamCallParentLayout");
linearLayout4.setVisibility(!LoginActivity.INSTANCE.isKandy() && !LoginActivity.INSTANCE.isFixy() && !LoginActivity.INSTANCE.isOdio() ? 0 : 8);
View view2 = ((ActivitySettingsBinding) getBinding()).viewBelowNoLivestreamCall;
Intrinsics.checkNotNullExpressionValue(view2, "binding.viewBelowNoLivestreamCall");
view2.setVisibility((LoginActivity.INSTANCE.isKandy() || LoginActivity.INSTANCE.isFixy() || LoginActivity.INSTANCE.isOdio()) ? false : true ? 0 : 8);
LinearLayout linearLayout5 = ((ActivitySettingsBinding) getBinding()).userUrls;
Intrinsics.checkNotNullExpressionValue(linearLayout5, "binding.userUrls");
linearLayout5.setVisibility(8);
LinearLayout linearLayout6 = ((ActivitySettingsBinding) getBinding()).streamerUrls;
Intrinsics.checkNotNullExpressionValue(linearLayout6, "binding.streamerUrls");
linearLayout6.setVisibility(0);
}
if (BaseActivity.isAgent) {
TextView textView3 = ((ActivitySettingsBinding) getBinding()).blockListBtn;
Intrinsics.checkNotNullExpressionValue(textView3, "binding.blockListBtn");
textView3.setVisibility(8);
LinearLayout linearLayout7 = ((ActivitySettingsBinding) getBinding()).onlineParentLayout;
Intrinsics.checkNotNullExpressionValue(linearLayout7, "binding.onlineParentLayout");
linearLayout7.setVisibility(8);
View view3 = ((ActivitySettingsBinding) getBinding()).v1;
Intrinsics.checkNotNullExpressionValue(view3, "binding.v1");
view3.setVisibility(8);
}
}
public final void showOnlineOrOfflineBtn(boolean online) {
if (online) {
if (BaseActivity.INSTANCE.isStreamer()) {
starServiceFunc();
((ActivitySettingsBinding) getBinding()).btnSwitch.setChecked(true);
((ActivitySettingsBinding) getBinding()).statusTxt.setText(2131953093);
View view = ((ActivitySettingsBinding) getBinding()).testingBtn;
Intrinsics.checkNotNullExpressionValue(view, "binding.testingBtn");
view.setVisibility(8);
return;
}
((ActivitySettingsBinding) getBinding()).userDndCheckbox.setChecked(false);
return;
}
if (BaseActivity.INSTANCE.isStreamer()) {
stopServiceFunc();
((ActivitySettingsBinding) getBinding()).btnSwitch.setChecked(false);
((ActivitySettingsBinding) getBinding()).statusTxt.setText(2131952360);
View view2 = ((ActivitySettingsBinding) getBinding()).testingBtn;
Intrinsics.checkNotNullExpressionValue(view2, "binding.testingBtn");
View view3 = view2;
RtcManager rtcManager = this.rtcManager;
view3.setVisibility(rtcManager != null && rtcManager.isAIEffectsEnabled((Context) this) ? 0 : 8);
return;
}
((ActivitySettingsBinding) getBinding()).userDndCheckbox.setChecked(true);
}
public final void stopServiceFunc() {
PingService pingService = new PingService();
Intent intent = new Intent((Context) this, pingService.getClass());
if (Utils.isMyServiceRunning(pingService.getClass(), (Activity) this)) {
stopService(intent);
Timber.d("Service stopped!!", new Object[0]);
} else {
Timber.d("Service is already stopped!!", new Object[0]);
}
}
private final void starServiceFunc() {
PingService pingService = new PingService();
Intent intent = new Intent((Context) this, pingService.getClass());
Activity activity = (Activity) this;
if (!Utils.isMyServiceRunning(pingService.getClass(), activity)) {
try {
startService(intent);
Timber.d("Service started successfully", new Object[0]);
return;
} catch (Exception e) {
String message = e.getMessage();
if (message == null) {
message = "";
}
ActivityExtKt.toast(activity, message);
return;
}
}
Timber.d("Service is already running", new Object[0]);
}
private final void showAccountDeleteConfirmDialog() {
Window window;
Window window2;
Window window3;
Context context = (Context) this;
final DeleteConfirmDialogBinding inflate = DeleteConfirmDialogBinding.inflate(LayoutInflater.from(context));
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(LayoutInflater.from(context))");
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setView((View) inflate.getRoot());
builder.setCancelable(true);
this.customDialog = builder.create();
inflate.titleTextView.setText("This will delete your account permanently. You will not be able to recover any data. Type 'DELETE' to confirm.");
inflate.dialogIcon.setImageDrawable(ContextCompat.getDrawable(context, 2131231749));
inflate.deleteEdt.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Editable text = DeleteConfirmDialogBinding.this.deleteEdt.getText();
if (!(text == null || text.length() == 0)) {
MaterialButton materialButton = DeleteConfirmDialogBinding.this.deleteButton;
String lowerCase = String.valueOf(DeleteConfirmDialogBinding.this.deleteEdt.getText()).toLowerCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
materialButton.setEnabled(Intrinsics.areEqual(StringsKt.trim(lowerCase).toString(), "delete"));
return;
}
DeleteConfirmDialogBinding.this.deleteButton.setEnabled(false);
}
});
inflate.deleteButton.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.showAccountDeleteConfirmDialog$lambda$52(SettingsActivity.this, view);
}
});
inflate.closeIcon.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SettingsActivity.showAccountDeleteConfirmDialog$lambda$53(SettingsActivity.this, view);
}
});
AlertDialog alertDialog = this.customDialog;
if (alertDialog != null && (window3 = alertDialog.getWindow()) != null) {
window3.setBackgroundDrawableResource(android.R.color.transparent);
}
AlertDialog alertDialog2 = this.customDialog;
if (alertDialog2 != null && (window2 = alertDialog2.getWindow()) != null) {
window2.clearFlags(131080);
}
AlertDialog alertDialog3 = this.customDialog;
if (alertDialog3 != null && (window = alertDialog3.getWindow()) != null) {
window.setSoftInputMode(4);
}
inflate.deleteEdt.requestFocus();
AlertDialog alertDialog4 = this.customDialog;
if (alertDialog4 != null) {
alertDialog4.show();
}
}
public static final void showAccountDeleteConfirmDialog$lambda$52(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
settingsActivity.getHomeViewModel().deleteAccount();
}
public static final void showAccountDeleteConfirmDialog$lambda$53(SettingsActivity settingsActivity, View view) {
Intrinsics.checkNotNullParameter(settingsActivity, "this$0");
AlertDialog alertDialog = settingsActivity.customDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
protected void onResume() {
super.onResume();
checkForOverlayPermissionChange();
}
protected void onDestroy() {
super.onDestroy();
AlertDialog alertDialog = this.customDialog;
if (alertDialog != null) {
alertDialog.dismiss();
}
}
}