导航菜单

页面标题

页面副标题

Biko v2.0.23 - NonLiveMyProfileActivity.java 源代码

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

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


package app.callpe.ui.user;

import android.R;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
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.common.utils.DateHelper;
import app.callpe.common.utils.ResultState;
import app.callpe.common.utils.custom.DatePickerView;
import app.callpe.common.utils.custom.ProfilePhotoPickerView;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.extensions.StringExtKt;
import app.callpe.data.model.InterestResponse;
import app.callpe.data.model.LanguageResponse;
import app.callpe.data.model.User;
import app.callpe.data.repository.upload.UploadProgressHelper;
import app.callpe.databinding.ActivityNonLiveProfileBinding;
import app.callpe.service.FirebaseNotificationService;
import app.callpe.ui.bottomsheet.InterestAndLanguage;
import app.callpe.ui.home.StreamerHomeActivity;
import com.facebook.internal.NativeProtocol;
import com.google.android.material.chip.Chip;
import com.google.android.material.textfield.TextInputEditText;
import dagger.hilt.android.AndroidEntryPoint;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.TypeIntrinsics;
import kotlin.text.Regex;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import pub.devrel.easypermissions.EasyPermissions;
import pub.devrel.easypermissions.PermissionRequest;
import timber.log.Timber;

