正在查看: Rilo v2.0.21 应用的 RateUsSheet.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 RateUsSheet.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package app.callpe.ui.bottomsheet;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.LinearLayout;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import app.callpe.common.utils.FileUriUtils;
import app.callpe.common.utils.PermissionHelper;
import app.callpe.common.utils.ResultState;
import app.callpe.common.utils.file_helper.CompressFile;
import app.callpe.common.utils.helper_functions.DialogHelper;
import app.callpe.data.repository.upload.UploadProgressHelper;
import app.callpe.databinding.RateUsSheetBinding;
import app.callpe.service.ApiService;
import app.callpe.ui.chat.ChatActivity;
import app.callpe.ui.user.UserViewModel;
import com.birjuvachhani.locus.R;
import com.crazylegend.core.dto.Config;
import com.crazylegend.core.modifiers.base.BaseSinglePickerModifier;
import com.crazylegend.imagepicker.images.ImageModel;
import com.crazylegend.imagepicker.pickers.SingleImagePicker;
import com.facebook.internal.NativeProtocol;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import dagger.hilt.android.AndroidEntryPoint;
import java.io.File;
import javax.inject.Inject;
import kotlin.Deprecated;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.LazyThreadSafetyMode;
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.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
import timber.log.Timber;
@Metadata(d1 = {"\u0000\u0080\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\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\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\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\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0015\n\u0002\b\u0007\b\u0007\u0018\u0000 <2\u00020\u0001:\u0002;<B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020 H\u0002J\b\u0010!\u001a\u00020\"H\u0002J\b\u0010#\u001a\u00020\u001eH\u0002J\b\u0010$\u001a\u00020\u001eH\u0002J\u0012\u0010%\u001a\u00020\u001e2\b\u0010&\u001a\u0004\u0018\u00010'H\u0016J$\u0010(\u001a\u00020)2\u0006\u0010*\u001a\u00020+2\b\u0010,\u001a\u0004\u0018\u00010-2\b\u0010&\u001a\u0004\u0018\u00010'H\u0016J\u0010\u0010.\u001a\u00020\u001e2\u0006\u0010/\u001a\u000200H\u0016J\b\u00101\u001a\u00020\u001eH\u0002J-\u00102\u001a\u00020\u001e2\u0006\u00103\u001a\u0002042\u000e\u0010\u0011\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00130\u00122\u0006\u00105\u001a\u000206H\u0017¢\u0006\u0002\u00107J\u001a\u00108\u001a\u00020\u001e2\u0006\u00109\u001a\u00020)2\b\u0010&\u001a\u0004\u0018\u00010'H\u0016J\b\u0010:\u001a\u00020\u001eH\u0002R\u001e\u0010\u0003\u001a\u00020\u00048\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u000e\u0010\t\u001a\u00020\nX\u0082.¢\u0006\u0002\n\u0000R\u001c\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u0016\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00130\u0012X\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u0014R\u0010\u0010\u0015\u001a\u0004\u0018\u00010\u0016X\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0017\u001a\u00020\u00188BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001b\u0010\u001c\u001a\u0004\b\u0019\u0010\u001a¨\u0006="}, d2 = {"Lapp/callpe/ui/bottomsheet/RateUsSheet;", "Lcom/google/android/material/bottomsheet/BottomSheetDialogFragment;", "()V", "apiService", "Lapp/callpe/service/ApiService;", "getApiService", "()Lapp/callpe/service/ApiService;", "setApiService", "(Lapp/callpe/service/ApiService;)V", "binding", "Lapp/callpe/databinding/RateUsSheetBinding;", "listener", "Lapp/callpe/ui/bottomsheet/RateUsSheet$BottomSheetDialogListener;", "getListener", "()Lapp/callpe/ui/bottomsheet/RateUsSheet$BottomSheetDialogListener;", "setListener", "(Lapp/callpe/ui/bottomsheet/RateUsSheet$BottomSheetDialogListener;)V", NativeProtocol.RESULT_ARGS_PERMISSIONS, "", "", "[Ljava/lang/String;", "uploadProgressHelper", "Lapp/callpe/data/repository/upload/UploadProgressHelper;", "viewModel", "Lapp/callpe/ui/user/UserViewModel;", "getViewModel", "()Lapp/callpe/ui/user/UserViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "loadImage", "", "imageModel", "Lcom/crazylegend/imagepicker/images/ImageModel;", "observeEvent", "Lkotlinx/coroutines/Job;", "observeUploadProgress", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onCreateView", "Landroid/view/View;", "inflater", "Landroid/view/LayoutInflater;", "container", "Landroid/view/ViewGroup;", "onDismiss", "dialog", "Landroid/content/DialogInterface;", "onGalleryClick", "onRequestPermissionsResult", "requestCode", "", "grantResults", "", "(I[Ljava/lang/String;[I)V", "onViewCreated", "view", "showMessageText", "BottomSheetDialogListener", "Companion", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class RateUsSheet extends Hilt_RateUsSheet {
public static final Companion INSTANCE = new Companion(null);
@Inject
public ApiService apiService;
private RateUsSheetBinding binding;
private BottomSheetDialogListener listener;
private String[] permissions;
private UploadProgressHelper uploadProgressHelper;
private final Lazy viewModel;
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&¨\u0006\u0004"}, d2 = {"Lapp/callpe/ui/bottomsheet/RateUsSheet$BottomSheetDialogListener;", "", "onBottomSheetDismissed", "", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public interface BottomSheetDialogListener {
void onBottomSheetDismissed();
}
public RateUsSheet() {
final Fragment fragment = (Fragment) this;
final Function0<Fragment> function0 = new Function0<Fragment>() {
{
super(0);
}
public final Fragment m786invoke() {
return fragment;
}
};
final Lazy lazy = LazyKt.lazy(LazyThreadSafetyMode.NONE, new Function0<ViewModelStoreOwner>() {
{
super(0);
}
public final ViewModelStoreOwner m787invoke() {
return (ViewModelStoreOwner) function0.invoke();
}
});
final Function0 function02 = null;
this.viewModel = FragmentViewModelLazyKt.createViewModelLazy(fragment, Reflection.getOrCreateKotlinClass(UserViewModel.class), new Function0<ViewModelStore>() {
{
super(0);
}
public final ViewModelStore m788invoke() {
ViewModelStore viewModelStore = FragmentViewModelLazyKt.access$viewModels$lambda-1(lazy).getViewModelStore();
Intrinsics.checkNotNullExpressionValue(viewModelStore, "owner.viewModelStore");
return viewModelStore;
}
}, new Function0<CreationExtras>() {
{
super(0);
}
public final CreationExtras m789invoke() {
CreationExtras creationExtras;
Function0 function03 = function02;
if (function03 != null && (creationExtras = (CreationExtras) function03.invoke()) != null) {
return creationExtras;
}
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = FragmentViewModelLazyKt.access$viewModels$lambda-1(lazy);
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory2 = hasDefaultViewModelProviderFactory instanceof HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactory : null;
CreationExtras defaultViewModelCreationExtras = hasDefaultViewModelProviderFactory2 != null ? hasDefaultViewModelProviderFactory2.getDefaultViewModelCreationExtras() : null;
return defaultViewModelCreationExtras == null ? CreationExtras.Empty.INSTANCE : defaultViewModelCreationExtras;
}
}, new Function0<ViewModelProvider.Factory>() {
{
super(0);
}
public final ViewModelProvider.Factory m790invoke() {
ViewModelProvider.Factory defaultViewModelProviderFactory;
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory = FragmentViewModelLazyKt.access$viewModels$lambda-1(lazy);
HasDefaultViewModelProviderFactory hasDefaultViewModelProviderFactory2 = hasDefaultViewModelProviderFactory instanceof HasDefaultViewModelProviderFactory ? hasDefaultViewModelProviderFactory : null;
if (hasDefaultViewModelProviderFactory2 == null || (defaultViewModelProviderFactory = hasDefaultViewModelProviderFactory2.getDefaultViewModelProviderFactory()) == null) {
defaultViewModelProviderFactory = fragment.getDefaultViewModelProviderFactory();
}
Intrinsics.checkNotNullExpressionValue(defaultViewModelProviderFactory, "(owner as? HasDefaultVie…tViewModelProviderFactory");
return defaultViewModelProviderFactory;
}
});
this.permissions = new String[]{"android.permission.RECORD_AUDIO", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"};
}
public final UserViewModel getViewModel() {
return (UserViewModel) this.viewModel.getValue();
}
public final BottomSheetDialogListener getListener() {
return this.listener;
}
public final void setListener(BottomSheetDialogListener bottomSheetDialogListener) {
this.listener = bottomSheetDialogListener;
}
public final ApiService getApiService() {
ApiService apiService = this.apiService;
if (apiService != null) {
return apiService;
}
Intrinsics.throwUninitializedPropertyAccessException("apiService");
return null;
}
public final void setApiService(ApiService apiService) {
Intrinsics.checkNotNullParameter(apiService, "<set-?>");
this.apiService = apiService;
}
public void onDismiss(DialogInterface dialog) {
Intrinsics.checkNotNullParameter(dialog, "dialog");
super.onDismiss(dialog);
BottomSheetDialogListener bottomSheetDialogListener = this.listener;
if (bottomSheetDialogListener != null) {
bottomSheetDialogListener.onBottomSheetDismissed();
}
}
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004¨\u0006\u0005"}, d2 = {"Lapp/callpe/ui/bottomsheet/RateUsSheet$Companion;", "", "()V", "newInstance", "Lapp/callpe/ui/bottomsheet/RateUsSheet;", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final RateUsSheet newInstance() {
return new RateUsSheet();
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(0, 2132017165);
}
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Window window;
Intrinsics.checkNotNullParameter(inflater, "inflater");
RateUsSheetBinding inflate = RateUsSheetBinding.inflate(inflater, container, false);
Intrinsics.checkNotNullExpressionValue(inflate, "inflate(inflater, container, false)");
this.binding = inflate;
Dialog dialog = getDialog();
if (dialog != null && (window = dialog.getWindow()) != null) {
window.setSoftInputMode(16);
}
Dialog dialog2 = getDialog();
if (dialog2 != null) {
dialog2.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public final void onShow(DialogInterface dialogInterface) {
RateUsSheet.onCreateView$lambda$1(dialogInterface);
}
});
}
RateUsSheetBinding rateUsSheetBinding = this.binding;
if (rateUsSheetBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
rateUsSheetBinding = null;
}
LinearLayout root = rateUsSheetBinding.getRoot();
Intrinsics.checkNotNullExpressionValue(root, "binding.root");
return root;
}
public static final void onCreateView$lambda$1(DialogInterface dialogInterface) {
Intrinsics.checkNotNull(dialogInterface, "null cannot be cast to non-null type com.google.android.material.bottomsheet.BottomSheetDialog");
View findViewById = ((BottomSheetDialog) dialogInterface).findViewById(R.id.design_bottom_sheet);
if (findViewById != null) {
BottomSheetBehavior.from(findViewById).setState(3);
}
}
public void onViewCreated(View view, Bundle savedInstanceState) {
String[] strArr;
Intrinsics.checkNotNullParameter(view, "view");
super.onViewCreated(view, savedInstanceState);
this.uploadProgressHelper = new UploadProgressHelper(requireContext(), requireActivity());
if (Build.VERSION.SDK_INT >= 33) {
strArr = new String[]{"android.permission.READ_MEDIA_IMAGES"};
} else if (Build.VERSION.SDK_INT >= 30) {
strArr = new String[]{"android.permission.READ_EXTERNAL_STORAGE"};
} else if (Build.VERSION.SDK_INT == 29) {
strArr = new String[]{"android.permission.READ_EXTERNAL_STORAGE"};
} else {
strArr = new String[]{"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"};
}
this.permissions = strArr;
observeEvent();
observeUploadProgress();
onClicks();
showMessageText();
}
private final void onClicks() {
RateUsSheetBinding rateUsSheetBinding = this.binding;
RateUsSheetBinding rateUsSheetBinding2 = null;
if (rateUsSheetBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
rateUsSheetBinding = null;
}
rateUsSheetBinding.rateUsBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RateUsSheet.onClicks$lambda$2(RateUsSheet.this, view);
}
});
RateUsSheetBinding rateUsSheetBinding3 = this.binding;
if (rateUsSheetBinding3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
rateUsSheetBinding3 = null;
}
rateUsSheetBinding3.uploadBtn.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RateUsSheet.onClicks$lambda$3(RateUsSheet.this, view);
}
});
RateUsSheetBinding rateUsSheetBinding4 = this.binding;
if (rateUsSheetBinding4 == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
} else {
rateUsSheetBinding2 = rateUsSheetBinding4;
}
rateUsSheetBinding2.close.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
RateUsSheet.onClicks$lambda$4(RateUsSheet.this, view);
}
});
}
public static final void onClicks$lambda$2(RateUsSheet rateUsSheet, View view) {
Intrinsics.checkNotNullParameter(rateUsSheet, "this$0");
try {
String string = rateUsSheet.getString(2131951676);
Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.app_package)");
try {
rateUsSheet.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
} catch (ActivityNotFoundException unused) {
rateUsSheet.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + string)));
}
} catch (Exception unused2) {
}
}
public static final void onClicks$lambda$3(RateUsSheet rateUsSheet, View view) {
Intrinsics.checkNotNullParameter(rateUsSheet, "this$0");
try {
rateUsSheet.onGalleryClick();
} catch (Exception unused) {
}
}
public static final void onClicks$lambda$4(RateUsSheet rateUsSheet, View view) {
Intrinsics.checkNotNullParameter(rateUsSheet, "this$0");
rateUsSheet.dismiss();
}
private final Job observeEvent() {
return BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), (CoroutineContext) null, (CoroutineStart) null, new RateUsSheet$observeEvent$1(this, null), 3, (Object) null);
}
private final void observeUploadProgress() {
getViewModel().getResult().observe(getViewLifecycleOwner(), new RateUsSheet$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.CONTINUE.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
iArr[ResultState.Status.RESET.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
$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;
UserViewModel viewModel;
UploadProgressHelper uploadProgressHelper5;
UploadProgressHelper uploadProgressHelper6;
int i = WhenMappings.$EnumSwitchMapping$0[resultState.getStatus().ordinal()];
if (i == 1) {
uploadProgressHelper = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper != null) {
Double data = resultState.getData();
uploadProgressHelper.progressDialogPercent(data != null ? (float) data.doubleValue() : 0.0f);
return;
}
return;
}
if (i == 2) {
uploadProgressHelper2 = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper2 != null) {
uploadProgressHelper2.dismiss();
return;
}
return;
}
if (i == 3) {
uploadProgressHelper3 = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper3 != null) {
uploadProgressHelper3.dismiss();
return;
}
return;
}
if (i == 4) {
uploadProgressHelper4 = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper4 != null) {
uploadProgressHelper4.dismiss();
}
viewModel = RateUsSheet.this.getViewModel();
viewModel.resetUploadSuccessEvent();
return;
}
if (i != 5) {
return;
}
uploadProgressHelper5 = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper5 != null) {
uploadProgressHelper5.dismiss();
}
uploadProgressHelper6 = RateUsSheet.this.uploadProgressHelper;
if (uploadProgressHelper6 != null) {
uploadProgressHelper6.setProgressDialog();
}
}
}));
}
private final void showMessageText() {
SpannableString spannableString = new SpannableString(r2);
int indexOf$default = StringsKt.indexOf$default(r2, "After verification you will get a free call within 3 days.", 0, false, 6, (Object) null);
int i = indexOf$default + 58;
if (indexOf$default < 0 || i > 163) {
return;
}
spannableString.setSpan(new ForegroundColorSpan(-65536), indexOf$default, i, 33);
RateUsSheetBinding rateUsSheetBinding = this.binding;
if (rateUsSheetBinding == null) {
Intrinsics.throwUninitializedPropertyAccessException("binding");
rateUsSheetBinding = null;
}
rateUsSheetBinding.intTxt.setText(spannableString);
}
private final void onGalleryClick() {
Context requireContext = requireContext();
Intrinsics.checkNotNullExpressionValue(requireContext, "requireContext()");
boolean permissionArrayGranted = PermissionHelper.permissionArrayGranted(requireContext, this.permissions);
if (!permissionArrayGranted) {
ActivityCompat.requestPermissions(requireActivity(), this.permissions, 200);
return;
}
Timber.e("permissionAvailable " + permissionArrayGranted, new Object[0]);
SingleImagePicker singleImagePicker = SingleImagePicker.INSTANCE;
Context requireActivity = requireActivity();
Intrinsics.checkNotNullExpressionValue(requireActivity, "requireActivity()");
singleImagePicker.showPicker(requireActivity, new String[0], new Config(false, 1, (DefaultConstructorMarker) null), new Function1<BaseSinglePickerModifier, Unit>() {
public final void invoke(BaseSinglePickerModifier baseSinglePickerModifier) {
Intrinsics.checkNotNullParameter(baseSinglePickerModifier, "$this$showPicker");
}
public Object invoke(Object obj) {
invoke((BaseSinglePickerModifier) obj);
return Unit.INSTANCE;
}
}, new RateUsSheet$onGalleryClick$2(this));
}
public final void loadImage(final ImageModel imageModel) {
try {
DialogHelper.showReasonDialog(requireContext(), "", getString(2131952537) + '?', true, new DialogHelper.ConfirmationListener() {
@Override
public final void onPositiveClick() {
RateUsSheet.loadImage$lambda$6(RateUsSheet.this, imageModel);
}
});
} catch (Exception e) {
Timber.e(e);
}
}
public static final void loadImage$lambda$6(RateUsSheet rateUsSheet, ImageModel imageModel) {
Intrinsics.checkNotNullParameter(rateUsSheet, "this$0");
Intrinsics.checkNotNullParameter(imageModel, "$imageModel");
try {
Context requireContext = rateUsSheet.requireContext();
Intrinsics.checkNotNullExpressionValue(requireContext, "requireContext()");
String realPath = FileUriUtils.getRealPath(requireContext, imageModel.getContentUri());
String compressedImageFile = CompressFile.getCompressedImageFile(Uri.fromFile(realPath != null ? new File(realPath) : null), rateUsSheet.requireContext(), 30);
if (compressedImageFile != null) {
realPath = compressedImageFile;
}
rateUsSheet.getViewModel().uploadReviewScreenshot(CollectionsKt.listOf(realPath));
UploadProgressHelper uploadProgressHelper = rateUsSheet.uploadProgressHelper;
if (uploadProgressHelper != null) {
uploadProgressHelper.setProgressDialog();
}
} catch (Exception e) {
Timber.e(e);
}
}
@Deprecated(message = "Deprecated in Java")
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);
if (requestCode == 200) {
boolean z = true;
if (grantResults.length == 0) {
return;
}
if (Build.VERSION.SDK_INT < 30 ? Build.VERSION.SDK_INT != 29 ? grantResults[0] != 0 || grantResults[1] != 0 : grantResults[0] != 0 : grantResults[0] != 0) {
z = false;
}
if (z) {
return;
}
DialogHelper.showPermissionDialog(requireContext(), requireActivity(), getString(2131952428), getString(2131952439), ChatActivity.MEDIA_PERMISSION);
}
}
}