CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f

以下内容为反编译后的 GospelQAListActivity$initData$1.java 源代码,内容仅作参考


package org.godfootsteps.home;

import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager3.widget.ViewPager3;
import carbon.custom.LoadingLayout;
import com.flyco.tablayout.SlidingTabLayout;
import d.c.a.i.b;
import d.c.a.j.v;
import i.c.a.c.n0;
import i.j.a.e.t.d;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.internal.Lambda;
import n.e;
import n.g.f.a.c;
import n.i.a.a;
import n.i.a.l;
import n.i.a.p;
import n.i.b.h;
import org.commons.screenadapt.recyclerview.FastScreenListAdapter;
import org.commons.screenadapt.recyclerview.ScreenViewHolder;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.model.HomeGospelQAModel;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.home.GospelQAListActivity;
@Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u0001*\u0014\u0012\u0004\u0012\u00020\u0003\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00040\u0002H\n"}, d2 = {"<anonymous>", "", "Lorg/godfootsteps/arch/api/util/Request;", "Lorg/godfootsteps/arch/api/model/HomeGospelQAModel;", "Lorg/godfootsteps/arch/api/model/BaseModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
public final class GospelQAListActivity$initData$1 extends Lambda implements l<Request<HomeGospelQAModel, BaseModel<HomeGospelQAModel>>, e> {
    public final GospelQAListActivity this$0;

    @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/api/model/HomeGospelQAModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
    @c(c = "org.godfootsteps.home.GospelQAListActivity$initData$1$2", f = "GospelQAListActivity.kt", l = {48}, m = "invokeSuspend")
    public static final class AnonymousClass2 extends SuspendLambda implements l<n.g.c<? super BaseModel<HomeGospelQAModel>>, Object> {
        public int label;

        public AnonymousClass2(n.g.c<? super AnonymousClass2> cVar) {
            super(1, cVar);
        }

        @Override
        public final n.g.c<e> create(n.g.c<?> cVar) {
            return new AnonymousClass2(cVar);
        }

        @Override
        public final Object invoke(n.g.c<? super BaseModel<HomeGospelQAModel>> cVar) {
            return ((AnonymousClass2) create(cVar)).invokeSuspend(e.a);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
            int i2 = this.label;
            if (i2 == 0) {
                d.Q4(obj);
                Objects.requireNonNull(AppClient.a);
                AppClient appClient = AppClient.Companion.f15176d;
                this.label = 1;
                obj = appClient.K(this);
                if (obj == coroutineSingletons) {
                    return coroutineSingletons;
                }
            } else if (i2 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            } else {
                d.Q4(obj);
            }
            return obj;
        }
    }

    public GospelQAListActivity$initData$1(GospelQAListActivity gospelQAListActivity) {
        super(1);
        this.this$0 = gospelQAListActivity;
    }

    @Override
    public e invoke(Request<HomeGospelQAModel, BaseModel<HomeGospelQAModel>> request) {
        invoke2(request);
        return e.a;
    }