@Metadata(d1 = {"\u0000\u0098\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\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010!\n\u0002\b\u0004\n\u0002\u0010\u0015\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\b\u0007\u0018\u0000 S2\u00020\u00012\u00020\u0002:\u0002STB\u0005¢\u0006\u0002\u0010\u0003J\b\u0010%\u001a\u00020&H\u0002J\b\u0010'\u001a\u00020&H\u0002J\b\u0010(\u001a\u00020&H\u0002J\u0010\u0010)\u001a\u00020&2\u0006\u0010\u001a\u001a\u00020\u0013H\u0002J\b\u0010*\u001a\u00020&H\u0002J\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\u00100\u001a\u00020&2\b\u00101\u001a\u0004\u0018\u000102H\u0014J\u0010\u00103\u001a\u00020\u00132\u0006\u00104\u001a\u000205H\u0016J\u001e\u00106\u001a\u00020&2\u0006\u00107\u001a\u0002082\f\u00109\u001a\b\u0012\u0004\u0012\u00020\u00060:H\u0016J\u001e\u0010;\u001a\u00020&2\u0006\u00107\u001a\u0002082\f\u00109\u001a\b\u0012\u0004\u0012\u00020\u00060:H\u0016J-\u0010<\u001a\u00020&2\u0006\u00107\u001a\u0002082\u000e\u0010=\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u00052\u0006\u0010>\u001a\u00020?H\u0016¢\u0006\u0002\u0010@J\u0010\u0010A\u001a\u00020&2\u0006\u0010B\u001a\u00020CH\u0002J\b\u0010D\u001a\u00020&H\u0002J\b\u0010E\u001a\u00020&H\u0002J\b\u0010F\u001a\u00020&H\u0002J \u0010G\u001a\u00020&2\u0016\u0010H\u001a\u0012\u0012\u0004\u0012\u00020I0\fj\b\u0012\u0004\u0012\u00020I`\rH\u0002J \u0010J\u001a\u00020&2\u0016\u0010K\u001a\u0012\u0012\u0004\u0012\u00020L0\fj\b\u0012\u0004\u0012\u00020L`\rH\u0002J\b\u0010M\u001a\u00020&H\u0002J\u0010\u0010N\u001a\u00020&2\u0006\u0010O\u001a\u00020\u0013H\u0002J\b\u0010P\u001a\u00020&H\u0002J\b\u0010Q\u001a\u00020&H\u0002J\b\u0010R\u001a\u00020&H\u0002R\u0016\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\u000e\u0010\t\u001a\u00020\nX\u0082.¢\u0006\u0002\n\u0000R*\u0010\u000b\u001a\u0012\u0012\u0004\u0012\u00020\u00060\fj\b\u0012\u0004\u0012\u00020\u0006`\rX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u001a\u0010\u0012\u001a\u00020\u0013X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\u0014\"\u0004\b\u0015\u0010\u0016R*\u0010\u0017\u001a\u0012\u0012\u0004\u0012\u00020\u00060\fj\b\u0012\u0004\u0012\u00020\u0006`\rX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0018\u0010\u000f\"\u0004\b\u0019\u0010\u0011R\u000e\u0010\u001a\u001a\u00020\u0013X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u001cX\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\u001d\u001a\u0004\u0018\u00010\u001eX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u001f\u001a\u00020 8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b#\u0010$\u001a\u0004\b!\u0010\"¨\u0006U"}, d2 = {"Lapp/callpe/ui/user/NonLiveMyProfileActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "Lpub/devrel/easypermissions/EasyPermissions$PermissionCallbacks;", "()V", "PERMISSIONS_Q", "", "", "[Ljava/lang/String;", "PERMISSIONS_R", "binding", "Lapp/callpe/databinding/ActivityNonLiveProfileBinding;", "interestList", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "getInterestList", "()Ljava/util/ArrayList;", "setInterestList", "(Ljava/util/ArrayList;)V", "isInterest", "", "()Z", "setInterest", "(Z)V", "languageList", "getLanguageList", "setLanguageList", "openedFromSideBarList", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "uploadProgressHelper", "Lapp/callpe/data/repository/upload/UploadProgressHelper;", "viewModel", "Lapp/callpe/ui/user/UserViewModel;", "getViewModel", "()Lapp/callpe/ui/user/UserViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "femaleSelected", "", "getIntentValues", "goToHomeActivity", "handleVisibility", "maleSelected", "observeEditText", "observeEvent", "Lkotlinx/coroutines/Job;", "observeUploadProgress", "onClick", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onPermissionsDenied", "requestCode", "", "perms", "", "onPermissionsGranted", "onRequestPermissionsResult", NativeProtocol.RESULT_ARGS_PERMISSIONS, "grantResults", "", "(I[Ljava/lang/String;[I)V", "prefillData", "data", "Lapp/callpe/data/model/Metadata;", "refresh", "requestPermissions", "save", "setUpChosenInterestList", "interests", "Lapp/callpe/data/model/InterestResponse;", "setUpChosenLanguageList", "languages", "Lapp/callpe/data/model/LanguageResponse;", "setUpToolbar", "showCityStatus", "showCity", "showDobPickerDialog", "showGenderDialog", "updateUser", "Companion", "StreamerStatus", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class NonLiveMyProfileActivity extends Hilt_NonLiveMyProfileActivity implements EasyPermissions.PermissionCallbacks {
    public static final int RC_STORAGE_PERMISSION = 1010;
    private ActivityNonLiveProfileBinding binding;
    private boolean openedFromSideBarList;
    private Toolbar toolbar;
    private UploadProgressHelper uploadProgressHelper;

    private final Lazy viewModel;
    private boolean isInterest = true;
    private ArrayList<String> interestList = new ArrayList<>();
    private ArrayList<String> languageList = new ArrayList<>();
    private final String[] PERMISSIONS_R = {"android.permission.CAMERA", "android.permission.READ_EXTERNAL_STORAGE"};
    private final String[] PERMISSIONS_Q = {"android.permission.CAMERA", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"};

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0005\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005¨\u0006\u0006"}, d2 = {"Lapp/callpe/ui/user/NonLiveMyProfileActivity$StreamerStatus;", "", "(Ljava/lang/String;I)V", "CREATED", "APPROVED", "REJECTED", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public enum StreamerStatus {
        CREATED,
        APPROVED,
        REJECTED
    }

    public void onPermissionsGranted(int requestCode, List<String> perms) {
        Intrinsics.checkNotNullParameter(perms, "perms");
    }

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

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

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

            public final CreationExtras m2228invoke() {
                CreationExtras creationExtras;
                Function0 function02 = function0;
                return (function02 == null || (creationExtras = (CreationExtras) function02.invoke()) == null) ? componentActivity.getDefaultViewModelCreationExtras() : creationExtras;
            }
        });
    }

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

    public final boolean getIsInterest() {
        return this.isInterest;
    }

    public final void setInterest(boolean z) {
        this.isInterest = z;
    }

    public final ArrayList<String> getInterestList() {
        return this.interestList;
    }

    public final void setInterestList(ArrayList<String> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.interestList = arrayList;
    }

    public final ArrayList<String> getLanguageList() {
        return this.languageList;
    }

    public final void setLanguageList(ArrayList<String> arrayList) {
        Intrinsics.checkNotNullParameter(arrayList, "<set-?>");
        this.languageList = arrayList;
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityNonLiveProfileBinding inflate = ActivityNonLiveProfileBinding.inflate(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        this.binding = inflate;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = null;
        if (inflate == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            inflate = null;
        }
        setContentView(inflate.getRoot());
        this.openedFromSideBarList = getIntent().getBooleanExtra("openedFromSideBarList", false);
        setUpToolbar();
        requestPermissions();
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
        if (activityNonLiveProfileBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding2 = null;
        }
        activityNonLiveProfileBinding2.photoPicker.setCustomCamera(true);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding3 = null;
        }
        activityNonLiveProfileBinding3.photoPicker.setHideDelete(true);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding = activityNonLiveProfileBinding4;
        }
        activityNonLiveProfileBinding.videoPicker.setHideDelete(true);
        this.uploadProgressHelper = new UploadProgressHelper((Context) this, (Activity) this);
        observeEvent();
        observeUploadProgress();
        onClick();
        getIntentValues();
        observeEditText();
        handleVisibility(this.openedFromSideBarList);
    }

    private final void handleVisibility(boolean openedFromSideBarList) {
        if (openedFromSideBarList) {
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = null;
            if (activityNonLiveProfileBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding = null;
            }
            activityNonLiveProfileBinding.title.setText(getString(2131952337));
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
            if (activityNonLiveProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding3 = null;
            }
            TextView textView = activityNonLiveProfileBinding3.myPhotoTextView;
            Intrinsics.checkNotNullExpressionValue(textView, "binding.myPhotoTextView");
            textView.setVisibility(8);
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
            if (activityNonLiveProfileBinding4 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding4 = null;
            }
            LinearLayout linearLayout = activityNonLiveProfileBinding4.topParentLL;
            Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.topParentLL");
            linearLayout.setVisibility(8);
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = this.binding;
            if (activityNonLiveProfileBinding5 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityNonLiveProfileBinding2 = activityNonLiveProfileBinding5;
            }
            LinearLayout linearLayout2 = activityNonLiveProfileBinding2.aboutMeParentLL;
            Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.aboutMeParentLL");
            linearLayout2.setVisibility(8);
        }
    }

    private final void setUpToolbar() {
        try {
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
            Toolbar toolbar = null;
            if (activityNonLiveProfileBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding = null;
            }
            Toolbar toolbar2 = activityNonLiveProfileBinding.toolbar;
            Intrinsics.checkNotNullExpressionValue(toolbar2, "binding.toolbar");
            this.toolbar = toolbar2;
            if (toolbar2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("toolbar");
            } else {
                toolbar = toolbar2;
            }
            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 getIntentValues() {
        getViewModel().setEdit(true);
        UserViewModel.getUserDetails$default(getViewModel(), false, 1, null);
    }

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

    public final void prefillData(app.callpe.data.model.Metadata data) {
        getViewModel().setUser(data.getUser());
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        ProfilePhotoPickerView profilePhotoPickerView = activityNonLiveProfileBinding.photoPicker;
        List<String> pictures = data.getUser().getPictures();
        Intrinsics.checkNotNull(pictures, "null cannot be cast to non-null type java.util.ArrayList<kotlin.String>{ kotlin.collections.TypeAliasesKt.ArrayList<kotlin.String> }");
        profilePhotoPickerView.addItems((ArrayList) pictures);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
        if (activityNonLiveProfileBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding2 = null;
        }
        activityNonLiveProfileBinding2.videoPicker.addItem(data.getUser().getIntroVideo());
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding3 = null;
        }
        TextInputEditText textInputEditText = activityNonLiveProfileBinding3.aboutMe;
        String aboutMe = data.getUser().getAboutMe();
        if (aboutMe == null) {
            aboutMe = "";
        }
        textInputEditText.setText(aboutMe);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding4 = null;
        }
        activityNonLiveProfileBinding4.videoPicker.hideAddBtn(true);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = this.binding;
        if (activityNonLiveProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding5 = null;
        }
        EditText editText = activityNonLiveProfileBinding5.name;
        String name = data.getUser().getName();
        editText.setText(name != null ? name : "");
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding6 = this.binding;
        if (activityNonLiveProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding6 = null;
        }
        activityNonLiveProfileBinding6.gender.setText(data.getUser().getGender());
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding7 = this.binding;
        if (activityNonLiveProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding7 = null;
        }
        TextView textView = activityNonLiveProfileBinding7.dob;
        String dob = data.getUser().getDob();
        textView.setText(dob != null ? StringExtKt.formatDateByPattern(dob, "yyyy-MM-dd", "dd-MMM-yyyy") : null);
    }

    public final void updateUser() {
        UploadProgressHelper uploadProgressHelper = this.uploadProgressHelper;
        if (uploadProgressHelper != null) {
            uploadProgressHelper.dismiss();
        }
        finish();
    }

    private final void goToHomeActivity() {
        Intent intent = new Intent((Context) this, (Class<?>) StreamerHomeActivity.class);
        intent.addFlags(268468224);
        startActivity(intent);
        overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
    }

    private final void observeUploadProgress() {
        getViewModel().getResult().observe((LifecycleOwner) this, new NonLiveMyProfileActivity$sam$androidx_lifecycle_Observer$0(new Function1<ResultState<? extends Double>, Unit>() {

            @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
            public class WhenMappings {
                public static final int[] $EnumSwitchMapping$0;

                static {
                    int[] iArr = new int[ResultState.Status.values().length];
                    try {
                        iArr[ResultState.Status.LOADING.ordinal()] = 1;
                    } catch (NoSuchFieldError unused) {
                    }
                    try {
                        iArr[ResultState.Status.ERROR.ordinal()] = 2;
                    } catch (NoSuchFieldError unused2) {
                    }
                    try {
                        iArr[ResultState.Status.SUCCESS.ordinal()] = 3;
                    } catch (NoSuchFieldError unused3) {
                    }
                    try {
                        iArr[ResultState.Status.RESET.ordinal()] = 4;
                    } catch (NoSuchFieldError unused4) {
                    }
                    $EnumSwitchMapping$0 = iArr;
                }
            }

            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((ResultState<Double>) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(ResultState<Double> resultState) {
                UploadProgressHelper uploadProgressHelper;
                UploadProgressHelper uploadProgressHelper2;
                UploadProgressHelper uploadProgressHelper3;
                UploadProgressHelper uploadProgressHelper4;
                UploadProgressHelper uploadProgressHelper5;
                int i = WhenMappings.$EnumSwitchMapping$0[resultState.getStatus().ordinal()];
                if (i == 1) {
                    uploadProgressHelper = NonLiveMyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper != null) {
                        Double data = resultState.getData();
                        uploadProgressHelper.progressDialogPercent(data != null ? (float) data.doubleValue() : 0.0f);
                        return;
                    }
                    return;
                }
                if (i == 2) {
                    uploadProgressHelper2 = NonLiveMyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper2 != null) {
                        uploadProgressHelper2.dismiss();
                        return;
                    }
                    return;
                }
                if (i == 3) {
                    uploadProgressHelper3 = NonLiveMyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper3 != null) {
                        uploadProgressHelper3.dismiss();
                        return;
                    }
                    return;
                }
                if (i != 4) {
                    return;
                }
                uploadProgressHelper4 = NonLiveMyProfileActivity.this.uploadProgressHelper;
                if (uploadProgressHelper4 != null) {
                    uploadProgressHelper4.dismiss();
                }
                uploadProgressHelper5 = NonLiveMyProfileActivity.this.uploadProgressHelper;
                if (uploadProgressHelper5 != null) {
                    uploadProgressHelper5.setProgressDialog();
                }
            }
        }));
    }

    private final void onClick() {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = null;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.videoPicker.setCameraAndGallery(true);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding3 = null;
        }
        activityNonLiveProfileBinding3.submitBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$0(NonLiveMyProfileActivity.this, view);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding4 = null;
        }
        activityNonLiveProfileBinding4.cityBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$1(NonLiveMyProfileActivity.this, view);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = this.binding;
        if (activityNonLiveProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding5 = null;
        }
        activityNonLiveProfileBinding5.editInterest.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$2(NonLiveMyProfileActivity.this, view);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding6 = this.binding;
        if (activityNonLiveProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding6 = null;
        }
        activityNonLiveProfileBinding6.editLanguage.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$3(NonLiveMyProfileActivity.this, view);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding7 = this.binding;
        if (activityNonLiveProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding7 = null;
        }
        activityNonLiveProfileBinding7.editDob.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$4(NonLiveMyProfileActivity.this, view);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding8 = this.binding;
        if (activityNonLiveProfileBinding8 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding2 = activityNonLiveProfileBinding8;
        }
        activityNonLiveProfileBinding2.editGender.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.onClick$lambda$5(NonLiveMyProfileActivity.this, view);
            }
        });
    }

    public static final void onClick$lambda$0(NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        nonLiveMyProfileActivity.save();
    }

    public static final void onClick$lambda$1(NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = nonLiveMyProfileActivity.binding;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = null;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        if (activityNonLiveProfileBinding.cityBtn.isChecked()) {
            nonLiveMyProfileActivity.getViewModel().showAndHideMyCity(true);
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = nonLiveMyProfileActivity.binding;
            if (activityNonLiveProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityNonLiveProfileBinding2 = activityNonLiveProfileBinding3;
            }
            activityNonLiveProfileBinding2.statusTxt.setText(2131953093);
            return;
        }
        nonLiveMyProfileActivity.getViewModel().showAndHideMyCity(false);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = nonLiveMyProfileActivity.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding2 = activityNonLiveProfileBinding4;
        }
        activityNonLiveProfileBinding2.statusTxt.setText(2131952360);
    }

    public static final void onClick$lambda$2(final NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        nonLiveMyProfileActivity.isInterest = true;
        InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(nonLiveMyProfileActivity.isInterest, nonLiveMyProfileActivity.interestList, nonLiveMyProfileActivity.languageList);
        newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
            @Override
            public void onBottomSheetDismissed() {
                NonLiveMyProfileActivity.this.refresh();
            }
        });
        newInstance.show(nonLiveMyProfileActivity.getSupportFragmentManager(), "BottomSheet");
    }

    public static final void onClick$lambda$3(final NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        nonLiveMyProfileActivity.isInterest = false;
        InterestAndLanguage newInstance = InterestAndLanguage.INSTANCE.newInstance(nonLiveMyProfileActivity.isInterest, nonLiveMyProfileActivity.interestList, nonLiveMyProfileActivity.languageList);
        newInstance.setListener(new InterestAndLanguage.BottomSheetDialogListener() {
            @Override
            public void onBottomSheetDismissed() {
                NonLiveMyProfileActivity.this.refresh();
            }
        });
        newInstance.show(nonLiveMyProfileActivity.getSupportFragmentManager(), "BottomSheet");
    }

    public static final void onClick$lambda$4(NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        nonLiveMyProfileActivity.showDobPickerDialog();
    }

    public static final void onClick$lambda$5(NonLiveMyProfileActivity nonLiveMyProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        nonLiveMyProfileActivity.showGenderDialog();
    }

    private final void showDobPickerDialog() {
        Context context = (Context) this;
        final View inflate = LayoutInflater.from(context).inflate(2131558643, (ViewGroup) null);
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setView(inflate);
        final AlertDialog create = builder.create();
        Intrinsics.checkNotNullExpressionValue(create, "alertDialogBuilder.create()");
        Button button = (Button) inflate.findViewById(com.birjuvachhani.locus.R.id.confirm_button);
        ImageView imageView = (ImageView) inflate.findViewById(2131362585);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.showDobPickerDialog$lambda$6(inflate, this, create, view);
            }
        });
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NonLiveMyProfileActivity.showDobPickerDialog$lambda$7(create, view);
            }
        });
        create.show();
    }

    public static final void showDobPickerDialog$lambda$6(View view, NonLiveMyProfileActivity nonLiveMyProfileActivity, AlertDialog alertDialog, View view2) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        Intrinsics.checkNotNullParameter(alertDialog, "$alertDialog");
        DatePickerView datePickerView = (DatePickerView) view.findViewById(2131362693);
        DateHelper dateHelper = DateHelper.INSTANCE;
        Date date = datePickerView.getDate();
        Intrinsics.checkNotNullExpressionValue(date, "dobPicker.date");
        String formatDate = dateHelper.formatDate(date, "yyyy-MM-dd");
        if (!DateHelper.INSTANCE.isUnderAge(formatDate)) {
            String str = formatDate.toString();
            nonLiveMyProfileActivity.getViewModel().setDobChange(str);
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding = nonLiveMyProfileActivity.binding;
            if (activityNonLiveProfileBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding = null;
            }
            activityNonLiveProfileBinding.dob.setText(StringExtKt.formatDateByPattern(str, "yyyy-MM-dd", "dd-MMM-yyyy"));
            alertDialog.dismiss();
            return;
        }
        Toast.makeText((Context) nonLiveMyProfileActivity, "You must be at least 18 years old.", 0).show();
    }

    public static final void showDobPickerDialog$lambda$7(AlertDialog alertDialog, View view) {
        Intrinsics.checkNotNullParameter(alertDialog, "$alertDialog");
        alertDialog.dismiss();
    }

    private final void showGenderDialog() {
        final String[] strArr = {"Male", "Female"};
        AlertDialog.Builder builder = new AlertDialog.Builder((Context) this);
        builder.setTitle("Select Gender").setItems(strArr, new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                NonLiveMyProfileActivity.showGenderDialog$lambda$8(strArr, this, dialogInterface, i);
            }
        });
        AlertDialog create = builder.create();
        Intrinsics.checkNotNullExpressionValue(create, "builder.create()");
        create.show();
    }

    public static final void showGenderDialog$lambda$8(String[] strArr, NonLiveMyProfileActivity nonLiveMyProfileActivity, DialogInterface dialogInterface, int i) {
        Intrinsics.checkNotNullParameter(strArr, "$options");
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        Intrinsics.checkNotNullParameter(dialogInterface, "dialogInterface");
        String str = strArr[i];
        if (Intrinsics.areEqual(str, "Male")) {
            nonLiveMyProfileActivity.maleSelected();
        } else if (Intrinsics.areEqual(str, "Female")) {
            nonLiveMyProfileActivity.femaleSelected();
        }
        dialogInterface.dismiss();
    }

    private final void maleSelected() {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.gender.setText("MALE");
        getViewModel().setGenderChange("MALE");
    }

    private final void femaleSelected() {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.gender.setText("FEMALE");
        getViewModel().setGenderChange("FEMALE");
    }

    private final void save() {
        String obj;
        User user;
        User user2;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        Editable text = activityNonLiveProfileBinding.name.getText();
        if (text == null || text.length() == 0) {
            ActivityExtKt.toast((Activity) this, "Nickname required");
            return;
        }
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
        if (activityNonLiveProfileBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding2 = null;
        }
        List<String> selectedPictures = activityNonLiveProfileBinding2.photoPicker.getSelectedPictures();
        ArrayList arrayList = new ArrayList();
        for (Object obj2 : selectedPictures) {
            String str = (String) obj2;
            if (!(str == null || str.length() == 0)) {
                arrayList.add(obj2);
            }
        }
        ArrayList arrayList2 = arrayList;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding3 = null;
        }
        List<String> plus = CollectionsKt.plus(arrayList2, activityNonLiveProfileBinding3.videoPicker.getSelectedPictures());
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding4 = null;
        }
        Editable text2 = activityNonLiveProfileBinding4.aboutMe.getText();
        if (text2 == null || text2.length() == 0) {
            obj = "";
        } else {
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = this.binding;
            if (activityNonLiveProfileBinding5 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding5 = null;
            }
            obj = StringsKt.trim(new Regex("\\s+").replace(String.valueOf(activityNonLiveProfileBinding5.aboutMe.getText()), " ")).toString();
        }
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding6 = this.binding;
        if (activityNonLiveProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding6 = null;
        }
        String obj3 = activityNonLiveProfileBinding6.name.getText().toString();
        List<String> list = plus;
        ArrayList arrayList3 = new ArrayList();
        for (Object obj4 : list) {
            String str2 = (String) obj4;
            if (str2 != null && StringsKt.contains$default(str2, "http", false, 2, (Object) null)) {
                arrayList3.add(obj4);
            }
        }
        List<String> asMutableList = TypeIntrinsics.asMutableList(arrayList3);
        ArrayList arrayList4 = new ArrayList();
        for (Object obj5 : list) {
            String str3 = (String) obj5;
            if (!(str3 != null && StringsKt.contains$default(str3, "http", false, 2, (Object) null))) {
                arrayList4.add(obj5);
            }
        }
        List<String> asMutableList2 = TypeIntrinsics.asMutableList(arrayList4);
        ArrayList arrayList5 = new ArrayList();
        for (String str4 : asMutableList2) {
            String str5 = str4;
            if (!(str5 == null || str5.length() == 0) && new File(str4).exists()) {
                arrayList5.add(str4);
            }
        }
        Timber.e("list " + asMutableList2, new Object[0]);
        Timber.e("prevList " + asMutableList, new Object[0]);
        UserViewModel viewModel = getViewModel();
        String dobChange = getViewModel().getDobChange();
        String str6 = (dobChange == null && ((user2 = getViewModel().getUser()) == null || (dobChange = user2.getDob()) == null)) ? "" : dobChange;
        String genderChange = getViewModel().getGenderChange();
        String str7 = (genderChange == null && ((user = getViewModel().getUser()) == null || (genderChange = user.getGender()) == null)) ? "" : genderChange;
        String token = FirebaseNotificationService.INSTANCE.getToken((Context) this);
        String avatar = getViewModel().getAvatar();
        viewModel.uploadForUserProfile(str6, str7, avatar == null ? "" : avatar, token, plus, arrayList5, obj, obj3, asMutableList);
    }

    private final void observeEditText() {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = null;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.aboutMe.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) {
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding3;
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding4;
                activityNonLiveProfileBinding3 = NonLiveMyProfileActivity.this.binding;
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = null;
                if (activityNonLiveProfileBinding3 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityNonLiveProfileBinding3 = null;
                }
                Editable text = activityNonLiveProfileBinding3.aboutMe.getText();
                String str = String.valueOf(text != null ? StringsKt.trim(text) : null).length() + " / 200";
                activityNonLiveProfileBinding4 = NonLiveMyProfileActivity.this.binding;
                if (activityNonLiveProfileBinding4 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                } else {
                    activityNonLiveProfileBinding5 = activityNonLiveProfileBinding4;
                }
                activityNonLiveProfileBinding5.textCount.setText(str);
            }
        });
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding3 = null;
        }
        activityNonLiveProfileBinding3.name.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) {
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding4;
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding5;
                activityNonLiveProfileBinding4 = NonLiveMyProfileActivity.this.binding;
                ActivityNonLiveProfileBinding activityNonLiveProfileBinding6 = null;
                if (activityNonLiveProfileBinding4 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityNonLiveProfileBinding4 = null;
                }
                Editable text = activityNonLiveProfileBinding4.name.getText();
                String str = String.valueOf(text != null ? StringsKt.trim(text) : null).length() + " / 15";
                activityNonLiveProfileBinding5 = NonLiveMyProfileActivity.this.binding;
                if (activityNonLiveProfileBinding5 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                } else {
                    activityNonLiveProfileBinding6 = activityNonLiveProfileBinding5;
                }
                activityNonLiveProfileBinding6.nickNameTextCount.setText(str);
            }
        });
        final Ref.BooleanRef booleanRef = new Ref.BooleanRef();
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding2 = activityNonLiveProfileBinding4;
        }
        activityNonLiveProfileBinding2.aboutMe.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public final void onFocusChange(View view, boolean z) {
                NonLiveMyProfileActivity.observeEditText$lambda$14(booleanRef, this, view, z);
            }
        });
    }

    public static final void observeEditText$lambda$14(Ref.BooleanRef booleanRef, final NonLiveMyProfileActivity nonLiveMyProfileActivity, View view, boolean z) {
        Intrinsics.checkNotNullParameter(booleanRef, "$scolled");
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        if (!z || booleanRef.element) {
            return;
        }
        booleanRef.element = true;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = nonLiveMyProfileActivity.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.scrollView.postDelayed(new Runnable() {
            @Override
            public final void run() {
                NonLiveMyProfileActivity.observeEditText$lambda$14$lambda$13(NonLiveMyProfileActivity.this);
            }
        }, 300L);
    }

    public static final void observeEditText$lambda$14$lambda$13(NonLiveMyProfileActivity nonLiveMyProfileActivity) {
        Intrinsics.checkNotNullParameter(nonLiveMyProfileActivity, "this$0");
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = nonLiveMyProfileActivity.binding;
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = null;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        ScrollView scrollView = activityNonLiveProfileBinding.scrollView;
        Intrinsics.checkNotNullExpressionValue(scrollView, "binding.scrollView");
        scrollView.fullScroll(130);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = nonLiveMyProfileActivity.binding;
        if (activityNonLiveProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding2 = activityNonLiveProfileBinding3;
        }
        activityNonLiveProfileBinding2.aboutMe.requestFocus();
    }

    public final void showCityStatus(boolean showCity) {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = null;
        if (showCity) {
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
            if (activityNonLiveProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding2 = null;
            }
            activityNonLiveProfileBinding2.cityBtn.setChecked(true);
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding3 = this.binding;
            if (activityNonLiveProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityNonLiveProfileBinding = activityNonLiveProfileBinding3;
            }
            activityNonLiveProfileBinding.statusTxt.setText(2131953093);
            return;
        }
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding4 = this.binding;
        if (activityNonLiveProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding4 = null;
        }
        activityNonLiveProfileBinding4.cityBtn.setChecked(false);
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding5 = this.binding;
        if (activityNonLiveProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityNonLiveProfileBinding = activityNonLiveProfileBinding5;
        }
        activityNonLiveProfileBinding.statusTxt.setText(2131952360);
    }

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

    public final void setUpChosenInterestList(ArrayList<InterestResponse> interests) {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.selectedInterestGroup.removeAllViews();
        Iterator<InterestResponse> it = interests.iterator();
        while (it.hasNext()) {
            InterestResponse next = it.next();
            this.interestList.add(next.getInterest());
            View inflate = getLayoutInflater().inflate(2131558792, (ViewGroup) null, false);
            Intrinsics.checkNotNull(inflate, "null cannot be cast to non-null type com.google.android.material.chip.Chip");
            View view = (Chip) inflate;
            view.setText(next.getInterest());
            view.setTypeface(Typeface.DEFAULT_BOLD);
            int applyDimension = (int) TypedValue.applyDimension(1, 14.0f, getResources().getDisplayMetrics());
            view.setPadding(applyDimension, 0, applyDimension, 0);
            view.setClickable(false);
            view.setChipBackgroundColor(getColorStateList(2131100106));
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
            if (activityNonLiveProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding2 = null;
            }
            activityNonLiveProfileBinding2.selectedInterestGroup.addView(view);
        }
    }

    public final void setUpChosenLanguageList(ArrayList<LanguageResponse> languages) {
        ActivityNonLiveProfileBinding activityNonLiveProfileBinding = this.binding;
        if (activityNonLiveProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityNonLiveProfileBinding = null;
        }
        activityNonLiveProfileBinding.selectedLanguageGroup.removeAllViews();
        Iterator<LanguageResponse> it = languages.iterator();
        while (it.hasNext()) {
            LanguageResponse next = it.next();
            this.languageList.add(next.getLanguage());
            View inflate = getLayoutInflater().inflate(2131558792, (ViewGroup) null, false);
            Intrinsics.checkNotNull(inflate, "null cannot be cast to non-null type com.google.android.material.chip.Chip");
            View view = (Chip) inflate;
            view.setText(next.getLanguage());
            view.setTypeface(Typeface.DEFAULT_BOLD);
            int applyDimension = (int) TypedValue.applyDimension(1, 14.0f, getResources().getDisplayMetrics());
            view.setPadding(applyDimension, 0, applyDimension, 0);
            view.setClickable(false);
            view.setChipBackgroundColor(getColorStateList(2131100106));
            ActivityNonLiveProfileBinding activityNonLiveProfileBinding2 = this.binding;
            if (activityNonLiveProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityNonLiveProfileBinding2 = null;
            }
            activityNonLiveProfileBinding2.selectedLanguageGroup.addView(view);
        }
    }

    private final void requestPermissions() {
        if (Build.VERSION.SDK_INT <= 29) {
            if (EasyPermissions.hasPermissions((Context) this, new String[]{this.PERMISSIONS_R.toString()})) {
                return;
            }
            EasyPermissions.requestPermissions(new PermissionRequest.Builder((Activity) this, 1010, new String[]{this.PERMISSIONS_Q.toString()}).setRationale(2131952600).setPositiveButtonText(2131952378).build());
        } else if (Build.VERSION.SDK_INT > 29) {
            String[] strArr = this.PERMISSIONS_Q;
            if (EasyPermissions.hasPermissions((Context) this, (String[]) Arrays.copyOf(strArr, strArr.length))) {
                return;
            }
            EasyPermissions.requestPermissions(new PermissionRequest.Builder((Activity) this, 1010, new String[]{this.PERMISSIONS_R.toString()}).setRationale(2131952600).setPositiveButtonText(2131952378).build());
        }
    }

    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);
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, new Object[]{this});
    }

    public void onPermissionsDenied(int requestCode, List<String> perms) {
        Intrinsics.checkNotNullParameter(perms, "perms");
        if (requestCode == 1010) {
            if (Build.VERSION.SDK_INT >= 30) {
                if (perms.contains("android.permission.CAMERA") || perms.contains("android.permission.READ_EXTERNAL_STORAGE")) {
                    Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                    intent.setData(Uri.fromParts("package", getPackageName(), null));
                    startActivityForResult(intent, requestCode);
                    return;
                }
                return;
            }
            if (perms.contains("android.permission.CAMERA") || perms.contains("android.permission.WRITE_EXTERNAL_STORAGE") || perms.contains("android.permission.READ_EXTERNAL_STORAGE")) {
                Intent intent2 = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                intent2.setData(Uri.fromParts("package", getPackageName(), null));
                startActivityForResult(intent2, requestCode);
            }
        }
    }

    public boolean onOptionsItemSelected(MenuItem item) {
        Intrinsics.checkNotNullParameter(item, "item");
        if (item.getItemId() != 16908332) {
            return true;
        }
        finish();
        return true;
    }
}