导航菜单

页面标题

页面副标题

Biko v2.0.23 - MyProfileActivity.java 源代码

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

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


package app.callpe.ui.user;

import android.R;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
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.Helper;
import app.callpe.common.utils.ResultState;
import app.callpe.common.utils.custom.PhotoPickerView;
import app.callpe.common.utils.custom.ProfilePhotoPickerView;
import app.callpe.common.utils.custom.mediaslider.FinishActivityCallback;
import app.callpe.common.utils.custom.mediaslider.ImageAndVideoActivity;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.extensions.EdittextExtKt;
import app.callpe.common.utils.extensions.StringExtKt;
import app.callpe.common.utils.file_helper.Files;
import app.callpe.common.utils.helper_functions.DialogHelper;
import app.callpe.common.utils.helper_functions.EmojiFilter;
import app.callpe.common.utils.helper_functions.NumberExcludeFilter;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.InterestResponse;
import app.callpe.data.model.LanguageResponse;
import app.callpe.data.model.LoginResponse;
import app.callpe.data.model.ProfileInterests;
import app.callpe.data.model.Tags;
import app.callpe.data.repository.upload.UploadProgressHelper;
import app.callpe.databinding.ActivityStreamerProfileBinding;
import app.callpe.ui.bottomsheet.InterestAndLanguage;
import app.callpe.ui.dialog.EditProfileInterestDialog;
import app.callpe.ui.home.StreamerHomeActivity;
import com.facebook.internal.NativeProtocol;
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import com.google.android.material.textfield.TextInputEditText;
import com.google.gson.Gson;
import dagger.hilt.android.AndroidEntryPoint;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
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Ø\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\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\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\b\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\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\f\b\u0007\u0018\u0000 r2\u00020\u00012\u00020\u00022\u00020\u0003:\u0002rsB\u0005¢\u0006\u0002\u0010\u0004J\u0010\u0010(\u001a\u00020)2\u0006\u0010*\u001a\u00020+H\u0002J\u0010\u0010,\u001a\u00020)2\u0006\u0010*\u001a\u00020+H\u0002J\u0018\u0010-\u001a\u00020.2\u0006\u0010/\u001a\u0002002\u0006\u00101\u001a\u000202H\u0002J\u0018\u00103\u001a\u0002042\u0006\u0010/\u001a\u0002002\u0006\u00105\u001a\u000206H\u0002J\u0018\u00107\u001a\u0002042\u0006\u0010/\u001a\u0002002\u0006\u00105\u001a\u000206H\u0002J \u00108\u001a\u00020)2\u0016\u00109\u001a\u0012\u0012\u0004\u0012\u0002060\rj\b\u0012\u0004\u0012\u000206`\u000eH\u0002J \u0010:\u001a\u00020;2\u0006\u0010/\u001a\u0002002\u0006\u0010<\u001a\u00020\u00072\u0006\u0010=\u001a\u00020>H\u0002J\b\u0010?\u001a\u00020)H\u0002J\b\u0010@\u001a\u00020)H\u0016J\b\u0010A\u001a\u00020)H\u0002J\b\u0010B\u001a\u00020)H\u0002J\b\u0010C\u001a\u00020)H\u0002J\b\u0010D\u001a\u00020)H\u0002J\b\u0010E\u001a\u00020)H\u0002J\b\u0010F\u001a\u00020GH\u0002J\b\u0010H\u001a\u00020)H\u0002J\b\u0010I\u001a\u00020)H\u0002J\u0012\u0010J\u001a\u00020)2\b\u0010K\u001a\u0004\u0018\u00010LH\u0014J\u0010\u0010M\u001a\u00020\u00142\u0006\u0010N\u001a\u00020OH\u0016J\u001e\u0010P\u001a\u00020)2\u0006\u0010Q\u001a\u00020R2\f\u0010S\u001a\b\u0012\u0004\u0012\u00020\u00070TH\u0016J\u001e\u0010U\u001a\u00020)2\u0006\u0010Q\u001a\u00020R2\f\u0010S\u001a\b\u0012\u0004\u0012\u00020\u00070TH\u0016J-\u0010V\u001a\u00020)2\u0006\u0010Q\u001a\u00020R2\u000e\u0010W\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00070\u00062\u0006\u0010X\u001a\u00020YH\u0016¢\u0006\u0002\u0010ZJ\u0010\u0010[\u001a\u00020)2\u0006\u0010\\\u001a\u00020]H\u0002J\u0010\u0010^\u001a\u00020)2\u0006\u0010_\u001a\u00020>H\u0002J\b\u0010`\u001a\u00020)H\u0002J\b\u0010a\u001a\u00020)H\u0002J\b\u0010b\u001a\u00020)H\u0002J \u0010c\u001a\u00020)2\u0016\u0010d\u001a\u0012\u0012\u0004\u0012\u00020e0\rj\b\u0012\u0004\u0012\u00020e`\u000eH\u0002J \u0010f\u001a\u00020)2\u0016\u0010g\u001a\u0012\u0012\u0004\u0012\u00020h0\rj\b\u0012\u0004\u0012\u00020h`\u000eH\u0002J\b\u0010i\u001a\u00020)H\u0002J\u0010\u0010j\u001a\u00020)2\u0006\u0010k\u001a\u00020\u0014H\u0002J\u0010\u0010l\u001a\u00020)2\u0006\u0010m\u001a\u00020\u0014H\u0002J\u0010\u0010n\u001a\u00020)2\u0006\u00109\u001a\u000206H\u0002J\b\u0010o\u001a\u00020)H\u0002J\b\u0010p\u001a\u00020)H\u0002J\b\u0010q\u001a\u00020)H\u0002R\u0016\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\bR\u0016\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\bR\u000e\u0010\n\u001a\u00020\u000bX\u0082.¢\u0006\u0002\n\u0000R*\u0010\f\u001a\u0012\u0012\u0004\u0012\u00020\u00070\rj\b\u0012\u0004\u0012\u00020\u0007`\u000eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000f\u0010\u0010\"\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\u00020\u0014X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\u0015\"\u0004\b\u0016\u0010\u0017R*\u0010\u0018\u001a\u0012\u0012\u0004\u0012\u00020\u00070\rj\b\u0012\u0004\u0012\u00020\u0007`\u000eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\u0010\"\u0004\b\u001a\u0010\u0012R\u001e\u0010\u001b\u001a\u0012\u0012\u0004\u0012\u00020\u00070\rj\b\u0012\u0004\u0012\u00020\u0007`\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001c\u001a\u0004\u0018\u00010\u001dX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u001e\u001a\u00020\u001fX\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010 \u001a\u0004\u0018\u00010!X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\"\u001a\u00020#8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b&\u0010'\u001a\u0004\b$\u0010%¨\u0006t"}, d2 = {"Lapp/callpe/ui/user/MyProfileActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "Lpub/devrel/easypermissions/EasyPermissions$PermissionCallbacks;", "Lapp/callpe/common/utils/custom/mediaslider/FinishActivityCallback;", "()V", "PERMISSIONS_Q", "", "", "[Ljava/lang/String;", "PERMISSIONS_R", "binding", "Lapp/callpe/databinding/ActivityStreamerProfileBinding;", "interestList", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "getInterestList", "()Ljava/util/ArrayList;", "setInterestList", "(Ljava/util/ArrayList;)V", "isInterest", "", "()Z", "setInterest", "(Z)V", "languageList", "getLanguageList", "setLanguageList", "profilePictures", "progressDialog", "Landroid/app/ProgressDialog;", "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;", "canCompress", "", "uri", "Landroid/net/Uri;", "compression", "createChipGroup", "Lcom/google/android/material/chip/ChipGroup;", "context", "Landroid/content/Context;", "parentView", "Landroid/view/ViewGroup;", "createEditLanguageLayout", "Landroid/widget/LinearLayout;", "profileInterest", "Lapp/callpe/data/model/ProfileInterests;", "createLinearLayout", "createProfileInterest", "profileInterests", "createTextView", "Landroid/widget/TextView;", "text", "textSize", "", "femaleSelected", "finishProfileActivity", "getIntentValues", "goToHomeActivity", "hideProgressDialog", "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;", "progressDialogPercent", "progress", "refresh", "requestPermissions", "save", "setUpChosenInterestList", "interests", "Lapp/callpe/data/model/InterestResponse;", "setUpChosenLanguageList", "languages", "Lapp/callpe/data/model/LanguageResponse;", "setUpToolbar", "showAgeStatus", "showAge", "showCityStatus", "showCity", "showFillProfileInterestDialog", "showGenderDialog", "showProgressDialog", "updateStreamer", "Companion", "StreamerStatus", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class MyProfileActivity extends Hilt_MyProfileActivity implements EasyPermissions.PermissionCallbacks, FinishActivityCallback {
    public static final int RC_STORAGE_PERMISSION = 1010;
    private ActivityStreamerProfileBinding binding;
    private ProgressDialog progressDialog;
    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 ArrayList<String> profilePictures = 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/MyProfileActivity$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 MyProfileActivity() {
        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 m2215invoke() {
                return componentActivity.getViewModelStore();
            }
        }, new Function0<ViewModelProvider.Factory>() {
            {
                super(0);
            }

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

            public final CreationExtras m2216invoke() {
                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);
        ActivityStreamerProfileBinding inflate = ActivityStreamerProfileBinding.inflate(getLayoutInflater());
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        this.binding = inflate;
        ActivityStreamerProfileBinding activityStreamerProfileBinding = null;
        if (inflate == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            inflate = null;
        }
        setContentView(inflate.getRoot());
        setUpToolbar();
        requestPermissions();
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
        if (activityStreamerProfileBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding2 = null;
        }
        activityStreamerProfileBinding2.photoPicker.setCustomCamera(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding3 = null;
        }
        activityStreamerProfileBinding3.photoPicker.setHideDelete(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        activityStreamerProfileBinding4.videoPicker.setHideDelete(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding5 = null;
        }
        activityStreamerProfileBinding5.auditionVideoPicker.setHideDelete(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding6 = this.binding;
        if (activityStreamerProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding6 = null;
        }
        activityStreamerProfileBinding6.idProofPicker.setCustomCamera(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding7 = this.binding;
        if (activityStreamerProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding7 = null;
        }
        activityStreamerProfileBinding7.idProofPicker.setSinglePic(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding8 = this.binding;
        if (activityStreamerProfileBinding8 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding8 = null;
        }
        activityStreamerProfileBinding8.photoPickerProfilePic.setCustomCamera(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding9 = this.binding;
        if (activityStreamerProfileBinding9 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding = activityStreamerProfileBinding9;
        }
        activityStreamerProfileBinding.photoPickerProfilePic.setSinglePic(true);
        this.uploadProgressHelper = new UploadProgressHelper((Context) this, (Activity) this);
        observeEvent();
        observeUploadProgress();
        onClick();
        getIntentValues();
        observeEditText();
    }

    private final void setUpToolbar() {
        try {
            ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
            Toolbar toolbar = null;
            if (activityStreamerProfileBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding = null;
            }
            Toolbar toolbar2 = activityStreamerProfileBinding.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 MyProfileActivity$observeEvent$1(this, null), 3, (Object) null);
    }

    public final void prefillData(app.callpe.data.model.Metadata data) {
        List<String> profilePicture = data.getUser().getProfilePicture();
        Intrinsics.checkNotNull(profilePicture, "null cannot be cast to non-null type java.util.ArrayList<kotlin.String>{ kotlin.collections.TypeAliasesKt.ArrayList<kotlin.String> }");
        this.profilePictures = (ArrayList) profilePicture;
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        ProfilePhotoPickerView profilePhotoPickerView = activityStreamerProfileBinding.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);
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding3 = null;
        }
        PhotoPickerView photoPickerView = activityStreamerProfileBinding3.idProofPicker;
        List<String> idProofPictures = data.getUser().getIdProofPictures();
        Intrinsics.checkNotNull(idProofPictures, "null cannot be cast to non-null type java.util.ArrayList<kotlin.String>{ kotlin.collections.TypeAliasesKt.ArrayList<kotlin.String> }");
        photoPickerView.addItems((ArrayList) idProofPictures);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        PhotoPickerView photoPickerView2 = activityStreamerProfileBinding4.photoPickerProfilePic;
        List<String> profilePicture2 = data.getUser().getProfilePicture();
        Intrinsics.checkNotNull(profilePicture2, "null cannot be cast to non-null type java.util.ArrayList<kotlin.String>{ kotlin.collections.TypeAliasesKt.ArrayList<kotlin.String> }");
        photoPickerView2.addItems((ArrayList) profilePicture2);
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding5 = null;
        }
        activityStreamerProfileBinding5.auditionVideoPicker.addItem(data.getUser().getAuditionVideo());
        ActivityStreamerProfileBinding activityStreamerProfileBinding6 = this.binding;
        if (activityStreamerProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding6 = null;
        }
        boolean z = true;
        activityStreamerProfileBinding6.photoPicker.hideAddBtn(true);
        if (data.getUser().getIdProofPictures().isEmpty()) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding7 = this.binding;
            if (activityStreamerProfileBinding7 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding7 = null;
            }
            activityStreamerProfileBinding7.idProofPicker.hideAddBtn(false);
        } else {
            ActivityStreamerProfileBinding activityStreamerProfileBinding8 = this.binding;
            if (activityStreamerProfileBinding8 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding8 = null;
            }
            activityStreamerProfileBinding8.idProofPicker.hideAddBtn(true);
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding9 = this.binding;
        if (activityStreamerProfileBinding9 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding9 = null;
        }
        LinearLayout linearLayout = activityStreamerProfileBinding9.editLanguage;
        Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.editLanguage");
        linearLayout.setVisibility(0);
        if (data.getUser().getProfilePicture().isEmpty()) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding10 = this.binding;
            if (activityStreamerProfileBinding10 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding10 = null;
            }
            activityStreamerProfileBinding10.photoPickerProfilePic.hideAddBtn(false);
        } else {
            ActivityStreamerProfileBinding activityStreamerProfileBinding11 = this.binding;
            if (activityStreamerProfileBinding11 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding11 = null;
            }
            activityStreamerProfileBinding11.photoPickerProfilePic.hideAddBtn(true);
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding12 = this.binding;
        if (activityStreamerProfileBinding12 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding12 = null;
        }
        TextInputEditText textInputEditText = activityStreamerProfileBinding12.aboutMe;
        String aboutMe = data.getUser().getAboutMe();
        if (aboutMe == null) {
            aboutMe = "";
        }
        textInputEditText.setText(aboutMe);
        ActivityStreamerProfileBinding activityStreamerProfileBinding13 = this.binding;
        if (activityStreamerProfileBinding13 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding13 = null;
        }
        activityStreamerProfileBinding13.auditionVideoPicker.hideAddBtn(true);
        ArrayList<ProfileInterests> profileInterests = data.getUser().getProfileInterests();
        if (profileInterests != null) {
            createProfileInterest(profileInterests);
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding14 = this.binding;
        if (activityStreamerProfileBinding14 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding14 = null;
        }
        activityStreamerProfileBinding14.videoPicker.hideAddBtn(true);
        if (Intrinsics.areEqual(data.getUser().getStreamerStatus(), "APPROVED")) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding15 = this.binding;
            if (activityStreamerProfileBinding15 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding15 = null;
            }
            LinearLayout linearLayout2 = activityStreamerProfileBinding15.idProofUi;
            Intrinsics.checkNotNullExpressionValue(linearLayout2, "binding.idProofUi");
            linearLayout2.setVisibility(8);
            ActivityStreamerProfileBinding activityStreamerProfileBinding16 = this.binding;
            if (activityStreamerProfileBinding16 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding16 = null;
            }
            LinearLayout linearLayout3 = activityStreamerProfileBinding16.myAuditionLayout;
            Intrinsics.checkNotNullExpressionValue(linearLayout3, "binding.myAuditionLayout");
            linearLayout3.setVisibility(8);
            ActivityStreamerProfileBinding activityStreamerProfileBinding17 = this.binding;
            if (activityStreamerProfileBinding17 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding17 = null;
            }
            LinearLayout linearLayout4 = activityStreamerProfileBinding17.myProfilePicParent;
            Intrinsics.checkNotNullExpressionValue(linearLayout4, "binding.myProfilePicParent");
            linearLayout4.setVisibility(8);
        } else {
            ActivityStreamerProfileBinding activityStreamerProfileBinding18 = this.binding;
            if (activityStreamerProfileBinding18 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding18 = null;
            }
            LinearLayout linearLayout5 = activityStreamerProfileBinding18.idProofUi;
            Intrinsics.checkNotNullExpressionValue(linearLayout5, "binding.idProofUi");
            linearLayout5.setVisibility(0);
            ActivityStreamerProfileBinding activityStreamerProfileBinding19 = this.binding;
            if (activityStreamerProfileBinding19 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding19 = null;
            }
            LinearLayout linearLayout6 = activityStreamerProfileBinding19.myAuditionLayout;
            Intrinsics.checkNotNullExpressionValue(linearLayout6, "binding.myAuditionLayout");
            linearLayout6.setVisibility(0);
            ActivityStreamerProfileBinding activityStreamerProfileBinding20 = this.binding;
            if (activityStreamerProfileBinding20 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding20 = null;
            }
            LinearLayout linearLayout7 = activityStreamerProfileBinding20.myProfilePicParent;
            Intrinsics.checkNotNullExpressionValue(linearLayout7, "binding.myProfilePicParent");
            linearLayout7.setVisibility(0);
        }
        if (data.getUser().getStreamerStatus() == null || Intrinsics.areEqual(data.getUser().getStreamerStatus(), "CREATED") || Intrinsics.areEqual(data.getUser().getStreamerStatus(), "PASSED") || Intrinsics.areEqual(data.getUser().getStreamerStatus(), "IGNORED") || Intrinsics.areEqual(data.getUser().getStreamerStatus(), "REJECTED")) {
            String auditionVideo = data.getUser().getAuditionVideo();
            if (auditionVideo == null || auditionVideo.length() == 0) {
                ActivityStreamerProfileBinding activityStreamerProfileBinding21 = this.binding;
                if (activityStreamerProfileBinding21 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding21 = null;
                }
                activityStreamerProfileBinding21.auditionVideoPicker.hideAddBtn(false);
            }
            ActivityStreamerProfileBinding activityStreamerProfileBinding22 = this.binding;
            if (activityStreamerProfileBinding22 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding22 = null;
            }
            activityStreamerProfileBinding22.photoPicker.setHideDelete(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding23 = this.binding;
            if (activityStreamerProfileBinding23 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding23 = null;
            }
            activityStreamerProfileBinding23.auditionVideoPicker.setHideDelete(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding24 = this.binding;
            if (activityStreamerProfileBinding24 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding24 = null;
            }
            activityStreamerProfileBinding24.videoPicker.setHideDelete(false);
            String introVideo = data.getUser().getIntroVideo();
            if (introVideo != null && introVideo.length() != 0) {
                z = false;
            }
            if (z) {
                ActivityStreamerProfileBinding activityStreamerProfileBinding25 = this.binding;
                if (activityStreamerProfileBinding25 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding25 = null;
                }
                activityStreamerProfileBinding25.videoPicker.hideAddBtn(false);
            }
            ActivityStreamerProfileBinding activityStreamerProfileBinding26 = this.binding;
            if (activityStreamerProfileBinding26 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding26 = null;
            }
            activityStreamerProfileBinding26.photoPicker.hideAddBtn(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding27 = this.binding;
            if (activityStreamerProfileBinding27 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding27 = null;
            }
            LinearLayout linearLayout8 = activityStreamerProfileBinding27.editGender;
            Intrinsics.checkNotNullExpressionValue(linearLayout8, "binding.editGender");
            linearLayout8.setVisibility(0);
        } else if (Intrinsics.areEqual(data.getUser().getStreamerStatus(), "APPROVED")) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding28 = this.binding;
            if (activityStreamerProfileBinding28 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding28 = null;
            }
            activityStreamerProfileBinding28.aboutMe.setFocusable(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding29 = this.binding;
            if (activityStreamerProfileBinding29 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding29 = null;
            }
            activityStreamerProfileBinding29.aboutMe.setClickable(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding30 = this.binding;
            if (activityStreamerProfileBinding30 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding30 = null;
            }
            LinearLayout linearLayout9 = activityStreamerProfileBinding30.editGender;
            Intrinsics.checkNotNullExpressionValue(linearLayout9, "binding.editGender");
            linearLayout9.setVisibility(8);
            ActivityStreamerProfileBinding activityStreamerProfileBinding31 = this.binding;
            if (activityStreamerProfileBinding31 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding31 = null;
            }
            activityStreamerProfileBinding31.name.setFocusable(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding32 = this.binding;
            if (activityStreamerProfileBinding32 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding32 = null;
            }
            activityStreamerProfileBinding32.name.setClickable(false);
            ActivityStreamerProfileBinding activityStreamerProfileBinding33 = this.binding;
            if (activityStreamerProfileBinding33 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding33 = null;
            }
            activityStreamerProfileBinding33.photoPicker.setProfileScreen(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding34 = this.binding;
            if (activityStreamerProfileBinding34 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding34 = null;
            }
            activityStreamerProfileBinding34.idProofPicker.setProfileScreen(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding35 = this.binding;
            if (activityStreamerProfileBinding35 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding35 = null;
            }
            activityStreamerProfileBinding35.idProofPicker.setHideDelete(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding36 = this.binding;
            if (activityStreamerProfileBinding36 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding36 = null;
            }
            activityStreamerProfileBinding36.idProofPicker.hideAddBtn(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding37 = this.binding;
            if (activityStreamerProfileBinding37 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding37 = null;
            }
            activityStreamerProfileBinding37.photoPickerProfilePic.setProfileScreen(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding38 = this.binding;
            if (activityStreamerProfileBinding38 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding38 = null;
            }
            activityStreamerProfileBinding38.photoPickerProfilePic.setHideDelete(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding39 = this.binding;
            if (activityStreamerProfileBinding39 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding39 = null;
            }
            activityStreamerProfileBinding39.photoPickerProfilePic.hideAddBtn(true);
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding40 = this.binding;
        if (activityStreamerProfileBinding40 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding40 = null;
        }
        EditText editText = activityStreamerProfileBinding40.name;
        String name = data.getUser().getName();
        editText.setText(name != null ? name : "");
        ActivityStreamerProfileBinding activityStreamerProfileBinding41 = this.binding;
        if (activityStreamerProfileBinding41 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding41 = null;
        }
        activityStreamerProfileBinding41.gender.setText(data.getUser().getGender());
        getViewModel().setGenderChange(data.getUser().getGender());
        ActivityStreamerProfileBinding activityStreamerProfileBinding42 = this.binding;
        if (activityStreamerProfileBinding42 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding42 = null;
        }
        TextView textView = activityStreamerProfileBinding42.dob;
        String dob = data.getUser().getDob();
        textView.setText(dob != null ? StringExtKt.formatDateByPattern(dob, "yyyy-MM-dd", "dd-MMM-yyyy") : null);
        ActivityStreamerProfileBinding activityStreamerProfileBinding43 = this.binding;
        if (activityStreamerProfileBinding43 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding43 = null;
        }
        activityStreamerProfileBinding43.photoPicker.setApproved(Intrinsics.areEqual(data.getUser().getStreamerStatus(), "APPROVED"));
        ActivityStreamerProfileBinding activityStreamerProfileBinding44 = this.binding;
        if (activityStreamerProfileBinding44 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding44 = null;
        }
        activityStreamerProfileBinding44.idProofPicker.setApproved(Intrinsics.areEqual(data.getUser().getStreamerStatus(), "APPROVED"));
        ActivityStreamerProfileBinding activityStreamerProfileBinding45 = this.binding;
        if (activityStreamerProfileBinding45 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding45;
        }
        activityStreamerProfileBinding2.photoPickerProfilePic.setApproved(Intrinsics.areEqual(data.getUser().getStreamerStatus(), "APPROVED"));
    }

    public final void updateStreamer() {
        Context context = (Context) this;
        LoginResponse loginResponse = (LoginResponse) new Gson().fromJson(SharedPref.getString(context, PrefKeys.LOGIN_RESPONSE), LoginResponse.class);
        if (loginResponse != null) {
            loginResponse.setStreamerStatus("CREATED");
            SharedPref.setString(context, PrefKeys.LOGIN_RESPONSE, new Gson().toJson(loginResponse));
        }
        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 MyProfileActivity$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;
                Unit unit;
                UploadProgressHelper uploadProgressHelper2;
                String message;
                UploadProgressHelper uploadProgressHelper3;
                UploadProgressHelper uploadProgressHelper4;
                UploadProgressHelper uploadProgressHelper5;
                int i = WhenMappings.$EnumSwitchMapping$0[resultState.getStatus().ordinal()];
                if (i == 1) {
                    uploadProgressHelper = MyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper != null) {
                        Double data = resultState.getData();
                        uploadProgressHelper.progressDialogPercent(data != null ? (float) data.doubleValue() : 0.0f);
                        return;
                    }
                    return;
                }
                if (i != 2) {
                    if (i == 3) {
                        uploadProgressHelper3 = MyProfileActivity.this.uploadProgressHelper;
                        if (uploadProgressHelper3 != null) {
                            uploadProgressHelper3.dismiss();
                            return;
                        }
                        return;
                    }
                    if (i != 4) {
                        return;
                    }
                    uploadProgressHelper4 = MyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper4 != null) {
                        uploadProgressHelper4.dismiss();
                    }
                    uploadProgressHelper5 = MyProfileActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper5 != null) {
                        uploadProgressHelper5.setProgressDialog();
                        return;
                    }
                    return;
                }
                Throwable error = resultState.getError();
                if (error == null || (message = error.getMessage()) == null) {
                    unit = null;
                } else {
                    ActivityExtKt.toast((Activity) MyProfileActivity.this, message);
                    unit = Unit.INSTANCE;
                }
                if (unit == null) {
                    MyProfileActivity myProfileActivity = MyProfileActivity.this;
                    Activity activity = (Activity) myProfileActivity;
                    String string = myProfileActivity.getString(2131951993);
                    Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.error_unknown)");
                    ActivityExtKt.toast(activity, string);
                }
                uploadProgressHelper2 = MyProfileActivity.this.uploadProgressHelper;
                if (uploadProgressHelper2 != null) {
                    uploadProgressHelper2.dismiss();
                }
            }
        }));
    }

    private final void onClick() {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        activityStreamerProfileBinding.videoPicker.setCameraAndGallery(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding3 = null;
        }
        activityStreamerProfileBinding3.auditionVideoPicker.setOnlyCamera(true);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        activityStreamerProfileBinding4.auditionVideoPicker.setVideoUploadCallback(new MyProfileActivity$onClick$1(this));
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding5 = null;
        }
        activityStreamerProfileBinding5.idProofPicker.setImageUploadCallback(new MyProfileActivity$onClick$2(this));
        ActivityStreamerProfileBinding activityStreamerProfileBinding6 = this.binding;
        if (activityStreamerProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding6 = null;
        }
        activityStreamerProfileBinding6.idProofPicker.setImageDeleteCallback(new Function1<String, Unit>() {
            public final void invoke(String str) {
                Intrinsics.checkNotNullParameter(str, "path");
            }

            public Object invoke(Object obj) {
                invoke((String) obj);
                return Unit.INSTANCE;
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding7 = this.binding;
        if (activityStreamerProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding7 = null;
        }
        activityStreamerProfileBinding7.photoPickerProfilePic.setImageUploadCallback(new Function1<String, Unit>() {
            {
                super(1);
            }

            public Object invoke(Object obj) {
                invoke((String) obj);
                return Unit.INSTANCE;
            }

            public final void invoke(final String str) {
                Intrinsics.checkNotNullParameter(str, "path");
                Context context = (Context) MyProfileActivity.this;
                final MyProfileActivity myProfileActivity = MyProfileActivity.this;
                DialogHelper.showReasonDialog(context, "", "Are you sure, you want to update your profile pic ?", true, new DialogHelper.Listener() {
                    @Override
                    public void onPositiveClick() {
                        ActivityStreamerProfileBinding activityStreamerProfileBinding8;
                        ArrayList<String> arrayList = new ArrayList<>();
                        arrayList.add(str);
                        activityStreamerProfileBinding8 = myProfileActivity.binding;
                        if (activityStreamerProfileBinding8 == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("binding");
                            activityStreamerProfileBinding8 = null;
                        }
                        activityStreamerProfileBinding8.photoPickerProfilePic.addItems(arrayList);
                    }

                    @Override
                    public void onNegativeClick() {
                        ActivityStreamerProfileBinding activityStreamerProfileBinding8;
                        ArrayList<String> arrayList;
                        activityStreamerProfileBinding8 = myProfileActivity.binding;
                        if (activityStreamerProfileBinding8 == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("binding");
                            activityStreamerProfileBinding8 = null;
                        }
                        PhotoPickerView photoPickerView = activityStreamerProfileBinding8.photoPickerProfilePic;
                        arrayList = myProfileActivity.profilePictures;
                        photoPickerView.addItems(arrayList);
                    }
                });
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding8 = this.binding;
        if (activityStreamerProfileBinding8 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding8 = null;
        }
        activityStreamerProfileBinding8.photoPickerProfilePic.setImageDeleteCallback(new Function1<String, Unit>() {
            public final void invoke(String str) {
                Intrinsics.checkNotNullParameter(str, "path");
            }

            public Object invoke(Object obj) {
                invoke((String) obj);
                return Unit.INSTANCE;
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding9 = this.binding;
        if (activityStreamerProfileBinding9 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding9 = null;
        }
        activityStreamerProfileBinding9.submitBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$1(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding10 = this.binding;
        if (activityStreamerProfileBinding10 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding10 = null;
        }
        activityStreamerProfileBinding10.cityBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$2(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding11 = this.binding;
        if (activityStreamerProfileBinding11 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding11 = null;
        }
        activityStreamerProfileBinding11.ageBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$3(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding12 = this.binding;
        if (activityStreamerProfileBinding12 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding12 = null;
        }
        activityStreamerProfileBinding12.editInterest.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$4(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding13 = this.binding;
        if (activityStreamerProfileBinding13 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding13 = null;
        }
        activityStreamerProfileBinding13.editLanguage.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$5(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding14 = this.binding;
        if (activityStreamerProfileBinding14 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding14 = null;
        }
        activityStreamerProfileBinding14.editGender.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$6(MyProfileActivity.this, view);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding15 = this.binding;
        if (activityStreamerProfileBinding15 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding15;
        }
        activityStreamerProfileBinding2.galleryBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.onClick$lambda$8(MyProfileActivity.this, view);
            }
        });
    }

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

    public static final void onClick$lambda$2(MyProfileActivity myProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        ActivityStreamerProfileBinding activityStreamerProfileBinding = myProfileActivity.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        if (activityStreamerProfileBinding.cityBtn.isChecked()) {
            myProfileActivity.getViewModel().showAndHideMyCity(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding3 = myProfileActivity.binding;
            if (activityStreamerProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityStreamerProfileBinding2 = activityStreamerProfileBinding3;
            }
            activityStreamerProfileBinding2.statusTxt.setText(2131953093);
            return;
        }
        myProfileActivity.getViewModel().showAndHideMyCity(false);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = myProfileActivity.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding4;
        }
        activityStreamerProfileBinding2.statusTxt.setText(2131952360);
    }

    public static final void onClick$lambda$3(MyProfileActivity myProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        ActivityStreamerProfileBinding activityStreamerProfileBinding = myProfileActivity.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        if (activityStreamerProfileBinding.ageBtn.isChecked()) {
            myProfileActivity.getViewModel().showAndHideAge(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding3 = myProfileActivity.binding;
            if (activityStreamerProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityStreamerProfileBinding2 = activityStreamerProfileBinding3;
            }
            activityStreamerProfileBinding2.ageStatusTxt.setText(2131953093);
            return;
        }
        myProfileActivity.getViewModel().showAndHideAge(false);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = myProfileActivity.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding4;
        }
        activityStreamerProfileBinding2.ageStatusTxt.setText(2131952360);
    }

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

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

    public static final void onClick$lambda$6(MyProfileActivity myProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        myProfileActivity.showGenderDialog();
    }

    public static final void onClick$lambda$8(MyProfileActivity myProfileActivity, View view) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        Intent intent = new Intent((Context) myProfileActivity, (Class<?>) ImageAndVideoActivity.class);
        intent.putExtra("showTabs", true);
        intent.addFlags(NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REQUEST);
        ImageAndVideoActivity.INSTANCE.setFinishCallback(myProfileActivity);
        myProfileActivity.startActivity(intent);
        myProfileActivity.overridePendingTransition(0, 0);
    }

    private final void save() {
        String obj;
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        Editable text = activityStreamerProfileBinding.name.getText();
        if (text == null || text.length() == 0) {
            ActivityExtKt.toast((Activity) this, "Nickname required");
            return;
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
        if (activityStreamerProfileBinding2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding2 = null;
        }
        if (activityStreamerProfileBinding2.photoPickerProfilePic.getSelectedPictures().isEmpty()) {
            ActivityExtKt.toast((Activity) this, "Profile pic required");
            return;
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding3 = null;
        }
        List<String> selectedPictures = activityStreamerProfileBinding3.photoPickerProfilePic.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;
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        List<String> plus = CollectionsKt.plus(arrayList2, activityStreamerProfileBinding4.videoPicker.getSelectedPictures());
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding5 = null;
        }
        Editable text2 = activityStreamerProfileBinding5.aboutMe.getText();
        if (text2 == null || text2.length() == 0) {
            obj = "";
        } else {
            ActivityStreamerProfileBinding activityStreamerProfileBinding6 = this.binding;
            if (activityStreamerProfileBinding6 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding6 = null;
            }
            obj = StringsKt.trim(new Regex("\\s+").replace(String.valueOf(activityStreamerProfileBinding6.aboutMe.getText()), " ")).toString();
        }
        String str2 = obj;
        ActivityStreamerProfileBinding activityStreamerProfileBinding7 = this.binding;
        if (activityStreamerProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding7 = null;
        }
        String obj3 = activityStreamerProfileBinding7.name.getText().toString();
        UploadProgressHelper uploadProgressHelper = this.uploadProgressHelper;
        if (uploadProgressHelper != null) {
            uploadProgressHelper.setProgressDialog();
        }
        List<String> list = plus;
        ArrayList arrayList3 = new ArrayList();
        for (Object obj4 : list) {
            String str3 = (String) obj4;
            if (str3 != null && StringsKt.contains$default(str3, "http", false, 2, (Object) null)) {
                arrayList3.add(obj4);
            }
        }
        List<String> asMutableList = TypeIntrinsics.asMutableList(arrayList3);
        ArrayList arrayList4 = new ArrayList();
        for (Object obj5 : list) {
            String str4 = (String) obj5;
            if (!(str4 != null && StringsKt.contains$default(str4, "http", false, 2, (Object) null))) {
                arrayList4.add(obj5);
            }
        }
        List<String> asMutableList2 = TypeIntrinsics.asMutableList(arrayList4);
        Timber.e("list " + asMutableList2, new Object[0]);
        Timber.e("prevList " + asMutableList, new Object[0]);
        getViewModel().uploadForProfile(plus, asMutableList2, str2, obj3, asMutableList);
    }

    private final void observeEditText() {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        activityStreamerProfileBinding.aboutMe.setFilters(new InputFilter[]{new NumberExcludeFilter(), new InputFilter.LengthFilter(200)});
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding3 = null;
        }
        EditText editText = activityStreamerProfileBinding3.aboutMe;
        Intrinsics.checkNotNullExpressionValue(editText, "binding.aboutMe");
        EdittextExtKt.disablePaste(editText);
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        activityStreamerProfileBinding4.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) {
                ActivityStreamerProfileBinding activityStreamerProfileBinding5;
                ActivityStreamerProfileBinding activityStreamerProfileBinding6;
                activityStreamerProfileBinding5 = MyProfileActivity.this.binding;
                ActivityStreamerProfileBinding activityStreamerProfileBinding7 = null;
                if (activityStreamerProfileBinding5 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding5 = null;
                }
                Editable text = activityStreamerProfileBinding5.aboutMe.getText();
                String str = String.valueOf(text != null ? StringsKt.trim(text) : null).length() + " / 200";
                activityStreamerProfileBinding6 = MyProfileActivity.this.binding;
                if (activityStreamerProfileBinding6 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                } else {
                    activityStreamerProfileBinding7 = activityStreamerProfileBinding6;
                }
                activityStreamerProfileBinding7.textCount.setText(str);
            }
        });
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding5 = null;
        }
        activityStreamerProfileBinding5.name.setFilters(new InputFilter[]{new NumberExcludeFilter(), new InputFilter.LengthFilter(20), new EmojiFilter()});
        ActivityStreamerProfileBinding activityStreamerProfileBinding6 = this.binding;
        if (activityStreamerProfileBinding6 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding6 = null;
        }
        EditText editText2 = activityStreamerProfileBinding6.name;
        Intrinsics.checkNotNullExpressionValue(editText2, "binding.name");
        EdittextExtKt.disablePaste(editText2);
        ActivityStreamerProfileBinding activityStreamerProfileBinding7 = this.binding;
        if (activityStreamerProfileBinding7 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding7 = null;
        }
        activityStreamerProfileBinding7.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) {
                ActivityStreamerProfileBinding activityStreamerProfileBinding8;
                ActivityStreamerProfileBinding activityStreamerProfileBinding9;
                activityStreamerProfileBinding8 = MyProfileActivity.this.binding;
                ActivityStreamerProfileBinding activityStreamerProfileBinding10 = null;
                if (activityStreamerProfileBinding8 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding8 = null;
                }
                Editable text = activityStreamerProfileBinding8.name.getText();
                String str = String.valueOf(text != null ? StringsKt.trim(text) : null).length() + " / 20";
                activityStreamerProfileBinding9 = MyProfileActivity.this.binding;
                if (activityStreamerProfileBinding9 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                } else {
                    activityStreamerProfileBinding10 = activityStreamerProfileBinding9;
                }
                activityStreamerProfileBinding10.nickNameTextCount.setText(str);
            }
        });
        final Ref.BooleanRef booleanRef = new Ref.BooleanRef();
        ActivityStreamerProfileBinding activityStreamerProfileBinding8 = this.binding;
        if (activityStreamerProfileBinding8 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding8;
        }
        activityStreamerProfileBinding2.aboutMe.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public final void onFocusChange(View view, boolean z) {
                MyProfileActivity.observeEditText$lambda$13(booleanRef, this, view, z);
            }
        });
    }

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

    public static final void observeEditText$lambda$13$lambda$12(MyProfileActivity myProfileActivity) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        ActivityStreamerProfileBinding activityStreamerProfileBinding = myProfileActivity.binding;
        ActivityStreamerProfileBinding activityStreamerProfileBinding2 = null;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        ScrollView scrollView = activityStreamerProfileBinding.scrollView;
        Intrinsics.checkNotNullExpressionValue(scrollView, "binding.scrollView");
        scrollView.fullScroll(130);
        ActivityStreamerProfileBinding activityStreamerProfileBinding3 = myProfileActivity.binding;
        if (activityStreamerProfileBinding3 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding2 = activityStreamerProfileBinding3;
        }
        activityStreamerProfileBinding2.aboutMe.requestFocus();
    }

    public final void showCityStatus(boolean showCity) {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = null;
        if (showCity) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
            if (activityStreamerProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding2 = null;
            }
            activityStreamerProfileBinding2.cityBtn.setChecked(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
            if (activityStreamerProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityStreamerProfileBinding = activityStreamerProfileBinding3;
            }
            activityStreamerProfileBinding.statusTxt.setText(2131953093);
            return;
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        activityStreamerProfileBinding4.cityBtn.setChecked(false);
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding = activityStreamerProfileBinding5;
        }
        activityStreamerProfileBinding.statusTxt.setText(2131952360);
    }

    public final void showAgeStatus(boolean showAge) {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = null;
        if (showAge) {
            ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
            if (activityStreamerProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding2 = null;
            }
            activityStreamerProfileBinding2.ageBtn.setChecked(true);
            ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
            if (activityStreamerProfileBinding3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
            } else {
                activityStreamerProfileBinding = activityStreamerProfileBinding3;
            }
            activityStreamerProfileBinding.ageStatusTxt.setText(2131953093);
            return;
        }
        ActivityStreamerProfileBinding activityStreamerProfileBinding4 = this.binding;
        if (activityStreamerProfileBinding4 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding4 = null;
        }
        activityStreamerProfileBinding4.ageBtn.setChecked(false);
        ActivityStreamerProfileBinding activityStreamerProfileBinding5 = this.binding;
        if (activityStreamerProfileBinding5 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
        } else {
            activityStreamerProfileBinding = activityStreamerProfileBinding5;
        }
        activityStreamerProfileBinding.ageStatusTxt.setText(2131952360);
    }

    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) {
                MyProfileActivity.showGenderDialog$lambda$14(strArr, this, dialogInterface, i);
            }
        });
        AlertDialog create = builder.create();
        Intrinsics.checkNotNullExpressionValue(create, "builder.create()");
        create.show();
    }

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

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

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

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

    public final void setUpChosenInterestList(ArrayList<InterestResponse> interests) {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        activityStreamerProfileBinding.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));
            ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
            if (activityStreamerProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding2 = null;
            }
            activityStreamerProfileBinding2.selectedInterestGroup.addView(view);
        }
    }

    public final void setUpChosenLanguageList(ArrayList<LanguageResponse> languages) {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        activityStreamerProfileBinding.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));
            ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
            if (activityStreamerProfileBinding2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding2 = null;
            }
            activityStreamerProfileBinding2.selectedLanguageGroup.addView(view);
        }
    }

    public final void createProfileInterest(ArrayList<ProfileInterests> profileInterests) {
        ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
        if (activityStreamerProfileBinding == null) {
            Intrinsics.throwUninitializedPropertyAccessException("binding");
            activityStreamerProfileBinding = null;
        }
        activityStreamerProfileBinding.tagsParent.removeAllViews();
        for (ProfileInterests profileInterests2 : profileInterests) {
            try {
                ActivityStreamerProfileBinding activityStreamerProfileBinding2 = this.binding;
                if (activityStreamerProfileBinding2 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding2 = null;
                }
                activityStreamerProfileBinding2.tagsParent.addView(createLinearLayout((Context) this, profileInterests2));
                Context context = (Context) this;
                ActivityStreamerProfileBinding activityStreamerProfileBinding3 = this.binding;
                if (activityStreamerProfileBinding3 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("binding");
                    activityStreamerProfileBinding3 = null;
                }
                LinearLayout linearLayout = activityStreamerProfileBinding3.tagsParent;
                Intrinsics.checkNotNullExpressionValue(linearLayout, "binding.tagsParent");
                ChipGroup createChipGroup = createChipGroup(context, linearLayout);
                Iterator<Tags> it = profileInterests2.getTags().iterator();
                while (it.hasNext()) {
                    Tags next = it.next();
                    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.getName());
                    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(ContextCompat.getColorStateList((Context) this, 2131100106));
                    createChipGroup.addView(view);
                }
            } catch (Exception e) {
                Timber.e(e);
            }
        }
    }

    private final LinearLayout createLinearLayout(Context context, ProfileInterests profileInterest) {
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
        LinearLayout linearLayout = new LinearLayout(context);
        linearLayout.setLayoutParams(layoutParams);
        linearLayout.setOrientation(0);
        linearLayout.setGravity(16);
        linearLayout.setPadding(0, 8, 8, 0);
        linearLayout.setBackgroundColor(-1);
        linearLayout.addView(createTextView(context, profileInterest.getCategoryName() + ':', 18.0f));
        linearLayout.addView(createEditLanguageLayout(context, profileInterest));
        return linearLayout;
    }

    private final TextView createTextView(Context context, String text, float textSize) {
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.weight = 1.0f;
        TextView textView = new TextView(context);
        textView.setText(text);
        textView.setLayoutParams(layoutParams);
        textView.setTextColor(ContextCompat.getColor(context, com.asynctaskcoffee.audiorecorder.R.color.black_50));
        textView.setTextSize(2, textSize);
        textView.setTypeface(ResourcesCompat.getFont(context, 2131296262));
        textView.setTypeface(textView.getTypeface(), 1);
        return textView;
    }

    private final LinearLayout createEditLanguageLayout(Context context, final ProfileInterests profileInterest) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(new int[]{R.attr.selectableItemBackground});
        Intrinsics.checkNotNullExpressionValue(obtainStyledAttributes, "context.obtainStyledAttributes(attrs)");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        LinearLayout linearLayout = new LinearLayout(context);
        linearLayout.setLayoutParams(layoutParams);
        linearLayout.setBackground(obtainStyledAttributes.getDrawable(0));
        linearLayout.setClickable(true);
        linearLayout.setGravity(8388613);
        obtainStyledAttributes.recycle();
        ImageView imageView = new ImageView(context);
        imageView.setLayoutParams(new LinearLayout.LayoutParams(getResources().getDimensionPixelSize(2131167017), -1));
        imageView.setImageResource(2131231586);
        imageView.setVisibility(0);
        String string = getString(2131951968);
        Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.edit)");
        TextView createTextView = createTextView(context, string, 16.0f);
        createTextView.setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
        createTextView.setPadding(2, 2, 2, 2);
        linearLayout.addView(imageView);
        linearLayout.addView(createTextView);
        linearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MyProfileActivity.createEditLanguageLayout$lambda$16(MyProfileActivity.this, profileInterest, view);
            }
        });
        return linearLayout;
    }

    public static final void createEditLanguageLayout$lambda$16(MyProfileActivity myProfileActivity, ProfileInterests profileInterests, View view) {
        Intrinsics.checkNotNullParameter(myProfileActivity, "this$0");
        Intrinsics.checkNotNullParameter(profileInterests, "$profileInterest");
        myProfileActivity.showFillProfileInterestDialog(profileInterests);
    }

    private final ChipGroup createChipGroup(Context context, ViewGroup parentView) {
        ChipGroup chipGroup = new ChipGroup(context);
        chipGroup.setLayoutParams(new ViewGroup.LayoutParams(-2, -2));
        int dimensionPixelSize = getResources().getDimensionPixelSize(2131167014);
        chipGroup.setPadding(getResources().getDimensionPixelSize(2131167014), dimensionPixelSize, dimensionPixelSize, dimensionPixelSize);
        parentView.addView((View) chipGroup);
        return chipGroup;
    }

    private final void showFillProfileInterestDialog(ProfileInterests profileInterests) {
        try {
            EditProfileInterestDialog editProfileInterestDialog = new EditProfileInterestDialog(profileInterests, new Function0<Unit>() {
                {
                    super(0);
                }

                public Object invoke() {
                    m2220invoke();
                    return Unit.INSTANCE;
                }

                public final void m2220invoke() {
                    MyProfileActivity.this.refresh();
                }
            });
            editProfileInterestDialog.show(getSupportFragmentManager(), editProfileInterestDialog.getTag());
        } catch (Exception e) {
            Timber.e(e);
        }
    }

    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;
    }

    public final void canCompress(Uri uri) {
        String pathFromURI = Files.getPathFromURI((Context) this, uri);
        if (pathFromURI != null) {
            if (Helper.isFileGreaterThan(new File(pathFromURI), 15)) {
                compression(uri);
                return;
            }
            ActivityStreamerProfileBinding activityStreamerProfileBinding = this.binding;
            if (activityStreamerProfileBinding == null) {
                Intrinsics.throwUninitializedPropertyAccessException("binding");
                activityStreamerProfileBinding = null;
            }
            activityStreamerProfileBinding.auditionVideoPicker.addItem(pathFromURI);
            UploadProgressHelper uploadProgressHelper = this.uploadProgressHelper;
            if (uploadProgressHelper != null) {
                uploadProgressHelper.setProgressDialog();
            }
            ArrayList arrayList = new ArrayList();
            arrayList.add(pathFromURI);
            UserViewModel.uploadAuditionVideo$default(getViewModel(), arrayList, true, false, 4, null);
            return;
        }
        compression(uri);
    }

    private final void compression(Uri uri) {
        try {
            showProgressDialog();
            BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new MyProfileActivity$compression$1(this, CollectionsKt.listOf(uri), null), 3, (Object) null);
        } catch (Exception unused) {
            ActivityExtKt.toast((Activity) this, "Something went wrong try again later.");
        }
    }

    private final void showProgressDialog() {
        ProgressDialog progressDialog = new ProgressDialog((Context) this);
        this.progressDialog = progressDialog;
        progressDialog.setTitle(getString(2131951907));
        ProgressDialog progressDialog2 = this.progressDialog;
        if (progressDialog2 != null) {
            progressDialog2.setProgressStyle(1);
        }
        ProgressDialog progressDialog3 = this.progressDialog;
        if (progressDialog3 != null) {
            progressDialog3.setCancelable(false);
        }
        ProgressDialog progressDialog4 = this.progressDialog;
        if (progressDialog4 != null) {
            progressDialog4.setIndeterminate(false);
        }
        ProgressDialog progressDialog5 = this.progressDialog;
        if (progressDialog5 != null) {
            progressDialog5.setMax(100);
        }
        ProgressDialog progressDialog6 = this.progressDialog;
        if (progressDialog6 != null) {
            progressDialog6.setProgress(0);
        }
        ProgressDialog progressDialog7 = this.progressDialog;
        if (progressDialog7 != null) {
            progressDialog7.show();
        }
    }

    public final void progressDialogPercent(float progress) {
        ProgressDialog progressDialog;
        ProgressDialog progressDialog2 = this.progressDialog;
        if (progressDialog2 != null) {
            if (!(progressDialog2 != null && progressDialog2.isShowing()) || (progressDialog = this.progressDialog) == null) {
                return;
            }
            progressDialog.setProgress((int) progress);
        }
    }

    public final void hideProgressDialog() {
        ProgressDialog progressDialog;
        ProgressDialog progressDialog2 = this.progressDialog;
        if (progressDialog2 != null) {
            if (!(progressDialog2 != null && progressDialog2.isShowing()) || (progressDialog = this.progressDialog) == null) {
                return;
            }
            progressDialog.dismiss();
        }
    }

    @Override
    public void finishProfileActivity() {
        finish();
    }
}