CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 GospelWitnessListActivity$loadArticle$1.java 源代码,内容仅作参考
package org.godfootsteps.home;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.RecyclerView;
import carbon.custom.LoadingLayout;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import e.w.a.k;
import i.j.a.e.t.d;
import java.util.ArrayList;
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.ScreenListAdapter;
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.HomePostModel;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.arch.customSystemViews.CustomThumbnailView;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.home.GospelWitnessListActivity;
import org.godfootsteps.home.R$id;
@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/HomePostModel;", "Lorg/godfootsteps/arch/api/model/BaseModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
public final class GospelWitnessListActivity$loadArticle$1 extends Lambda implements l<Request<HomePostModel, BaseModel<HomePostModel>>, e> {
public final LoadingLayout $itemLoadingLayout;
public final SmartRefreshLayout $refreshLayout;
public final RecyclerView $rvList;
public final GospelWitnessListActivity 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/HomePostModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.home.GospelWitnessListActivity$loadArticle$1$2", f = "GospelWitnessListActivity.kt", l = {172}, m = "invokeSuspend")
public static final class AnonymousClass2 extends SuspendLambda implements l<n.g.c<? super BaseModel<HomePostModel>>, Object> {
public int label;
public final GospelWitnessListActivity this$0;
public AnonymousClass2(GospelWitnessListActivity gospelWitnessListActivity, n.g.c<? super AnonymousClass2> cVar) {
super(1, cVar);
this.this$0 = gospelWitnessListActivity;
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass2(this.this$0, cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<HomePostModel>> 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;
String str = (String) this.this$0.f15817q.getValue();
h.d(str, "category");
String str2 = (String) this.this$0.f15818r.getValue();
h.d(str2, "tag");
String str3 = this.this$0.f15820t;
this.label = 1;
obj = appClient.D(str, str2, str3, 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 GospelWitnessListActivity$loadArticle$1(RecyclerView recyclerView, LoadingLayout loadingLayout, GospelWitnessListActivity gospelWitnessListActivity, SmartRefreshLayout smartRefreshLayout) {
super(1);
this.$rvList = recyclerView;
this.$itemLoadingLayout = loadingLayout;
this.this$0 = gospelWitnessListActivity;
this.$refreshLayout = smartRefreshLayout;
}
@Override
public e invoke(Request<HomePostModel, BaseModel<HomePostModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<HomePostModel, BaseModel<HomePostModel>> request) {
h.e(request, "$this$request");
final RecyclerView recyclerView = this.$rvList;
final LoadingLayout loadingLayout = this.$itemLoadingLayout;
request.f15179k = new a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
RecyclerView.Adapter adapter;
RecyclerView recyclerView2 = RecyclerView.this;
int i2 = 0;
if (recyclerView2 != null && (adapter = recyclerView2.getAdapter()) != null) {
i2 = adapter.getItemCount();
}
if (i2 == 0) {
loadingLayout.k();
}
}
};
request.f(new AnonymousClass2(this.this$0, null));
final LoadingLayout loadingLayout2 = this.$itemLoadingLayout;
final GospelWitnessListActivity gospelWitnessListActivity = this.this$0;
final SmartRefreshLayout smartRefreshLayout = this.$refreshLayout;
final RecyclerView recyclerView2 = this.$rvList;
request.f15180l = new l<HomePostModel, e>() {
{
super(1);
}
@Override
public e invoke(HomePostModel homePostModel) {
invoke2(homePostModel);
return e.a;
}
public final void invoke2(HomePostModel homePostModel) {
h.e(homePostModel, "model");
if (!LoadingLayout.this.d()) {
LoadingLayout.this.i();
}
GospelWitnessListActivity gospelWitnessListActivity2 = gospelWitnessListActivity;
String nextPage = homePostModel.getNextPage();
h.d(nextPage, "model.nextPage");
gospelWitnessListActivity2.f15820t = nextPage;
if (h.a("null", gospelWitnessListActivity.f15820t)) {
smartRefreshLayout.k();
} else {
smartRefreshLayout.i();
}
if (recyclerView2.getAdapter() == null) {
recyclerView2.setAdapter(new ScreenListAdapter<HomePostModel.ArticleListBean>(gospelWitnessListActivity, new k.e<HomePostModel.ArticleListBean>() {
@Override
public boolean a(HomePostModel.ArticleListBean articleListBean, HomePostModel.ArticleListBean articleListBean2) {
HomePostModel.ArticleListBean articleListBean3 = articleListBean;
HomePostModel.ArticleListBean articleListBean4 = articleListBean2;
h.e(articleListBean3, "t");
h.e(articleListBean4, "t1");
return h.a(articleListBean3, articleListBean4);
}
@Override
public boolean b(HomePostModel.ArticleListBean articleListBean, HomePostModel.ArticleListBean articleListBean2) {
HomePostModel.ArticleListBean articleListBean3 = articleListBean;
HomePostModel.ArticleListBean articleListBean4 = articleListBean2;
h.e(articleListBean3, "t");
h.e(articleListBean4, "t1");
return h.a(articleListBean3.getTitle(), articleListBean4.getTitle());
}
}) {
public final GospelWitnessListActivity f15823l;
{
super(r3);
this.f15823l = r2;
m(HomePostModel.this.getArticleList());
}
@Override
public int h() {
return R$layout.item_thumbnail_title;
}
@Override
public void i(ScreenViewHolder screenViewHolder, HomePostModel.ArticleListBean articleListBean) {
h.e(articleListBean, "item");
}
@Override
public void onBindViewHolder(final ScreenViewHolder screenViewHolder, int i2) {
h.e(screenViewHolder, "holder");
final HomePostModel.ArticleListBean articleListBean = (HomePostModel.ArticleListBean) this.f15170i.f8961f.get(i2);
final GospelWitnessListActivity gospelWitnessListActivity3 = this.f15823l;
View view = screenViewHolder.f15173i;
((TextView) (view == null ? null : view.findViewById(R$id.tv_title))).setText(articleListBean.getTitle());
View view2 = screenViewHolder.f15173i;
View findViewById = view2 != null ? view2.findViewById(R$id.iv_thumbnail) : null;
h.d(findViewById, "iv_thumbnail");
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append((Object) ((String) gospelWitnessListActivity3.f15814n.getValue()));
sb.append("ld/");
sb.append((Object) articleListBean.getImage());
((CustomThumbnailView) findViewById).e(sb.toString(), R$drawable.ic_placeholder_16_9, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : true);
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view3) {
CharSequence title;
GospelWitnessListActivity gospelWitnessListActivity4 = GospelWitnessListActivity.this;
HomePostModel.ArticleListBean articleListBean2 = articleListBean;
ScreenViewHolder screenViewHolder2 = screenViewHolder;
n.i.b.h.e(gospelWitnessListActivity4, "this$0");
n.i.b.h.e(articleListBean2, "$item");
n.i.b.h.e(screenViewHolder2, "$this_apply");
d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar != null) {
StringBuilder sb2 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb2.append("https://appservercn.kingdomsalvation.org");
sb2.append((Object) ((String) gospelWitnessListActivity4.f15815o.getValue()));
sb2.append((Object) articleListBean2.getName());
String sb3 = sb2.toString();
int id = articleListBean2.getId();
String str = (String) gospelWitnessListActivity4.f15816p.getValue();
if (str == null) {
str = "";
}
String str2 = (String) gospelWitnessListActivity4.f15819s.getValue();
cVar.k(sb3, id, str, str2 == null ? "" : str2, articleListBean2.getShare());
}
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
View view4 = screenViewHolder2.f15173i;
String str3 = null;
Toolbar toolbar = (Toolbar) (view4 == null ? null : view4.findViewById(R$id.toolbar));
if (toolbar != null && (title = toolbar.getTitle()) != null) {
str3 = title.toString();
}
companion.l(str3, articleListBean2.getTitle());
}
});
}
});
return;
}
RecyclerView.Adapter adapter = recyclerView2.getAdapter();
Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.commons.screenadapt.recyclerview.ScreenListAdapter<org.godfootsteps.arch.api.model.HomePostModel.ArticleListBean>");
ScreenListAdapter screenListAdapter = (ScreenListAdapter) adapter;
ArrayList arrayList = new ArrayList();
arrayList.addAll(screenListAdapter.f());
List<HomePostModel.ArticleListBean> articleList = homePostModel.getArticleList();
h.d(articleList, "model.articleList");
arrayList.addAll(articleList);
screenListAdapter.m(arrayList);
}
};
final SmartRefreshLayout smartRefreshLayout2 = this.$refreshLayout;
final RecyclerView recyclerView3 = this.$rvList;
final LoadingLayout loadingLayout3 = this.$itemLoadingLayout;
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");
SmartRefreshLayout.this.i();
if (recyclerView3.getAdapter() != null) {
RecyclerView.Adapter adapter = recyclerView3.getAdapter();
Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.commons.screenadapt.recyclerview.ScreenListAdapter<*>");
if (!((ScreenListAdapter) adapter).f().isEmpty()) {
return;
}
}
n.m.t.a.p.m.e1.a.v2(loadingLayout3);
}
};
}
}