    public final void invoke2(Request<HomeGospelQAModel, BaseModel<HomeGospelQAModel>> request) {
        h.e(request, "$this$request");
        final GospelQAListActivity gospelQAListActivity = this.this$0;
        request.f15179k = new a<e>() {
            {
                super(0);
            }

            @Override
            public e invoke() {
                invoke2();
                return e.a;
            }

            public final void invoke2() {
                ((LoadingLayout) GospelQAListActivity.this.findViewById(R$id.loading_layout)).k();
            }
        };
        request.f(new AnonymousClass2(null));
        final GospelQAListActivity gospelQAListActivity2 = this.this$0;
        request.f15180l = new l<HomeGospelQAModel, e>() {
            {
                super(1);
            }

            @Override
            public e invoke(HomeGospelQAModel homeGospelQAModel) {
                invoke2(homeGospelQAModel);
                return e.a;
            }

            public final void invoke2(final HomeGospelQAModel homeGospelQAModel) {
                h.e(homeGospelQAModel, "model");
                ((LoadingLayout) GospelQAListActivity.this.findViewById(R$id.loading_layout)).i();
                List<HomeGospelQAModel.ListBeanX> list = homeGospelQAModel.getList();
                h.d(list, "model.list");
                List<HomeGospelQAModel.ListBeanX> arrayList = new ArrayList<>();
                Iterator<T> it = list.iterator();
                while (true) {
                    boolean z = false;
                    if (!it.hasNext()) {
                        break;
                    }
                    Object next = it.next();
                    List<HomeGospelQAModel.ListBeanX.ListBean> list2 = ((HomeGospelQAModel.ListBeanX) next).getList();
                    if (!((list2 == null || list2.isEmpty()) ? true : true)) {
                        arrayList.add(next);
                    }
                }
                homeGospelQAModel.setList(arrayList);
                GospelQAListActivity gospelQAListActivity3 = GospelQAListActivity.this;
                int i2 = R$id.view_pager;
                ((ViewPager3) gospelQAListActivity3.findViewById(i2)).setOffscreenPageLimit(homeGospelQAModel.getList().size());
                List<HomeGospelQAModel.ListBeanX> list3 = homeGospelQAModel.getList();
                final GospelQAListActivity gospelQAListActivity4 = GospelQAListActivity.this;
                ((ViewPager3) GospelQAListActivity.this.findViewById(i2)).setAdapter(new FastScreenListAdapter<HomeGospelQAModel.ListBeanX>(list3) {
                    @Override
                    public int g() {
                        return R$layout.item_gospel_qa_page;
                    }

                    @Override
                    public void i(ScreenViewHolder screenViewHolder, HomeGospelQAModel.ListBeanX listBeanX) {
                        HomeGospelQAModel.ListBeanX listBeanX2 = listBeanX;
                        h.e(listBeanX2, "item");
                        if (screenViewHolder == null) {
                            return;
                        }
                        h.c(screenViewHolder);
                        RecyclerView recyclerView = (RecyclerView) screenViewHolder.itemView;
                        Integer[] numArr = GospelQAListActivity.this.f15799l.get(Integer.valueOf(screenViewHolder.getLayoutPosition()));
                        if (numArr != null) {
                            LinearLayoutManager linearLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();
                            h.c(linearLayoutManager);
                            linearLayoutManager.scrollToPositionWithOffset(numArr[0].intValue(), numArr[1].intValue());
                        }
                        final int layoutPosition = screenViewHolder.getLayoutPosition();
                        final GospelQAListActivity gospelQAListActivity5 = GospelQAListActivity.this;
                        recyclerView.setOnScrollListener(new RecyclerView.s() {
                            @Override
                            public void onScrollStateChanged(RecyclerView recyclerView2, int i3) {
                                h.e(recyclerView2, "recyclerView");
                                super.onScrollStateChanged(recyclerView2, i3);
                                GospelQAListActivity.this.f15799l.put(Integer.valueOf(layoutPosition), n.m.t.a.p.m.e1.a.C0(recyclerView2));
                            }
                        });
                        if (((RecyclerView) screenViewHolder.itemView).getAdapter() == null) {
                            final List<HomeGospelQAModel.ListBeanX.ListBean> list4 = listBeanX2.getList();
                            final HomeGospelQAModel homeGospelQAModel2 = homeGospelQAModel;
                            final GospelQAListActivity gospelQAListActivity6 = GospelQAListActivity.this;
                            ((RecyclerView) screenViewHolder.itemView).setAdapter(new FastScreenListAdapter<HomeGospelQAModel.ListBeanX.ListBean>(list4) {
                                @Override
                                public int g() {
                                    return R$layout.item_number_title;
                                }

                                @Override
                                public void i(ScreenViewHolder screenViewHolder2, HomeGospelQAModel.ListBeanX.ListBean listBean) {
                                    final HomeGospelQAModel.ListBeanX.ListBean listBean2 = listBean;
                                    h.e(listBean2, "item");
                                    h.c(screenViewHolder2);
                                    final HomeGospelQAModel homeGospelQAModel3 = HomeGospelQAModel.this;
                                    final GospelQAListActivity gospelQAListActivity7 = gospelQAListActivity6;
                                    View view = screenViewHolder2.f15173i;
                                    View findViewById = view == null ? null : view.findViewById(R$id.tv_number);
                                    h.d(findViewById, "tv_number");
                                    n.m.t.a.p.m.e1.a.q2((TextView) findViewById);
                                    View view2 = screenViewHolder2.f15173i;
                                    ((carbon.widget.TextView) (view2 == null ? null : view2.findViewById(R$id.tv_number))).setText(String.valueOf(screenViewHolder2.getLayoutPosition() + 1));
                                    View view3 = screenViewHolder2.f15173i;
                                    ((TextView) (view3 != null ? view3.findViewById(R$id.tv_title) : null)).setText(listBean2.getTitle());
                                    screenViewHolder2.itemView.setOnClickListener(new View.OnClickListener() {
                                        @Override
                                        public final void onClick(View view4) {
                                            HomeGospelQAModel.ListBeanX.ListBean listBean3 = HomeGospelQAModel.ListBeanX.ListBean.this;
                                            HomeGospelQAModel homeGospelQAModel4 = homeGospelQAModel3;
                                            GospelQAListActivity gospelQAListActivity8 = gospelQAListActivity7;
                                            n.i.b.h.e(listBean3, "$item");
                                            n.i.b.h.e(homeGospelQAModel4, "$model");
                                            n.i.b.h.e(gospelQAListActivity8, "this$0");
                                            String bookId = listBean3.getBookId();
                                            boolean z2 = false;
                                            if (!(bookId == null || bookId.length() == 0)) {
                                                String chapterId = listBean3.getChapterId();
                                                if (!((chapterId == null || chapterId.length() == 0) ? true : true)) {
                                                    d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
                                                    if (cVar != null) {
                                                        String bookId2 = listBean3.getBookId();
                                                        n.i.b.h.d(bookId2, "item.bookId");
                                                        String chapterId2 = listBean3.getChapterId();
                                                        n.i.b.h.d(chapterId2, "item.chapterId");
                                                        cVar.e(bookId2, chapterId2, listBean3.getShare());
                                                    }
                                                    GAEventSendUtil.a.l(gospelQAListActivity8.f15798k, listBean3.getTitle());
                                                }
                                            }
                                            d.c.i.c cVar2 = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
                                            if (cVar2 != null) {
                                                StringBuilder sb = new StringBuilder();
                                                Objects.requireNonNull(AppClient.a);
                                                sb.append("https://appservercn.kingdomsalvation.org");
                                                sb.append((Object) homeGospelQAModel4.getArticle());
                                                sb.append((Object) listBean3.getFileName());
                                                cVar2.j(sb.toString(), listBean3.getShare());
                                            }
                                            GAEventSendUtil.a.l(gospelQAListActivity8.f15798k, listBean3.getTitle());
                                        }
                                    });
                                    if (v.i()) {
                                        View view4 = screenViewHolder2.itemView;
                                        h.d(view4, "itemView");
                                        new b(view4, 0.0f, 0.0f, 6).a();
                                    }
                                }
                            });
                            return;
                        }
                        RecyclerView.Adapter adapter = ((RecyclerView) screenViewHolder.itemView).getAdapter();
                        Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.commons.screenadapt.recyclerview.FastScreenListAdapter<org.godfootsteps.arch.api.model.HomeGospelQAModel.ListBeanX.ListBean>");
                        FastScreenListAdapter fastScreenListAdapter = (FastScreenListAdapter) adapter;
                        fastScreenListAdapter.a = listBeanX2.getList();
                        fastScreenListAdapter.notifyDataSetChanged();
                    }
                });
                if (homeGospelQAModel.getList().size() <= 1) {
                    SlidingTabLayout slidingTabLayout = (SlidingTabLayout) GospelQAListActivity.this.findViewById(R$id.tab_layout);
                    h.d(slidingTabLayout, "tab_layout");
                    n0.c(slidingTabLayout, false, 1);
                    return;
                }
                GospelQAListActivity gospelQAListActivity5 = GospelQAListActivity.this;
                int i3 = R$id.tab_layout;
                SlidingTabLayout slidingTabLayout2 = (SlidingTabLayout) gospelQAListActivity5.findViewById(i3);
                h.d(slidingTabLayout2, "tab_layout");
                n0.t(slidingTabLayout2);
                SlidingTabLayout slidingTabLayout3 = (SlidingTabLayout) GospelQAListActivity.this.findViewById(i3);
                ViewPager3 viewPager3 = (ViewPager3) GospelQAListActivity.this.findViewById(i2);
                List<HomeGospelQAModel.ListBeanX> list4 = homeGospelQAModel.getList();
                h.d(list4, "model.list");
                ArrayList arrayList2 = new ArrayList(d.S(list4, 10));
                for (HomeGospelQAModel.ListBeanX listBeanX : list4) {
                    arrayList2.add(listBeanX.getTitle());
                }
                slidingTabLayout3.x(viewPager3, arrayList2);
            }
        };
        final GospelQAListActivity gospelQAListActivity3 = this.this$0;
        request.f15181m = new p<Integer, String, e>() {
            {
                super(2);
            }

            @Override
            public e invoke(Integer num, String str) {
                invoke(num.intValue(), str);
                return e.a;
            }

            public final void invoke(int i2, String str) {
                h.e(str, "$noName_1");
                SlidingTabLayout slidingTabLayout = (SlidingTabLayout) GospelQAListActivity.this.findViewById(R$id.tab_layout);
                h.d(slidingTabLayout, "tab_layout");
                n0.c(slidingTabLayout, false, 1);
                LoadingLayout loadingLayout = (LoadingLayout) GospelQAListActivity.this.findViewById(R$id.loading_layout);
                h.d(loadingLayout, "loading_layout");
                n.m.t.a.p.m.e1.a.v2(loadingLayout);
            }
        };
    }
}