导航菜单

页面标题

页面副标题

Rilo v2.0.21 - ScreenshotUpiActivity.java 源代码

正在查看: Rilo v2.0.21 应用的 ScreenshotUpiActivity.java JAVA 源代码文件

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


package app.callpe.ui.payment;

import android.app.Activity;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.ComponentActivity;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
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 androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import app.callpe.adapters.UpiMethodsAdapter;
import app.callpe.adapters.VideoListAdapter;
import app.callpe.common.utils.FileHandler;
import app.callpe.common.utils.PermissionHelper;
import app.callpe.common.utils.ResultState;
import app.callpe.common.utils.custom.CustomLinearLayoutManager;
import app.callpe.common.utils.extensions.ActivityExtKt;
import app.callpe.common.utils.file_helper.CompressFile;
import app.callpe.common.utils.helper_functions.DialogHelper;
import app.callpe.data.model.UPIPaymentOptions;
import app.callpe.data.model.VideoModel;
import app.callpe.data.repository.upload.UploadProgressHelper;
import app.callpe.databinding.ActivityScreenshotUpiBinding;
import app.callpe.service.ApiService;
import app.callpe.ui.chat.ChatActivity;
import app.callpe.ui.home.AccountViewModel;
import app.callpe.ui.home.BaseActivity;
import app.callpe.ui.misc.PlayerActivity;
import com.bumptech.glide.Glide;
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 dagger.hilt.android.AndroidEntryPoint;
import java.io.File;
import java.util.ArrayList;
import javax.inject.Inject;
import kotlin.Deprecated;
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.Dispatchers;
import kotlinx.coroutines.Job;
import timber.log.Timber;

