导航菜单

页面标题

页面副标题

医路轻松 v1.1.3 - IndexVm.java 源代码

正在查看: 医路轻松 v1.1.3 应用的 IndexVm.java JAVA 源代码文件

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


package com.qshealth.qsdoctor.feature.index;

import android.app.Activity;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotMutationPolicy;
import androidx.compose.runtime.SnapshotStateKt;
import com.hjq.permissions.OnPermissionCallback;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
import com.qshealth.qsdoctor.App;
import com.qshealth.qsdoctor.R;
import com.qshealth.qsdoctor.base.BaseVM;
import com.qshealth.qsdoctor.repo.UserRepo;
import com.qshealth.qsdoctor.repo.remote.model.HomeSpecializedResp;
import com.qshealth.qsdoctor.repo.remote.model.PopularScienceArticlesResp;
import com.qshealth.qsdoctor.repo.remote.model.SciencePopularizationTopicResp;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.inject.Inject;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.IndexedValue;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;

@Metadata(d1 = {"\u0000h\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u000f\b\u0007\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u000e\u0010\u001d\u001a\u00020\u001eH\u0086@¢\u0006\u0002\u0010\u001fJ\u000e\u0010 \u001a\u00020\u001eH\u0086@¢\u0006\u0002\u0010\u001fJ\u000e\u0010!\u001a\u00020\u001eH\u0086@¢\u0006\u0002\u0010\u001fJ\u001c\u0010\"\u001a\u00020\u001e2\u0006\u0010#\u001a\u00020$2\f\u0010%\u001a\b\u0012\u0004\u0012\u00020\u001e0&J\u001e\u0010'\u001a\u00020\u001e2\u0006\u0010#\u001a\u00020$2\f\u0010%\u001a\b\u0012\u0004\u0012\u00020\u001e0&H\u0002J2\u0010(\u001a\u001a\u0012\n\u0012\b\u0012\u0004\u0012\u0002H*0\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H*0\u000e0)\"\u0004\b\u0000\u0010*2\f\u0010+\u001a\b\u0012\u0004\u0012\u0002H*0\u000eR\u0019\u0010\u0005\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0006¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0019\u0010\n\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u000b0\u0006¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\tR\u001f\u0010\r\u001a\u0010\u0012\f\u0012\n\u0012\u0004\u0012\u00020\u000f\u0018\u00010\u000e0\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\tR\u0017\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00120\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\tR\u0017\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00150\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u0016\u0010\u0017R\u0017\u0010\u0018\u001a\b\u0012\u0004\u0012\u00020\u00190\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u001a\u0010\u0017R\u0017\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\u00190\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u001c\u0010\u0017R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006,"}, d2 = {"Lcom/qshealth/qsdoctor/feature/index/IndexVm;", "Lcom/qshealth/qsdoctor/base/BaseVM;", "userRepo", "Lcom/qshealth/qsdoctor/repo/UserRepo;", "(Lcom/qshealth/qsdoctor/repo/UserRepo;)V", "articleData", "Landroidx/compose/runtime/MutableState;", "Lcom/qshealth/qsdoctor/repo/remote/model/PopularScienceArticlesResp;", "getArticleData", "()Landroidx/compose/runtime/MutableState;", "contentCenterData", "Lcom/qshealth/qsdoctor/repo/remote/model/SciencePopularizationTopicResp;", "getContentCenterData", "homeCenterData", "", "Lcom/qshealth/qsdoctor/repo/remote/model/HomeSpecializedResp;", "getHomeCenterData", "showDialog", "", "getShowDialog", "topActionIcons", "", "getTopActionIcons", "()Ljava/util/List;", "topActionLink", "", "getTopActionLink", "topActionTitles", "getTopActionTitles", "getContentCenterList", "", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getHomeCenterList", "getWorkTaskArticle", "prevScan", "activity", "Landroid/app/Activity;", "success", "Lkotlin/Function0;", "scan", "splitListByIndex", "Lkotlin/Pair;", "T", "original", "app_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class IndexVm extends BaseVM {
    public static final int $stable = 8;
    private final MutableState<PopularScienceArticlesResp> articleData;
    private final MutableState<SciencePopularizationTopicResp> contentCenterData;
    private final MutableState<List<HomeSpecializedResp>> homeCenterData;
    private final MutableState<Boolean> showDialog;
    private final List<Integer> topActionIcons;
    private final List<String> topActionLink;
    private final List<String> topActionTitles;
    private final UserRepo userRepo;

    @Inject
    public IndexVm(UserRepo userRepo) {
        Intrinsics.checkNotNullParameter(userRepo, "userRepo");
        this.userRepo = userRepo;
        this.topActionTitles = CollectionsKt.listOf((Object[]) new String[]{"文献解读", "实验方案设计", "扫一扫", "医学工具"});
        this.topActionIcons = CollectionsKt.listOf((Object[]) new Integer[]{Integer.valueOf(R.mipmap.icon_top_action_1), Integer.valueOf(R.mipmap.icon_top_action_6), Integer.valueOf(R.mipmap.icon_me_scan), Integer.valueOf(R.mipmap.icon_top_action_5)});
        this.topActionLink = CollectionsKt.listOf((Object[]) new String[]{"https://m.qshealth.com/doctor-app/agent-qs/doc-interpret-assistant", "https://m.qshealth.com/doctor-app/agent-qs/medical-research", "scan", "https://m.qshealth.com/doctor-app/medical-tools/science-articles?content_type=1"});
        this.homeCenterData = SnapshotStateKt.mutableStateOf$default((Object) null, (SnapshotMutationPolicy) null, 2, (Object) null);
        this.contentCenterData = SnapshotStateKt.mutableStateOf$default((Object) null, (SnapshotMutationPolicy) null, 2, (Object) null);
        this.articleData = SnapshotStateKt.mutableStateOf$default((Object) null, (SnapshotMutationPolicy) null, 2, (Object) null);
        this.showDialog = SnapshotStateKt.mutableStateOf$default(false, (SnapshotMutationPolicy) null, 2, (Object) null);
        safeLaunch(new AnonymousClass1(null));
    }

    public final List<String> getTopActionTitles() {
        return this.topActionTitles;
    }

    public final List<Integer> getTopActionIcons() {
        return this.topActionIcons;
    }

    public final List<String> getTopActionLink() {
        return this.topActionLink;
    }

    public final MutableState<List<HomeSpecializedResp>> getHomeCenterData() {
        return this.homeCenterData;
    }

    public final MutableState<SciencePopularizationTopicResp> getContentCenterData() {
        return this.contentCenterData;
    }

    public final MutableState<PopularScienceArticlesResp> getArticleData() {
        return this.articleData;
    }

    public final MutableState<Boolean> getShowDialog() {
        return this.showDialog;
    }

    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u008a@"}, d2 = {"<anonymous>", "", "Lkotlinx/coroutines/CoroutineScope;"}, k = 3, mv = {1, 9, 0}, xi = 48)
    @DebugMetadata(c = "com.qshealth.qsdoctor.feature.index.IndexVm$1", f = "IndexVm.kt", i = {}, l = {35, 36, 37}, m = "invokeSuspend", n = {}, s = {})
    static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
        int label;

        AnonymousClass1(Continuation<? super AnonymousClass1> continuation) {
            super(2, continuation);
        }

        @Override
        public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
            return IndexVm.this.new AnonymousClass1(continuation);
        }

        @Override
        public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
            return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
        }

        @Override
        public final java.lang.Object invokeSuspend(java.lang.Object r6) {
            throw new UnsupportedOperationException("Method not decompiled: com.qshealth.qsdoctor.feature.index.IndexVm.AnonymousClass1.invokeSuspend(java.lang.Object):java.lang.Object");
        }
    }

    public final java.lang.Object getHomeCenterList(kotlin.coroutines.Continuation<? super kotlin.Unit> r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.qshealth.qsdoctor.feature.index.IndexVm.getHomeCenterList(kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object getContentCenterList(kotlin.coroutines.Continuation<? super kotlin.Unit> r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.qshealth.qsdoctor.feature.index.IndexVm.getContentCenterList(kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object getWorkTaskArticle(kotlin.coroutines.Continuation<? super kotlin.Unit> r5) {
        throw new UnsupportedOperationException("Method not decompiled: com.qshealth.qsdoctor.feature.index.IndexVm.getWorkTaskArticle(kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final <T> Pair<List<T>, List<T>> splitListByIndex(List<? extends T> original) {
        Intrinsics.checkNotNullParameter(original, "original");
        Iterable withIndex = CollectionsKt.withIndex(original);
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        for (T t : withIndex) {
            if (((IndexedValue) t).getIndex() % 2 == 0) {
                arrayList.add(t);
            } else {
                arrayList2.add(t);
            }
        }
        Pair pair = new Pair(arrayList, arrayList2);
        List list = (List) pair.component1();
        List list2 = (List) pair.component2();
        List list3 = list;
        ArrayList arrayList3 = new ArrayList(CollectionsKt.collectionSizeOrDefault(list3, 10));
        Iterator<T> it = list3.iterator();
        while (it.hasNext()) {
            arrayList3.add(((IndexedValue) it.next()).getValue());
        }
        ArrayList arrayList4 = arrayList3;
        List list4 = list2;
        ArrayList arrayList5 = new ArrayList(CollectionsKt.collectionSizeOrDefault(list4, 10));
        Iterator<T> it2 = list4.iterator();
        while (it2.hasNext()) {
            arrayList5.add(((IndexedValue) it2.next()).getValue());
        }
        return TuplesKt.to(arrayList4, arrayList5);
    }

    public final void prevScan(Activity activity, Function0<Unit> success) {
        Intrinsics.checkNotNullParameter(activity, "activity");
        Intrinsics.checkNotNullParameter(success, "success");
        scan(activity, success);
    }

    private final void scan(final Activity activity, final Function0<Unit> success) {
        Activity activity2 = activity;
        if (!XXPermissions.isGranted(activity2, Permission.CAMERA)) {
            this.showDialog.setValue(true);
        }
        XXPermissions.with(activity2).permission(Permission.CAMERA).request(new OnPermissionCallback() {
            @Override
            public void onGranted(List<String> permissions, boolean allGranted) {
                Intrinsics.checkNotNullParameter(permissions, "permissions");
                success.invoke();
                this.getShowDialog().setValue(false);
            }

            @Override
            public void onDenied(List<String> permissions, boolean doNotAskAgain) {
                Intrinsics.checkNotNullParameter(permissions, "permissions");
                this.getShowDialog().setValue(false);
                App.INSTANCE.gvm().toast("请允许相机权限");
                if (doNotAskAgain) {
                    XXPermissions.startPermissionActivity(activity, permissions);
                }
            }
        });
    }
}