正在查看: Biko v2.0.23 应用的 ApplyStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 ApplyStreamerActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.user;
import android.R;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelLazy;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.viewmodel.CreationExtras;
import app.callpe.common.utils.DateHelper;
import app.callpe.common.utils.ResultState;
import app.callpe.common.utils.custom.PhotoPickerView;
import app.callpe.common.utils.custom.ProfilePhotoPickerView;
import app.callpe.common.utils.extensions.StringExtKt;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.KycData;
import app.callpe.data.model.LoginResponse;
import app.callpe.data.repository.upload.UploadProgressHelper;
import app.callpe.databinding.ActivityApplyStreamerBinding;
import app.callpe.ui.dialog.DobPickerDialog;
import app.callpe.ui.home.HomeActivity;
import com.facebook.internal.NativeProtocol;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputEditText;
import com.google.gson.Gson;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.ArrayList;
import java.util.Arrays;
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.Reflection;
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|\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\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\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\b\u0007\u0018\u0000 ;2\u00020\u00012\u00020\u0002:\u0002;<B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0018\u001a\u00020\u0019H\u0002J\b\u0010\u001a\u001a\u00020\u0019H\u0002J\b\u0010\u001b\u001a\u00020\u001cH\u0002J\b\u0010\u001d\u001a\u00020\u0019H\u0002J\b\u0010\u001e\u001a\u00020\u0019H\u0002J\u0012\u0010\u001f\u001a\u00020\u00192\b\u0010 \u001a\u0004\u0018\u00010!H\u0014J\u0012\u0010\"\u001a\u00020\u00192\b\u0010#\u001a\u0004\u0018\u00010$H\u0014J\u0010\u0010%\u001a\u00020&2\u0006\u0010'\u001a\u00020(H\u0016J\u001e\u0010)\u001a\u00020\u00192\u0006\u0010*\u001a\u00020+2\f\u0010,\u001a\b\u0012\u0004\u0012\u00020\u00060-H\u0016J\u001e\u0010.\u001a\u00020\u00192\u0006\u0010*\u001a\u00020+2\f\u0010,\u001a\b\u0012\u0004\u0012\u00020\u00060-H\u0016J-\u0010/\u001a\u00020\u00192\u0006\u0010*\u001a\u00020+2\u000e\u00100\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u00052\u0006\u00101\u001a\u000202H\u0016¢\u0006\u0002\u00103J\u0010\u00104\u001a\u00020\u00192\u0006\u00105\u001a\u000206H\u0002J\b\u00107\u001a\u00020\u0019H\u0002J\b\u00108\u001a\u00020\u0019H\u0002J\b\u00109\u001a\u00020\u0019H\u0002J\b\u0010:\u001a\u00020\u0019H\u0002R\u0016\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\u000e\u0010\t\u001a\u00020\nX\u0082.¢\u0006\u0002\n\u0000R\u001a\u0010\u000b\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0012\u001a\u00020\u00138BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0016\u0010\u0017\u001a\u0004\b\u0014\u0010\u0015¨\u0006="}, d2 = {"Lapp/callpe/ui/user/ApplyStreamerActivity;", "Landroidx/appcompat/app/AppCompatActivity;", "Lpub/devrel/easypermissions/EasyPermissions$PermissionCallbacks;", "()V", "PERMISSIONS_Q", "", "", "[Ljava/lang/String;", "PERMISSIONS_R", "binding", "Lapp/callpe/databinding/ActivityApplyStreamerBinding;", "currentDate", "getCurrentDate", "()Ljava/lang/String;", "setCurrentDate", "(Ljava/lang/String;)V", "uploadProgressHelper", "Lapp/callpe/data/repository/upload/UploadProgressHelper;", "viewModel", "Lapp/callpe/ui/user/UserViewModel;", "getViewModel", "()Lapp/callpe/ui/user/UserViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "getIntentValues", "", "goToHomeActivity", "observeEvent", "Lkotlinx/coroutines/Job;", "observeUploadProgress", "onClick", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onNewIntent", "intent", "Landroid/content/Intent;", "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;", "requestPermissions", "save", "setUpToolbar", "updateStreamer", "Companion", "StreamerStatus", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class ApplyStreamerActivity extends Hilt_ApplyStreamerActivity implements EasyPermissions.PermissionCallbacks {
public static final int RC_STORAGE_PERMISSION = 1010;
private ActivityApplyStreamerBinding binding;
private UploadProgressHelper uploadProgressHelper;
private final Lazy viewModel;
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"};
private String currentDate = DateHelper.getTodayDate();
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\t\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\u0005j\u0002\b\u0006j\u0002\b\u0007j\u0002\b\bj\u0002\b\t¨\u0006\n"}, d2 = {"Lapp/callpe/ui/user/ApplyStreamerActivity$StreamerStatus;", "", "(Ljava/lang/String;I)V", "CREATED", "PASSED", "APPROVED", "REJECTED", "IGNORED", "SUSPENDED", "DATA_PENDING", "app_bikoRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public enum StreamerStatus {
CREATED,
PASSED,
APPROVED,
REJECTED,
IGNORED,
SUSPENDED,
DATA_PENDING
}
public void onPermissionsGranted(int requestCode, List<String> perms) {
Intrinsics.checkNotNullParameter(perms, "perms");
}
public ApplyStreamerActivity() {
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 m2170invoke() {
return componentActivity.getViewModelStore();
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m2169invoke() {
return componentActivity.getDefaultViewModelProviderFactory();
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m2171invoke() {
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 String getCurrentDate() {
return this.currentDate;
}
public final void setCurrentDate(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.currentDate = str;
}
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityApplyStreamerBinding inflate = ActivityApplyStreamerBinding.inflate(getLayoutInflater());
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
this.binding = inflate;
ActivityApplyStreamerBinding activityApplyStreamerBinding = null;
if (inflate == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
inflate = null;
}
setContentView(inflate.getRoot());
requestPermissions();
setUpToolbar();
ActivityApplyStreamerBinding activityApplyStreamerBinding2 = this.binding;
if (activityApplyStreamerBinding2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityApplyStreamerBinding = activityApplyStreamerBinding2;
}
activityApplyStreamerBinding.photoPicker.setCustomCamera(true);
this.uploadProgressHelper = new UploadProgressHelper((Context) this, (Activity) this);
observeEvent();
observeUploadProgress();
onClick();
getIntentValues();
}
private final void setUpToolbar() {
try {
ActivityApplyStreamerBinding activityApplyStreamerBinding = this.binding;
if (activityApplyStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding = null;
}
setSupportActionBar(activityApplyStreamerBinding.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() {
ActivityApplyStreamerBinding activityApplyStreamerBinding = this.binding;
if (activityApplyStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding = null;
}
TextInputEditText textInputEditText = activityApplyStreamerBinding.userName;
String stringExtra = getIntent().getStringExtra("user_name");
if (stringExtra == null) {
stringExtra = "";
}
textInputEditText.setText(stringExtra);
Intent intent = getIntent();
if (intent == null || !intent.getBooleanExtra("edit", false)) {
return;
}
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 ApplyStreamerActivity$observeEvent$1(this, null), 3, (Object) null);
}
public final void prefillData(app.callpe.data.model.Metadata data) {
String str;
String formatDateByPattern;
ActivityApplyStreamerBinding activityApplyStreamerBinding = this.binding;
ActivityApplyStreamerBinding activityApplyStreamerBinding2 = null;
if (activityApplyStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding = null;
}
ProfilePhotoPickerView profilePhotoPickerView = activityApplyStreamerBinding.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);
List<String> kycPictures = data.getUser().getKycPictures();
Intrinsics.checkNotNull(kycPictures, "null cannot be cast to non-null type java.util.ArrayList<kotlin.String>{ kotlin.collections.TypeAliasesKt.ArrayList<kotlin.String> }");
ArrayList arrayList = (ArrayList) kycPictures;
if (arrayList.size() == 1) {
ActivityApplyStreamerBinding activityApplyStreamerBinding3 = this.binding;
if (activityApplyStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding3 = null;
}
PhotoPickerView photoPickerView = activityApplyStreamerBinding3.kycPicker;
Object obj = arrayList.get(0);
Intrinsics.checkNotNullExpressionValue(obj, "kycPics[0]");
photoPickerView.addItems(CollectionsKt.arrayListOf(new String[]{(String) obj}));
ActivityApplyStreamerBinding activityApplyStreamerBinding4 = this.binding;
if (activityApplyStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding4 = null;
}
activityApplyStreamerBinding4.kycPicker.hideAddBtn(true);
} else if (arrayList.size() == 2) {
ActivityApplyStreamerBinding activityApplyStreamerBinding5 = this.binding;
if (activityApplyStreamerBinding5 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding5 = null;
}
PhotoPickerView photoPickerView2 = activityApplyStreamerBinding5.kycPicker;
Object obj2 = arrayList.get(0);
Intrinsics.checkNotNullExpressionValue(obj2, "kycPics[0]");
photoPickerView2.addItems(CollectionsKt.arrayListOf(new String[]{(String) obj2}));
ActivityApplyStreamerBinding activityApplyStreamerBinding6 = this.binding;
if (activityApplyStreamerBinding6 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding6 = null;
}
PhotoPickerView photoPickerView3 = activityApplyStreamerBinding6.kycPickerBack;
Object obj3 = arrayList.get(1);
Intrinsics.checkNotNullExpressionValue(obj3, "kycPics[1]");
photoPickerView3.addItems(CollectionsKt.arrayListOf(new String[]{(String) obj3}));
ActivityApplyStreamerBinding activityApplyStreamerBinding7 = this.binding;
if (activityApplyStreamerBinding7 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding7 = null;
}
activityApplyStreamerBinding7.kycPicker.hideAddBtn(true);
ActivityApplyStreamerBinding activityApplyStreamerBinding8 = this.binding;
if (activityApplyStreamerBinding8 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding8 = null;
}
activityApplyStreamerBinding8.kycPickerBack.hideAddBtn(true);
} else if (!arrayList.isEmpty()) {
ActivityApplyStreamerBinding activityApplyStreamerBinding9 = this.binding;
if (activityApplyStreamerBinding9 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding9 = null;
}
PhotoPickerView photoPickerView4 = activityApplyStreamerBinding9.kycPicker;
Object obj4 = arrayList.get(0);
Intrinsics.checkNotNullExpressionValue(obj4, "kycPics[0]");
photoPickerView4.addItems(CollectionsKt.arrayListOf(new String[]{(String) obj4}));
ActivityApplyStreamerBinding activityApplyStreamerBinding10 = this.binding;
if (activityApplyStreamerBinding10 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding10 = null;
}
PhotoPickerView photoPickerView5 = activityApplyStreamerBinding10.kycPickerBack;
Object obj5 = arrayList.get(1);
Intrinsics.checkNotNullExpressionValue(obj5, "kycPics[1]");
photoPickerView5.addItems(CollectionsKt.arrayListOf(new String[]{(String) obj5}));
ActivityApplyStreamerBinding activityApplyStreamerBinding11 = this.binding;
if (activityApplyStreamerBinding11 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding11 = null;
}
activityApplyStreamerBinding11.kycPicker.hideAddBtn(true);
ActivityApplyStreamerBinding activityApplyStreamerBinding12 = this.binding;
if (activityApplyStreamerBinding12 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding12 = null;
}
activityApplyStreamerBinding12.kycPickerBack.hideAddBtn(true);
}
ActivityApplyStreamerBinding activityApplyStreamerBinding13 = this.binding;
if (activityApplyStreamerBinding13 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding13 = null;
}
activityApplyStreamerBinding13.videoPicker.addItem(data.getUser().getIntroVideo());
ActivityApplyStreamerBinding activityApplyStreamerBinding14 = this.binding;
if (activityApplyStreamerBinding14 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding14 = null;
}
TextInputEditText textInputEditText = activityApplyStreamerBinding14.aboutMe;
String aboutMe = data.getUser().getAboutMe();
if (aboutMe == null) {
aboutMe = "";
}
textInputEditText.setText(aboutMe);
ActivityApplyStreamerBinding activityApplyStreamerBinding15 = this.binding;
if (activityApplyStreamerBinding15 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding15 = null;
}
TextInputEditText textInputEditText2 = activityApplyStreamerBinding15.realName;
KycData kycData = data.getUser().getKycData();
if (kycData == null || (str = kycData.getRealName()) == null) {
str = "";
}
textInputEditText2.setText(str);
ActivityApplyStreamerBinding activityApplyStreamerBinding16 = this.binding;
if (activityApplyStreamerBinding16 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding16 = null;
}
MaterialButton materialButton = activityApplyStreamerBinding16.selectDobBtn;
String dob = data.getUser().getDob();
materialButton.setText((dob == null || (formatDateByPattern = StringExtKt.formatDateByPattern(dob, "yyyy-MM-dd", "dd-MM-yyyy")) == null) ? getString(2131952570) : formatDateByPattern);
String dob2 = data.getUser().getDob();
if (dob2 == null) {
dob2 = DateHelper.getTodayDate();
}
this.currentDate = dob2;
ActivityApplyStreamerBinding activityApplyStreamerBinding17 = this.binding;
if (activityApplyStreamerBinding17 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding17 = null;
}
TextInputEditText textInputEditText3 = activityApplyStreamerBinding17.userName;
String name = data.getUser().getName();
textInputEditText3.setText(name != null ? name : "");
ActivityApplyStreamerBinding activityApplyStreamerBinding18 = this.binding;
if (activityApplyStreamerBinding18 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityApplyStreamerBinding2 = activityApplyStreamerBinding18;
}
activityApplyStreamerBinding2.videoPicker.hideAddBtn(true);
}
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));
}
Toast toast = new Toast(context);
String string = getString(2131952606);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.strea…plication_submit_message)");
ToastKt.showCustomToast(toast, string, (Activity) this);
goToHomeActivity();
}
private final void goToHomeActivity() {
Intent intent = new Intent((Context) this, (Class<?>) HomeActivity.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 ApplyStreamerActivity$sam$androidx_lifecycle_Observer$0(new Function1<ResultState<? extends Double>, Unit>() {
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[ResultState.Status.values().length];
try {
iArr[ResultState.Status.LOADING.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
iArr[ResultState.Status.ERROR.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
iArr[ResultState.Status.SUCCESS.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
iArr[ResultState.Status.RESET.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
$EnumSwitchMapping$0 = iArr;
}
}
{
super(1);
}
public Object invoke(Object obj) {
invoke((ResultState<Double>) obj);
return Unit.INSTANCE;
}
public final void invoke(ResultState<Double> resultState) {
UploadProgressHelper uploadProgressHelper;
UploadProgressHelper uploadProgressHelper2;
UploadProgressHelper uploadProgressHelper3;
UploadProgressHelper uploadProgressHelper4;
UploadProgressHelper uploadProgressHelper5;
int i = WhenMappings.$EnumSwitchMapping$0[resultState.getStatus().ordinal()];
if (i == 1) {
uploadProgressHelper = ApplyStreamerActivity.this.uploadProgressHelper;
if (uploadProgressHelper != null) {
Double data = resultState.getData();
uploadProgressHelper.progressDialogPercent(data != null ? (float) data.doubleValue() : 0.0f);
return;
}
return;
}
if (i == 2) {
uploadProgressHelper2 = ApplyStreamerActivity.this.uploadProgressHelper;
if (uploadProgressHelper2 != null) {
uploadProgressHelper2.dismiss();
return;
}
return;
}
if (i == 3) {
uploadProgressHelper3 = ApplyStreamerActivity.this.uploadProgressHelper;
if (uploadProgressHelper3 != null) {
uploadProgressHelper3.dismiss();
return;
}
return;
}
if (i != 4) {
return;
}
uploadProgressHelper4 = ApplyStreamerActivity.this.uploadProgressHelper;
if (uploadProgressHelper4 != null) {
uploadProgressHelper4.dismiss();
}
uploadProgressHelper5 = ApplyStreamerActivity.this.uploadProgressHelper;
if (uploadProgressHelper5 != null) {
uploadProgressHelper5.setProgressDialog();
}
}
}));
}
private final void onClick() {
ActivityApplyStreamerBinding activityApplyStreamerBinding = this.binding;
ActivityApplyStreamerBinding activityApplyStreamerBinding2 = null;
if (activityApplyStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding = null;
}
activityApplyStreamerBinding.videoPicker.setOnlyCamera(true);
ActivityApplyStreamerBinding activityApplyStreamerBinding3 = this.binding;
if (activityApplyStreamerBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding3 = null;
}
activityApplyStreamerBinding3.submitBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ApplyStreamerActivity.onClick$lambda$1(ApplyStreamerActivity.this, view);
}
});
ActivityApplyStreamerBinding activityApplyStreamerBinding4 = this.binding;
if (activityApplyStreamerBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
activityApplyStreamerBinding2 = activityApplyStreamerBinding4;
}
activityApplyStreamerBinding2.selectDobBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ApplyStreamerActivity.onClick$lambda$2(ApplyStreamerActivity.this, view);
}
});
}
public static final void onClick$lambda$1(ApplyStreamerActivity applyStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(applyStreamerActivity, "this$0");
applyStreamerActivity.save();
}
public static final void onClick$lambda$2(final ApplyStreamerActivity applyStreamerActivity, View view) {
Intrinsics.checkNotNullParameter(applyStreamerActivity, "this$0");
DobPickerDialog dobPickerDialog = new DobPickerDialog(applyStreamerActivity.currentDate, new Function1<String, Unit>() {
{
super(1);
}
public Object invoke(Object obj) {
invoke((String) obj);
return Unit.INSTANCE;
}
public final void invoke(String str) {
ActivityApplyStreamerBinding activityApplyStreamerBinding;
Intrinsics.checkNotNullParameter(str, "it");
activityApplyStreamerBinding = ApplyStreamerActivity.this.binding;
if (activityApplyStreamerBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
activityApplyStreamerBinding = null;
}
activityApplyStreamerBinding.selectDobBtn.setText(StringExtKt.formatDateByPattern(str, "yyyy-MM-dd", "dd-MM-yyyy"));
ApplyStreamerActivity.this.setCurrentDate(str);
}
});
dobPickerDialog.show(applyStreamerActivity.getSupportFragmentManager(), dobPickerDialog.getTag());
}
private final void save() {
throw new UnsupportedOperationException("Method not decompiled: app.callpe.ui.user.ApplyStreamerActivity.save():void");
}
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());
}
}
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
getIntentValues();
}
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;
}
}