@Metadata(d1 = {"\u0000\u008c\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u000e\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\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0015\n\u0002\b\b\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u0016\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020!2\u0006\u0010\"\u001a\u00020\u0010J\u0010\u0010#\u001a\u00020\u00022\u0006\u0010$\u001a\u00020%H\u0016J\b\u0010&\u001a\u00020\u001fH\u0002J\u0010\u0010'\u001a\u00020\u001f2\u0006\u0010(\u001a\u00020)H\u0002J\b\u0010*\u001a\u00020+H\u0002J\b\u0010,\u001a\u00020\u001fH\u0002J\b\u0010-\u001a\u00020\u001fH\u0002J\u0012\u0010.\u001a\u00020\u001f2\b\u0010/\u001a\u0004\u0018\u000100H\u0014J\b\u00101\u001a\u00020\u001fH\u0002J\u0010\u00102\u001a\u00020\r2\u0006\u00103\u001a\u000204H\u0016J-\u00105\u001a\u00020\u001f2\u0006\u00106\u001a\u0002072\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00100\u000f2\u0006\u00108\u001a\u000209H\u0017¢\u0006\u0002\u0010:J\b\u0010;\u001a\u00020\u001fH\u0002J\b\u0010<\u001a\u00020\u001fH\u0002J\b\u0010=\u001a\u00020\u001fH\u0002J\u0010\u0010>\u001a\u00020\u001f2\u0006\u0010?\u001a\u00020\u0010H\u0002J\b\u0010@\u001a\u00020\u001fH\u0002R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082.¢\u0006\u0002\n\u0000R\u001e\u0010\u0006\u001a\u00020\u00078\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u000e\u0010\f\u001a\u00020\rX\u0082\u000e¢\u0006\u0002\n\u0000R\u0016\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00100\u000fX\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u0011R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\u0014\u001a\u0004\u0018\u00010\u0015X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0017X\u0082.¢\u0006\u0002\n\u0000R\u001b\u0010\u0018\u001a\u00020\u00198BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u001c\u0010\u001d\u001a\u0004\b\u001a\u0010\u001b¨\u0006A"}, d2 = {"Lapp/callpe/ui/payment/ScreenshotUpiActivity;", "Lapp/callpe/ui/home/BaseActivity;", "Lapp/callpe/databinding/ActivityScreenshotUpiBinding;", "()V", "adapter", "Lapp/callpe/adapters/UpiMethodsAdapter;", "apiService", "Lapp/callpe/service/ApiService;", "getApiService", "()Lapp/callpe/service/ApiService;", "setApiService", "(Lapp/callpe/service/ApiService;)V", "isVideoListEmpty", "", NativeProtocol.RESULT_ARGS_PERMISSIONS, "", "", "[Ljava/lang/String;", "toolbar", "Landroidx/appcompat/widget/Toolbar;", "uploadProgressHelper", "Lapp/callpe/data/repository/upload/UploadProgressHelper;", "videoAdapter", "Lapp/callpe/adapters/VideoListAdapter;", "viewModel", "Lapp/callpe/ui/home/AccountViewModel;", "getViewModel", "()Lapp/callpe/ui/home/AccountViewModel;", "viewModel$delegate", "Lkotlin/Lazy;", "copyTextToClipboard", "", "context", "Landroid/content/Context;", "text", "inflateLayout", "layoutInflater", "Landroid/view/LayoutInflater;", "initViews", "loadImage", "imageModel", "Lcom/crazylegend/imagepicker/images/ImageModel;", "observeEvent", "Lkotlinx/coroutines/Job;", "observeUploadProgress", "onClicks", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onGalleryClick", "onOptionsItemSelected", "item", "Landroid/view/MenuItem;", "onRequestPermissionsResult", "requestCode", "", "grantResults", "", "(I[Ljava/lang/String;[I)V", "setAdapter", "setHelpVideoAdapter", "setUpToolbar", "showImageFullScreen", "imageUrl", "swipeRefresh", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class ScreenshotUpiActivity extends BaseActivity<ActivityScreenshotUpiBinding> {
    private UpiMethodsAdapter adapter;

    @Inject
    public ApiService apiService;
    private boolean isVideoListEmpty = true;
    private String[] permissions = {"android.permission.RECORD_AUDIO", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE"};
    private Toolbar toolbar;
    private UploadProgressHelper uploadProgressHelper;
    private VideoListAdapter videoAdapter;

    private final Lazy viewModel;

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

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

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

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

    @Override
    public ActivityScreenshotUpiBinding inflateLayout(LayoutInflater layoutInflater) {
        Intrinsics.checkNotNullParameter(layoutInflater, "layoutInflater");
        ActivityScreenshotUpiBinding inflate = ActivityScreenshotUpiBinding.inflate(layoutInflater);
        Intrinsics.checkNotNullExpressionValue(inflate, "inflate(layoutInflater)");
        return inflate;
    }

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

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

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        String[] strArr;
        super.onCreate(savedInstanceState);
        Context context = (Context) this;
        getWindow().setStatusBarColor(ContextCompat.getColor(context, 2131100053));
        this.uploadProgressHelper = new UploadProgressHelper(context, (Activity) this);
        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;
        TextView textView = ((ActivityScreenshotUpiBinding) getBinding()).amount;
        String stringExtra = getIntent().getStringExtra("payableAmount");
        if (stringExtra == null) {
            stringExtra = "0";
        }
        textView.setText(stringExtra);
        initViews();
        setAdapter();
        setHelpVideoAdapter();
        onClicks();
        observeUploadProgress();
        observeEvent();
        setUpToolbar();
        swipeRefresh();
        getViewModel().getUpiPaymentOptionsList();
    }

    private final void setUpToolbar() {
        try {
            Toolbar toolbar = this.toolbar;
            if (toolbar == null) {
                Intrinsics.throwUninitializedPropertyAccessException("toolbar");
                toolbar = null;
            }
            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 initViews() {
        Toolbar toolbar = getBinding().toolbar;
        Intrinsics.checkNotNullExpressionValue(toolbar, "binding.toolbar");
        this.toolbar = toolbar;
    }

    private final void setAdapter() {
        ((ActivityScreenshotUpiBinding) getBinding()).upiOptionsRv.setLayoutManager(new CustomLinearLayoutManager((Context) this));
        ((ActivityScreenshotUpiBinding) getBinding()).upiOptionsRv.setNestedScrollingEnabled(false);
        UpiMethodsAdapter upiMethodsAdapter = null;
        this.adapter = new UpiMethodsAdapter(null, new UpiMethodsAdapter.ItemClickListener() {
            @Override
            public void onCopyItemClick(UPIPaymentOptions options) {
                Intrinsics.checkNotNullParameter(options, "options");
                ScreenshotUpiActivity screenshotUpiActivity = ScreenshotUpiActivity.this;
                screenshotUpiActivity.copyTextToClipboard((Context) screenshotUpiActivity, String.valueOf(options.getValue()));
            }

            @Override
            public void onDownloadQRClick(UPIPaymentOptions options) {
                Intrinsics.checkNotNullParameter(options, "options");
                BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope(ScreenshotUpiActivity.this), Dispatchers.getIO(), (CoroutineStart) null, new ScreenshotUpiActivity$setAdapter$1$onDownloadQRClick$1(options, ScreenshotUpiActivity.this, null), 2, (Object) null);
            }

            @Override
            public void onViewQRCodeClick(UPIPaymentOptions options) {
                Intrinsics.checkNotNullParameter(options, "options");
                ScreenshotUpiActivity.this.showImageFullScreen(String.valueOf(options.getValue()));
            }
        }, 1, null);
        RecyclerView recyclerView = ((ActivityScreenshotUpiBinding) getBinding()).upiOptionsRv;
        UpiMethodsAdapter upiMethodsAdapter2 = this.adapter;
        if (upiMethodsAdapter2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("adapter");
        } else {
            upiMethodsAdapter = upiMethodsAdapter2;
        }
        recyclerView.setAdapter(upiMethodsAdapter);
    }

    private final void setHelpVideoAdapter() {
        Context context = (Context) this;
        ((ActivityScreenshotUpiBinding) getBinding()).helpVideoRv.setLayoutManager(new CustomLinearLayoutManager(context));
        ((ActivityScreenshotUpiBinding) getBinding()).helpVideoRv.setNestedScrollingEnabled(false);
        this.videoAdapter = new VideoListAdapter(context, new ArrayList(), new VideoListAdapter.VideoListAdapterClickHandler() {
            @Override
            public final void onVideoItemClick(int i, VideoModel videoModel) {
                ScreenshotUpiActivity.setHelpVideoAdapter$lambda$0(ScreenshotUpiActivity.this, i, videoModel);
            }
        });
        RecyclerView recyclerView = ((ActivityScreenshotUpiBinding) getBinding()).helpVideoRv;
        VideoListAdapter videoListAdapter = this.videoAdapter;
        if (videoListAdapter == null) {
            Intrinsics.throwUninitializedPropertyAccessException("videoAdapter");
            videoListAdapter = null;
        }
        recyclerView.setAdapter(videoListAdapter);
    }

    public static final void setHelpVideoAdapter$lambda$0(ScreenshotUpiActivity screenshotUpiActivity, int i, VideoModel videoModel) {
        Intrinsics.checkNotNullParameter(screenshotUpiActivity, "this$0");
        Intent intent = new Intent((Context) screenshotUpiActivity, (Class<?>) PlayerActivity.class);
        String youtubeId = videoModel.getYoutubeId();
        if (youtubeId == null || youtubeId.length() == 0) {
            return;
        }
        intent.putExtra("videoId", videoModel.getYoutubeId());
        screenshotUpiActivity.startActivity(intent);
    }

    public final void copyTextToClipboard(Context context, String text) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(text, "text");
        try {
            Object systemService = context.getSystemService("clipboard");
            Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.content.ClipboardManager");
            ((ClipboardManager) systemService).setPrimaryClip(ClipData.newPlainText("text", text));
            String string = getString(2131952962);
            Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.text_copy)");
            ActivityExtKt.toast((Activity) this, string);
        } catch (Exception e) {
            Timber.e(e);
        }
    }

    private final void onClicks() {
        getBinding().uploadSS.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ScreenshotUpiActivity.onClicks$lambda$1(ScreenshotUpiActivity.this, view);
            }
        });
    }

    public static final void onClicks$lambda$1(ScreenshotUpiActivity screenshotUpiActivity, View view) {
        Intrinsics.checkNotNullParameter(screenshotUpiActivity, "this$0");
        screenshotUpiActivity.onGalleryClick();
    }

    private final void swipeRefresh() {
        getBinding().swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
            public final void onRefresh() {
                ScreenshotUpiActivity.swipeRefresh$lambda$2(ScreenshotUpiActivity.this);
            }
        });
    }

    public static final void swipeRefresh$lambda$2(ScreenshotUpiActivity screenshotUpiActivity) {
        Intrinsics.checkNotNullParameter(screenshotUpiActivity, "this$0");
        screenshotUpiActivity.getViewModel().getUpiPaymentOptionsList();
        screenshotUpiActivity.getBinding().swipeRefresh.setRefreshing(false);
    }

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

    private final void observeUploadProgress() {
        getViewModel().getResult().observe((LifecycleOwner) this, new ScreenshotUpiActivity$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;
                AccountViewModel viewModel;
                UploadProgressHelper uploadProgressHelper5;
                UploadProgressHelper uploadProgressHelper6;
                int i = WhenMappings.$EnumSwitchMapping$0[resultState.getStatus().ordinal()];
                if (i == 1) {
                    uploadProgressHelper = ScreenshotUpiActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper != null) {
                        Double data = resultState.getData();
                        uploadProgressHelper.progressDialogPercent(data != null ? (float) data.doubleValue() : 0.0f);
                        return;
                    }
                    return;
                }
                if (i == 2) {
                    uploadProgressHelper2 = ScreenshotUpiActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper2 != null) {
                        uploadProgressHelper2.dismiss();
                        return;
                    }
                    return;
                }
                if (i == 3) {
                    uploadProgressHelper3 = ScreenshotUpiActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper3 != null) {
                        uploadProgressHelper3.dismiss();
                        return;
                    }
                    return;
                }
                if (i == 4) {
                    uploadProgressHelper4 = ScreenshotUpiActivity.this.uploadProgressHelper;
                    if (uploadProgressHelper4 != null) {
                        uploadProgressHelper4.dismiss();
                    }
                    viewModel = ScreenshotUpiActivity.this.getViewModel();
                    viewModel.resetUploadSuccessEvent();
                    return;
                }
                if (i != 5) {
                    return;
                }
                uploadProgressHelper5 = ScreenshotUpiActivity.this.uploadProgressHelper;
                if (uploadProgressHelper5 != null) {
                    uploadProgressHelper5.dismiss();
                }
                uploadProgressHelper6 = ScreenshotUpiActivity.this.uploadProgressHelper;
                if (uploadProgressHelper6 != null) {
                    uploadProgressHelper6.setProgressDialog();
                }
            }
        }));
    }

    private final void onGalleryClick() {
        Context context = (Context) this;
        boolean permissionArrayGranted = PermissionHelper.permissionArrayGranted(context, this.permissions);
        Timber.e("permissionAvailable " + permissionArrayGranted, new Object[0]);
        if (!permissionArrayGranted) {
            ActivityCompat.requestPermissions((Activity) this, this.permissions, 200);
        } else {
            SingleImagePicker.INSTANCE.showPicker(context, new String[0], new Config(false), 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 ScreenshotUpiActivity$onGalleryClick$2(this));
        }
    }

    public final void loadImage(final ImageModel imageModel) {
        try {
            DialogHelper.showReasonDialog((Context) this, "", getString(2131953041) + '?', true, new DialogHelper.ConfirmationListener() {
                @Override
                public final void onPositiveClick() {
                    ScreenshotUpiActivity.loadImage$lambda$3(ScreenshotUpiActivity.this, imageModel);
                }
            });
        } catch (Exception e) {
            Timber.e(e);
        }
    }

    public static final void loadImage$lambda$3(ScreenshotUpiActivity screenshotUpiActivity, ImageModel imageModel) {
        Intrinsics.checkNotNullParameter(screenshotUpiActivity, "this$0");
        Intrinsics.checkNotNullParameter(imageModel, "$imageModel");
        try {
            File saveFileFromUri = FileHandler.saveFileFromUri((Context) screenshotUpiActivity, imageModel.getContentUri(), "UPI", "UPI_" + System.currentTimeMillis(), "jpg");
            String path = saveFileFromUri != null ? saveFileFromUri.getPath() : null;
            if (path == null) {
                Toast.makeText((Context) screenshotUpiActivity, screenshotUpiActivity.getString(2131952060), 0).show();
                return;
            }
            String compressedImageFile = CompressFile.getCompressedImageFile(Uri.fromFile(new File(path)), (Context) screenshotUpiActivity, 70);
            if (compressedImageFile != null) {
                path = compressedImageFile;
            }
            screenshotUpiActivity.getViewModel().uploadUpiPaymentScreenshot(CollectionsKt.listOf(path));
            UploadProgressHelper uploadProgressHelper = screenshotUpiActivity.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((Context) this, (Activity) this, getString(2131952428), getString(2131952439), ChatActivity.MEDIA_PERMISSION);
        }
    }

    public final void showImageFullScreen(final String imageUrl) {
        final Dialog dialog = new Dialog((Context) this);
        dialog.requestWindowFeature(1);
        dialog.setContentView(2131558749);
        Glide.with((FragmentActivity) this).load(imageUrl).into((ImageView) dialog.findViewById(2131362985));
        ((ImageView) dialog.findViewById(2131362434)).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ScreenshotUpiActivity.showImageFullScreen$lambda$4(dialog, view);
            }
        });
        dialog.findViewById(2131362701).setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                ScreenshotUpiActivity.showImageFullScreen$lambda$5(ScreenshotUpiActivity.this, imageUrl, view);
            }
        });
        Window window = dialog.getWindow();
        if (window != null) {
            window.setLayout(-1, -1);
        }
        dialog.show();
    }

    public static final void showImageFullScreen$lambda$4(Dialog dialog, View view) {
        Intrinsics.checkNotNullParameter(dialog, "$dialog");
        dialog.dismiss();
    }

    public static final void showImageFullScreen$lambda$5(ScreenshotUpiActivity screenshotUpiActivity, String str, View view) {
        Intrinsics.checkNotNullParameter(screenshotUpiActivity, "this$0");
        Intrinsics.checkNotNullParameter(str, "$imageUrl");
        BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) screenshotUpiActivity), Dispatchers.getIO(), (CoroutineStart) null, new ScreenshotUpiActivity$showImageFullScreen$2$1(str, screenshotUpiActivity, null), 2, (Object) null);
    }

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