CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 AboutUsActivity$initData$1.java 源代码,内容仅作参考
package org.godfootsteps.more;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager3.widget.ViewPager3;
import carbon.custom.LoadingLayout;
import com.blankj.utilcode.util.NetworkUtils;
import com.flyco.tablayout.SlidingTabLayout;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.ThumbnailView;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerLayout;
import com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView;
import d.c.a.j.v;
import d.c.g.a3;
import i.c.a.c.n0;
import i.j.a.e.t.d;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
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.l;
import n.i.a.p;
import n.i.b.h;
import n.m.t.a.p.m.e1.a;
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.util.Request;
import org.godfootsteps.arch.customSystemViews.CustomThumbnailView;
import org.godfootsteps.arch.vimeoApi.VimeoApi;
import org.godfootsteps.arch.vimeoApi.VimeoApi$singleVideoRequest$1;
import org.godfootsteps.arch.youtubeApi.YouTubeApi;
import org.godfootsteps.arch.youtubeApi.YouTubeApi$singleVideoRequest$1;
import org.godfootsteps.more.AboutUsActivity;
import org.godfootsteps.more.GalleryActivity;
import org.godfootsteps.more.view.PlatformView;
import org.godfootsteps.router.model.AboutUsModel;
import org.godfootsteps.router.model.Video;
@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/router/model/AboutUsModel;", "Lorg/godfootsteps/arch/api/model/BaseModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
public final class AboutUsActivity$initData$1 extends Lambda implements l<Request<AboutUsModel, BaseModel<AboutUsModel>>, e> {
public final AboutUsActivity 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/router/model/AboutUsModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.more.AboutUsActivity$initData$1$1", f = "AboutUsActivity.kt", l = {179}, m = "invokeSuspend")
public static final class AnonymousClass1 extends SuspendLambda implements l<n.g.c<? super BaseModel<AboutUsModel>>, Object> {
public int label;
public AnonymousClass1(n.g.c<? super AnonymousClass1> cVar) {
super(1, cVar);
}
@Override
public final n.g.c<e> create(n.g.c<?> cVar) {
return new AnonymousClass1(cVar);
}
@Override
public final Object invoke(n.g.c<? super BaseModel<AboutUsModel>> cVar) {
return ((AnonymousClass1) 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.u(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 AboutUsActivity$initData$1(AboutUsActivity aboutUsActivity) {
super(1);
this.this$0 = aboutUsActivity;
}
@Override
public e invoke(Request<AboutUsModel, BaseModel<AboutUsModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<AboutUsModel, BaseModel<AboutUsModel>> request) {
h.e(request, "$this$request");
request.f(new AnonymousClass1(null));
final AboutUsActivity aboutUsActivity = this.this$0;
request.f15180l = new l<AboutUsModel, e>() {
{
super(1);
}
@Override
public e invoke(AboutUsModel aboutUsModel) {
invoke2(aboutUsModel);
return e.a;
}
public final void invoke2(AboutUsModel aboutUsModel) {
YouTubePlayerView b0;
int childCount;
h.e(aboutUsModel, "model");
((LoadingLayout) AboutUsActivity.this.findViewById(R$id.loading_layout)).i();
AboutUsActivity aboutUsActivity2 = AboutUsActivity.this;
String imageBaseUrl = aboutUsModel.getImageBaseUrl();
if (imageBaseUrl == null) {
imageBaseUrl = "";
}
aboutUsActivity2.f15929k = imageBaseUrl;
AboutUsActivity aboutUsActivity3 = AboutUsActivity.this;
String articleBaseUrl = aboutUsModel.getArticleBaseUrl();
if (articleBaseUrl == null) {
articleBaseUrl = "";
}
aboutUsActivity3.f15930l = articleBaseUrl;
YouTubePlayerView b02 = AboutUsActivity.this.b0();
String churchId = aboutUsModel.getChurchId();
h.d(churchId, "model.churchId");
b02.l(churchId, false);
if (!NetworkUtils.c() && (childCount = (b0 = AboutUsActivity.this.b0()).getChildCount()) > 0) {
int i2 = 0;
while (true) {
int i3 = i2 + 1;
View childAt = b0.getChildAt(i2);
h.d(childAt, "getChildAt(index)");
if (childAt instanceof ProgressBar) {
n0.c(childAt, false, 1);
}
if (i3 >= childCount) {
break;
}
i2 = i3;
}
}
final AboutUsActivity aboutUsActivity4 = AboutUsActivity.this;
String churchId2 = aboutUsModel.getChurchId();
String str = churchId2 != null ? churchId2 : "";
Objects.requireNonNull(aboutUsActivity4);
if (NetworkUtils.c()) {
l<Video, e> lVar = new l<Video, e>() {
{
super(1);
}
@Override
public e invoke(Video video) {
invoke2(video);
return e.a;
}
public final void invoke2(Video video) {
h.e(video, "it");
AboutUsActivity aboutUsActivity5 = AboutUsActivity.this;
int i4 = AboutUsActivity.f15928o;
ThumbnailView thumbnailView = aboutUsActivity5.b0().getThumbnailView();
String hqThumbnailURL = video.getHqThumbnailURL();
h.d(hqThumbnailURL, "it.hqThumbnailURL");
a.F1(thumbnailView, hqThumbnailURL, null, 2);
TextView textView = (TextView) ((YouTubePlayerLayout) AboutUsActivity.this.findViewById(R$id.player_layout)).findViewById(R$id.tv_duration);
if (textView == null) {
return;
}
textView.setText(video.getDuration());
}
};
AboutUsActivity$loadVideoImage$2 aboutUsActivity$loadVideoImage$2 = new l<Integer, e>() {
@Override
public e invoke(Integer num) {
invoke(num.intValue());
return e.a;
}
public final void invoke(int i4) {
}
};
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(aboutUsActivity$loadVideoImage$2, "onError");
h.e(str, "<this>");
if (n.o.a.B(str, "Vimeo_", true) || Pattern.matches("^[0-9]+$", str)) {
VimeoApi vimeoApi = VimeoApi.a;
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(aboutUsActivity$loadVideoImage$2, "onError");
vimeoApi.b(str, new VimeoApi$singleVideoRequest$1(aboutUsActivity$loadVideoImage$2, lVar), aboutUsActivity$loadVideoImage$2);
} else {
YouTubeApi youTubeApi = YouTubeApi.a;
h.e(str, "videoId");
h.e(lVar, "onSuccess");
h.e(aboutUsActivity$loadVideoImage$2, "onError");
youTubeApi.c(str, new YouTubeApi$singleVideoRequest$1(aboutUsActivity$loadVideoImage$2, lVar), aboutUsActivity$loadVideoImage$2);
}
} else {
h.e(str, "<this>");
if (!(n.o.a.B(str, "Vimeo_", true) || Pattern.matches("^[0-9]+$", str))) {
a.F1(aboutUsActivity4.b0().getThumbnailView(), i.a.b.a.a.s("http://img.youtube.com/vi/", str, "/hqdefault.jpg"), null, 2);
}
}
AboutUsActivity aboutUsActivity5 = AboutUsActivity.this;
AboutUsModel.AboutImageBean aboutImage = aboutUsModel.getAboutImage();
Objects.requireNonNull(aboutUsActivity5);
if (aboutImage != null) {
final ArrayList arrayList = new ArrayList();
final ArrayList arrayList2 = new ArrayList();
List<AboutUsModel.AboutImageBean.ChurchLifeBean> churchLife = aboutImage.getChurchLife();
if (!(churchLife == null || churchLife.isEmpty())) {
List<AboutUsModel.AboutImageBean.ChurchLifeBean> churchLife2 = aboutImage.getChurchLife();
h.d(churchLife2, "aboutImage.churchLife");
for (AboutUsModel.AboutImageBean.ChurchLifeBean churchLifeBean : churchLife2) {
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(aboutUsActivity5.f15929k);
sb.append("md/");
sb.append((Object) churchLifeBean.getName());
churchLifeBean.setName(sb.toString());
}
List<AboutUsModel.AboutImageBean.ChurchLifeBean> churchLife3 = aboutImage.getChurchLife();
h.d(churchLife3, "aboutImage.churchLife");
arrayList.add(churchLife3);
String string = aboutUsActivity5.getResources().getString(R$string.about_us_church_life);
h.d(string, "resources.getString(resId)");
arrayList2.add(string);
}
List<AboutUsModel.AboutImageBean.ChurchLifeBean> choir = aboutImage.getChoir();
if (!(choir == null || choir.isEmpty())) {
List<AboutUsModel.AboutImageBean.ChurchLifeBean> choir2 = aboutImage.getChoir();
h.d(choir2, "aboutImage.choir");
for (AboutUsModel.AboutImageBean.ChurchLifeBean churchLifeBean2 : choir2) {
StringBuilder sb2 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb2.append("https://appservercn.kingdomsalvation.org");
sb2.append(aboutUsActivity5.f15929k);
sb2.append("md/");
sb2.append((Object) churchLifeBean2.getName());
churchLifeBean2.setName(sb2.toString());
}
List<AboutUsModel.AboutImageBean.ChurchLifeBean> choir3 = aboutImage.getChoir();
h.d(choir3, "aboutImage.choir");
arrayList.add(choir3);
String string2 = aboutUsActivity5.getResources().getString(R$string.about_us_choir);
h.d(string2, "resources.getString(resId)");
arrayList2.add(string2);
}
List<AboutUsModel.AboutImageBean.ChurchLifeBean> gospel = aboutImage.getGospel();
if (!(gospel == null || gospel.isEmpty())) {
List<AboutUsModel.AboutImageBean.ChurchLifeBean> gospel2 = aboutImage.getGospel();
h.d(gospel2, "aboutImage.gospel");
for (AboutUsModel.AboutImageBean.ChurchLifeBean churchLifeBean3 : gospel2) {
StringBuilder sb3 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb3.append("https://appservercn.kingdomsalvation.org");
sb3.append(aboutUsActivity5.f15929k);
sb3.append("md/");
sb3.append((Object) churchLifeBean3.getName());
churchLifeBean3.setName(sb3.toString());
}
List<AboutUsModel.AboutImageBean.ChurchLifeBean> gospel3 = aboutImage.getGospel();
h.d(gospel3, "aboutImage.gospel");
arrayList.add(gospel3);
String string3 = aboutUsActivity5.getResources().getString(R$string.about_us_gospel);
h.d(string3, "resources.getString(resId)");
arrayList2.add(string3);
}
if (arrayList.size() > 0) {
LinearLayout linearLayout = (LinearLayout) aboutUsActivity5.findViewById(R$id.ll_gallery);
h.d(linearLayout, "ll_gallery");
n0.t(linearLayout);
if (v.j()) {
if (arrayList.size() > 1) {
((ViewPager3) aboutUsActivity5.findViewById(R$id.view_pager)).setOffscreenPageLimit(arrayList.size() - 1);
}
int i4 = R$id.view_pager;
((ViewPager3) aboutUsActivity5.findViewById(i4)).setAdapter(new ScreenListAdapter<List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean>>(arrayList) {
public final List<List<AboutUsModel.AboutImageBean.ChurchLifeBean>> f15935k;
{
super(null, 1);
this.f15935k = arrayList;
m(arrayList);
}
@Override
public int h() {
return R$layout.item_church_gallery;
}
@Override
public void i(ScreenViewHolder screenViewHolder, List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean> list) {
final List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean> list2 = list;
h.e(list2, "item");
h.c(screenViewHolder);
View view = screenViewHolder.f15173i;
View findViewById = view == null ? null : view.findViewById(R$id.iv_thumbnail);
h.d(findViewById, "iv_thumbnail");
((CustomThumbnailView) findViewById).e(list2.get(0).getName(), R$drawable.ic_placeholder_16_9, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : true);
View view2 = screenViewHolder.f15173i;
((carbon.widget.TextView) (view2 != null ? view2.findViewById(R$id.tv_count) : null)).setText(String.valueOf(list2.size()));
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view3) {
List list3 = list2;
n.i.b.h.e(list3, "$item");
GalleryActivity.b0(new ArrayList(list3));
}
});
}
});
if (arrayList.size() == 1) {
SlidingTabLayout slidingTabLayout = (SlidingTabLayout) aboutUsActivity5.findViewById(R$id.tab_layout);
h.d(slidingTabLayout, "tab_layout");
n0.c(slidingTabLayout, false, 1);
} else {
((SlidingTabLayout) aboutUsActivity5.findViewById(R$id.tab_layout)).x((ViewPager3) aboutUsActivity5.findViewById(i4), arrayList2);
}
} else {
((RecyclerView) aboutUsActivity5.findViewById(R$id.rv_gallery)).setAdapter(new ScreenListAdapter<List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean>>(arrayList2, arrayList) {
public final List<String> f15936k;
public final List<List<AboutUsModel.AboutImageBean.ChurchLifeBean>> f15937l;
{
super(null, 1);
this.f15937l = arrayList;
m(arrayList);
}
@Override
public int h() {
return R$layout.item_church_gallery;
}
@Override
public void i(ScreenViewHolder screenViewHolder, List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean> list) {
final List<? extends AboutUsModel.AboutImageBean.ChurchLifeBean> list2 = list;
h.e(list2, "item");
h.c(screenViewHolder);
List<String> list3 = this.f15936k;
View view = screenViewHolder.f15173i;
View findViewById = view == null ? null : view.findViewById(R$id.iv_thumbnail);
h.d(findViewById, "iv_thumbnail");
((CustomThumbnailView) findViewById).e(list2.get(0).getName(), R$drawable.ic_placeholder_16_9, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : true);
View view2 = screenViewHolder.f15173i;
((carbon.widget.TextView) (view2 == null ? null : view2.findViewById(R$id.tv_count))).setText(String.valueOf(list2.size()));
View view3 = screenViewHolder.f15173i;
((TextView) (view3 != null ? view3.findViewById(R$id.tv_gallery_title) : null)).setText(list3.get(screenViewHolder.getLayoutPosition()));
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
List list4 = list2;
n.i.b.h.e(list4, "$item");
GalleryActivity.b0(new ArrayList(list4));
}
});
}
});
}
} else {
LinearLayout linearLayout2 = (LinearLayout) aboutUsActivity5.findViewById(R$id.ll_gallery);
h.d(linearLayout2, "ll_gallery");
n0.c(linearLayout2, false, 1);
}
} else {
LinearLayout linearLayout3 = (LinearLayout) aboutUsActivity5.findViewById(R$id.ll_gallery);
h.d(linearLayout3, "ll_gallery");
n0.c(linearLayout3, false, 1);
}
AboutUsActivity aboutUsActivity6 = AboutUsActivity.this;
List<AboutUsModel.ArticleBean> aboutRead = aboutUsModel.getAboutRead();
Objects.requireNonNull(aboutUsActivity6);
if (aboutRead == null || aboutRead.isEmpty()) {
LinearLayout linearLayout4 = (LinearLayout) aboutUsActivity6.findViewById(R$id.ll_article);
h.d(linearLayout4, "ll_article");
n0.c(linearLayout4, false, 1);
} else {
LinearLayout linearLayout5 = (LinearLayout) aboutUsActivity6.findViewById(R$id.ll_article);
h.d(linearLayout5, "ll_article");
n0.t(linearLayout5);
((RecyclerView) aboutUsActivity6.findViewById(R$id.rv_article)).setAdapter(new AboutUsActivity.ArticleAdapter(aboutUsActivity6, aboutRead));
}
AboutUsActivity aboutUsActivity7 = AboutUsActivity.this;
List<AboutUsModel.ArticleBean> aboutQuestion = aboutUsModel.getAboutQuestion();
Objects.requireNonNull(aboutUsActivity7);
if (aboutQuestion == null || aboutQuestion.isEmpty()) {
LinearLayout linearLayout6 = (LinearLayout) aboutUsActivity7.findViewById(R$id.ll_ask);
h.d(linearLayout6, "ll_ask");
n0.c(linearLayout6, false, 1);
} else {
LinearLayout linearLayout7 = (LinearLayout) aboutUsActivity7.findViewById(R$id.ll_ask);
h.d(linearLayout7, "ll_ask");
n0.t(linearLayout7);
((RecyclerView) aboutUsActivity7.findViewById(R$id.rv_ask)).setAdapter(new AboutUsActivity.ArticleAdapter(aboutUsActivity7, aboutQuestion));
}
AboutUsActivity aboutUsActivity8 = AboutUsActivity.this;
List<AboutUsModel.AboutLinkBean> aboutLink = aboutUsModel.getAboutLink();
Objects.requireNonNull(aboutUsActivity8);
if (aboutLink == null || aboutLink.isEmpty()) {
LinearLayout linearLayout8 = (LinearLayout) aboutUsActivity8.findViewById(R$id.ll_platform);
h.d(linearLayout8, "ll_platform");
n0.c(linearLayout8, false, 1);
return;
}
LinearLayout linearLayout9 = (LinearLayout) aboutUsActivity8.findViewById(R$id.ll_platform);
h.d(linearLayout9, "ll_platform");
n0.t(linearLayout9);
((PlatformView) aboutUsActivity8.findViewById(R$id.platform_view)).setImageViews(new a3(aboutLink));
}
};
final AboutUsActivity aboutUsActivity2 = 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");
LoadingLayout loadingLayout = (LoadingLayout) AboutUsActivity.this.findViewById(R$id.loading_layout);
h.d(loadingLayout, "loading_layout");
a.v2(loadingLayout);
}
};
}
}