CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 HomePageFragment.java 源代码,内容仅作参考
package org.godfootsteps.home;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import carbon.custom.LoadingLayout;
import com.blankj.utilcode.util.NetworkUtils;
import d.c.a.a.a.d;
import d.c.a.a.b.b;
import d.c.a.j.v;
import i.c.a.c.n0;
import i.c.a.c.o;
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 n.e;
import n.f.g;
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.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.model.BaseCategoryModel;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.model.HomeBannerModel;
import org.godfootsteps.arch.api.model.HomeNormalModel;
import org.godfootsteps.arch.api.model.HomePageModel;
import org.godfootsteps.arch.api.model.HomeThreeTruthsData;
import org.godfootsteps.arch.api.model.HomeVideoModel;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.arch.videoApi.VideoClient;
import org.godfootsteps.base.BaseFragment;
import org.godfootsteps.home.HomePageFragment;
import org.godfootsteps.home.viewholder.BaseHomeViewHolder;
import org.godfootsteps.home.viewholder.BookVH;
import org.godfootsteps.home.viewholder.DummyVH;
import org.godfootsteps.home.viewholder.ImageBannerVH;
import org.godfootsteps.home.viewholder.ImageTitleVH;
import org.godfootsteps.home.viewholder.ListWithHeaderVH;
import org.godfootsteps.home.viewholder.MZBannerVH;
import org.godfootsteps.home.viewholder.NewsThumbnailVH;
import org.godfootsteps.home.viewholder.NumberTitleVH;
import org.godfootsteps.home.viewholder.ThumbnailVH;
import org.godfootsteps.home.viewholder.VideoCategoryVH;
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 \u001e2\u00020\u0001:\u0002\u001e\u001fB\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u000e\u001a\u00020\u000fH\u0002J\b\u0010\u0010\u001a\u00020\u0011H\u0014J\b\u0010\u0012\u001a\u00020\u000fH\u0014J\b\u0010\u0013\u001a\u00020\u000fH\u0014J\u0010\u0010\u0014\u001a\u00020\u000f2\b\b\u0002\u0010\u0015\u001a\u00020\u0004J\u0016\u0010\u0016\u001a\u00020\u00042\f\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00190\u0018H\u0002J\u0010\u0010\u001a\u001a\u00020\u000f2\u0006\u0010\u001b\u001a\u00020\u001cH\u0016J\b\u0010\u001d\u001a\u00020\u000fH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\f\u001a\u0004\u0018\u00010\rX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006 "}, d2 = {"Lorg/godfootsteps/home/HomePageFragment;", "Lorg/godfootsteps/base/BaseFragment;", "()V", "isLazyLoad", "", "isLoad", "isNight", "lastTime", "", "limitTime", "mode", "", "result", "Lorg/godfootsteps/arch/api/model/HomePageModel;", "error", "", "getLayoutId", "", "initData", "initView", "loadData", "isForce", "needDisableRecycle", "list", "", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "onConfigurationChanged", "newConfig", "Landroid/content/res/Configuration;", "onResume", "Companion", "ModeAdapter", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class HomePageFragment extends BaseFragment {
public static final int f15833r = 0;
public String f15834k = "";
public HomePageModel f15835l;
public boolean f15836m;
public long f15837n;
public long f15838o;
public boolean f15839p;
public boolean f15840q;
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0013\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004¢\u0006\u0002\u0010\u0006J\b\u0010\u000b\u001a\u00020\fH\u0016J\u0010\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\fH\u0016J\u0018\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00022\u0006\u0010\u000e\u001a\u00020\fH\u0016J\u0018\u0010\u0012\u001a\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\fH\u0016R \u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\n¨\u0006\u0016"}, d2 = {"Lorg/godfootsteps/home/HomePageFragment$ModeAdapter;", "Landroidx/recyclerview/widget/RecyclerView$Adapter;", "Lorg/godfootsteps/home/viewholder/BaseHomeViewHolder;", "list", "", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "(Lorg/godfootsteps/home/HomePageFragment;Ljava/util/List;)V", "getList", "()Ljava/util/List;", "setList", "(Ljava/util/List;)V", "getItemCount", "", "getItemViewType", "position", "onBindViewHolder", "", "holder", "onCreateViewHolder", "parent", "Landroid/view/ViewGroup;", "viewType", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ModeAdapter extends RecyclerView.Adapter<BaseHomeViewHolder> {
public List<? extends BaseCategoryModel> a;
public final HomePageFragment b;
public ModeAdapter(HomePageFragment homePageFragment, List<? extends BaseCategoryModel> list) {
h.e(homePageFragment, "this$0");
h.e(list, "list");
this.b = homePageFragment;
this.a = list;
}
@Override
public int getItemCount() {
return this.a.size();
}
@Override
public int getItemViewType(int r15) {
throw new UnsupportedOperationException("Method not decompiled: org.godfootsteps.home.HomePageFragment.ModeAdapter.getItemViewType(int):int");
}
@Override
public void onBindViewHolder(BaseHomeViewHolder baseHomeViewHolder, int i2) {
String str;
BaseHomeViewHolder baseHomeViewHolder2 = baseHomeViewHolder;
h.e(baseHomeViewHolder2, "holder");
final HomePageFragment homePageFragment = this.b;
String str2 = homePageFragment.f15834k;
h.e(str2, "<set-?>");
baseHomeViewHolder2.f15876j = str2;
if (baseHomeViewHolder2 instanceof ImageBannerVH) {
if (h.a("gospel", str2) || h.a("simplify", baseHomeViewHolder2.f15876j)) {
HomePageModel homePageModel = homePageFragment.f15835l;
h.c(homePageModel);
String bannerURL = homePageModel.getBannerURL();
h.e(bannerURL, "<set-?>");
((ImageBannerVH) baseHomeViewHolder2).f15882k = bannerURL;
}
} else {
str = "";
if (baseHomeViewHolder2 instanceof NumberTitleVH) {
int hashCode = str2.hashCode();
if (hashCode != -1240117076) {
if (hashCode != -1102508601) {
if (hashCode == 485665033) {
}
} else if (str2.equals("listen")) {
NumberTitleVH numberTitleVH = (NumberTitleVH) baseHomeViewHolder2;
HomePageModel homePageModel2 = homePageFragment.f15835l;
h.c(homePageModel2);
String cssURL = homePageModel2.getCssURL();
if (cssURL == null) {
cssURL = "";
}
h.e(cssURL, "<set-?>");
HomePageModel homePageModel3 = homePageFragment.f15835l;
h.c(homePageModel3);
String trickURL = homePageModel3.getTrickURL();
str = trickURL != null ? trickURL : "";
h.e(str, "<set-?>");
numberTitleVH.f15903l = str;
}
}
} else if (baseHomeViewHolder2 instanceof ImageTitleVH) {
ImageTitleVH imageTitleVH = (ImageTitleVH) baseHomeViewHolder2;
HomePageModel homePageModel4 = homePageFragment.f15835l;
h.c(homePageModel4);
String article = homePageModel4.getArticle();
if (article == null) {
article = "";
}
h.e(article, "<set-?>");
HomePageModel homePageModel5 = homePageFragment.f15835l;
h.c(homePageModel5);
String cssURL2 = homePageModel5.getCssURL();
if (cssURL2 == null) {
cssURL2 = "";
}
h.e(cssURL2, "<set-?>");
HomePageModel homePageModel6 = homePageFragment.f15835l;
h.c(homePageModel6);
String gospelTruthImageURL = homePageModel6.getGospelTruthImageURL();
if (gospelTruthImageURL == null) {
gospelTruthImageURL = "";
}
h.e(gospelTruthImageURL, "<set-?>");
imageTitleVH.f15884k = gospelTruthImageURL;
HomePageModel homePageModel7 = homePageFragment.f15835l;
h.c(homePageModel7);
String storyImageURL = homePageModel7.getStoryImageURL();
if (storyImageURL == null) {
storyImageURL = "";
}
h.e(storyImageURL, "<set-?>");
imageTitleVH.f15885l = storyImageURL;
HomePageModel homePageModel8 = homePageFragment.f15835l;
h.c(homePageModel8);
String platform = homePageModel8.getPlatform();
str = platform != null ? platform : "";
h.e(str, "<set-?>");
imageTitleVH.f15886m = str;
} else if (baseHomeViewHolder2 instanceof ThumbnailVH) {
ThumbnailVH thumbnailVH = (ThumbnailVH) baseHomeViewHolder2;
HomePageModel homePageModel9 = homePageFragment.f15835l;
h.c(homePageModel9);
String imageURL = homePageModel9.getImageURL();
if (imageURL == null) {
imageURL = "";
}
h.e(imageURL, "<set-?>");
thumbnailVH.f15911l = imageURL;
HomePageModel homePageModel10 = homePageFragment.f15835l;
h.c(homePageModel10);
String gospelTruthImageURL2 = homePageModel10.getGospelTruthImageURL();
if (gospelTruthImageURL2 == null) {
gospelTruthImageURL2 = "";
}
h.e(gospelTruthImageURL2, "<set-?>");
thumbnailVH.f15913n = gospelTruthImageURL2;
HomePageModel homePageModel11 = homePageFragment.f15835l;
h.c(homePageModel11);
String article2 = homePageModel11.getArticle();
if (article2 == null) {
article2 = "";
}
h.e(article2, "<set-?>");
thumbnailVH.f15914o = article2;
HomePageModel homePageModel12 = homePageFragment.f15835l;
h.c(homePageModel12);
String pokeUrl = homePageModel12.getPokeUrl();
if (pokeUrl == null) {
pokeUrl = "";
}
h.e(pokeUrl, "<set-?>");
thumbnailVH.f15915p = pokeUrl;
HomePageModel homePageModel13 = homePageFragment.f15835l;
h.c(homePageModel13);
String turnURL = homePageModel13.getTurnURL();
if (turnURL == null) {
turnURL = "";
}
h.e(turnURL, "<set-?>");
thumbnailVH.f15916q = turnURL;
HomePageModel homePageModel14 = homePageFragment.f15835l;
h.c(homePageModel14);
String imageBaseUrl = homePageModel14.getImageBaseUrl();
if (imageBaseUrl == null) {
imageBaseUrl = "";
}
h.e(imageBaseUrl, "<set-?>");
thumbnailVH.f15912m = imageBaseUrl;
if (h.a(baseHomeViewHolder2.f15876j, "listen")) {
HomePageModel homePageModel15 = homePageFragment.f15835l;
h.c(homePageModel15);
String cssURL3 = homePageModel15.getCssURL();
h.e(cssURL3 != null ? cssURL3 : "", "<set-?>");
}
if (homePageFragment.f15839p && i2 == 0) {
View view = homePageFragment.getView();
View findViewById = view == null ? null : view.findViewById(R$id.rv_list);
h.d(findViewById, "this@HomePageFragment.rv_list");
if (!n0.g(findViewById)) {
View view2 = homePageFragment.getView();
}
thumbnailVH.f15910k = new a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
View view3 = HomePageFragment.this.getView();
LoadingLayout loadingLayout = (LoadingLayout) (view3 == null ? null : view3.findViewById(R$id.loading_layout));
if ((loadingLayout == null || loadingLayout.d()) ? false : true) {
View view4 = HomePageFragment.this.getView();
LoadingLayout loadingLayout2 = (LoadingLayout) (view4 == null ? null : view4.findViewById(R$id.loading_layout));
if (loadingLayout2 != null) {
loadingLayout2.i();
}
}
View view5 = HomePageFragment.this.getView();
RecyclerView recyclerView = (RecyclerView) (view5 == null ? null : view5.findViewById(R$id.rv_list));
if (recyclerView != null && n0.g(recyclerView)) {
View view6 = HomePageFragment.this.getView();
RecyclerView recyclerView2 = (RecyclerView) (view6 != null ? view6.findViewById(R$id.rv_list) : null);
if (recyclerView2 == null) {
return;
}
n0.t(recyclerView2);
}
}
};
}
thumbnailVH.f15910k = null;
} else if (baseHomeViewHolder2 instanceof VideoCategoryVH) {
if (homePageFragment.f15839p && i2 == 0) {
View view3 = homePageFragment.getView();
View findViewById2 = view3 == null ? null : view3.findViewById(R$id.rv_list);
h.d(findViewById2, "this@HomePageFragment.rv_list");
if (!n0.g(findViewById2)) {
View view4 = homePageFragment.getView();
}
((VideoCategoryVH) baseHomeViewHolder2).f15921k = new a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
View view5 = HomePageFragment.this.getView();
LoadingLayout loadingLayout = (LoadingLayout) (view5 == null ? null : view5.findViewById(R$id.loading_layout));
if (loadingLayout != null) {
loadingLayout.i();
}
View view6 = HomePageFragment.this.getView();
RecyclerView recyclerView = (RecyclerView) (view6 == null ? null : view6.findViewById(R$id.rv_list));
boolean z = false;
if (recyclerView != null && n0.g(recyclerView)) {
z = true;
}
if (z) {
View view7 = HomePageFragment.this.getView();
RecyclerView recyclerView2 = (RecyclerView) (view7 != null ? view7.findViewById(R$id.rv_list) : null);
if (recyclerView2 == null) {
return;
}
n0.t(recyclerView2);
}
}
};
}
((VideoCategoryVH) baseHomeViewHolder2).f15921k = null;
} else if (baseHomeViewHolder2 instanceof BookVH) {
HomePageModel homePageModel16 = homePageFragment.f15835l;
h.c(homePageModel16);
String bookCover = homePageModel16.getBookCover();
h.e(bookCover, "<set-?>");
((BookVH) baseHomeViewHolder2).f15878k = bookCover;
HomePageModel homePageModel17 = homePageFragment.f15835l;
h.c(homePageModel17);
h.e(homePageModel17.getArticle(), "<set-?>");
HomePageModel homePageModel18 = homePageFragment.f15835l;
h.c(homePageModel18);
h.e(homePageModel18.getBookUrl(), "<set-?>");
} else if (baseHomeViewHolder2 instanceof ListWithHeaderVH) {
ListWithHeaderVH listWithHeaderVH = (ListWithHeaderVH) baseHomeViewHolder2;
HomePageModel homePageModel19 = homePageFragment.f15835l;
h.c(homePageModel19);
String gospelTruthImageURL3 = homePageModel19.getGospelTruthImageURL();
if (gospelTruthImageURL3 == null) {
gospelTruthImageURL3 = "";
}
h.e(gospelTruthImageURL3, "<set-?>");
listWithHeaderVH.f15891k = gospelTruthImageURL3;
HomePageModel homePageModel20 = homePageFragment.f15835l;
h.c(homePageModel20);
String platform2 = homePageModel20.getPlatform();
str = platform2 != null ? platform2 : "";
h.e(str, "<set-?>");
listWithHeaderVH.f15892l = str;
} else if (baseHomeViewHolder2 instanceof MZBannerVH) {
MZBannerVH mZBannerVH = (MZBannerVH) baseHomeViewHolder2;
HomePageModel homePageModel21 = homePageFragment.f15835l;
h.c(homePageModel21);
String imageBaseUrl2 = homePageModel21.getImageBaseUrl();
str = imageBaseUrl2 != null ? imageBaseUrl2 : "";
h.e(str, "<set-?>");
mZBannerVH.f15895k = str;
}
}
baseHomeViewHolder2.b(this.a.get(i2));
}
@Override
public BaseHomeViewHolder onCreateViewHolder(ViewGroup viewGroup, int i2) {
h.e(viewGroup, "parent");
switch (i2) {
case 0:
h.e(viewGroup, "view");
return new ImageBannerVH(n0.e(viewGroup, R$layout.item_image_banner, false));
case 1:
h.e(viewGroup, "view");
return new NumberTitleVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
case 2:
ThumbnailVH thumbnailVH = ThumbnailVH.f15908s;
h.e(viewGroup, "view");
return new ThumbnailVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
case 3:
h.e(viewGroup, "view");
return new ImageTitleVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
case 4:
case 5:
h.e(viewGroup, "view");
return new VideoCategoryVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
case 6:
h.e(viewGroup, "view");
return new BookVH(n0.f(viewGroup, R$layout.home_mode_book, false, 2));
case 7:
h.e(viewGroup, "view");
return new ListWithHeaderVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
case 8:
h.e(viewGroup, "view");
return new MZBannerVH(n0.f(viewGroup, R$layout.news_mode_banner, false, 2));
case 9:
h.e(viewGroup, "view");
return new NewsThumbnailVH(n0.f(viewGroup, R$layout.home_mode_recycler_view, false, 2));
default:
h.e(viewGroup, "view");
o.a("This is a dummy view holder");
return new DummyVH(new View(viewGroup.getContext()));
}
}
}
public HomePageFragment() {
Long l2 = 15000L;
l2.longValue();
this.f15838o = 5400000L;
}
public static final void I(HomePageFragment homePageFragment) {
Objects.requireNonNull(homePageFragment);
if (NetworkUtils.c()) {
View view = homePageFragment.getView();
LoadingLayout loadingLayout = (LoadingLayout) (view != null ? view.findViewById(R$id.loading_layout) : null);
if (loadingLayout != null) {
loadingLayout.j();
}
new b(d.d(homePageFragment.f15834k)).a();
return;
}
View view2 = homePageFragment.getView();
LoadingLayout loadingLayout2 = (LoadingLayout) (view2 != null ? view2.findViewById(R$id.loading_layout) : null);
if (loadingLayout2 == null) {
return;
}
loadingLayout2.l();
}
public static void K(HomePageFragment homePageFragment, boolean z, int i2) {
if ((i2 & 1) != 0) {
z = false;
}
homePageFragment.J(z);
}
@Override
public int E() {
return R$layout.fragment_home_page;
}
@Override
public void G() {
}
@Override
public void H() {
String string;
Bundle arguments = getArguments();
String str = "";
if (arguments != null && (string = arguments.getString("mode")) != null) {
str = string;
}
this.f15834k = str;
View view = getView();
((LoadingLayout) (view == null ? null : view.findViewById(R$id.loading_layout))).setButtonRetryClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
HomePageFragment homePageFragment = HomePageFragment.this;
int i2 = HomePageFragment.f15833r;
n.i.b.h.e(homePageFragment, "this$0");
homePageFragment.J(true);
}
});
this.f15840q = e.c0.a.R();
}
public final void J(boolean z) {
if (z || System.currentTimeMillis() - this.f15837n >= this.f15838o) {
this.f15837n = System.currentTimeMillis();
this.f15836m = true;
n.m.t.a.p.m.e1.a.f2(new l<Request<HomePageModel, BaseModel<HomePageModel>>, e>() {
@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/HomePageModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
@c(c = "org.godfootsteps.home.HomePageFragment$loadData$1$2", f = "HomePageFragment.kt", l = {71}, m = "invokeSuspend")
public static final class AnonymousClass2 extends SuspendLambda implements l<n.g.c<? super BaseModel<HomePageModel>>, Object> {
public int label;
public final HomePageFragment this$0;
public AnonymousClass2(HomePageFragment homePageFragment, n.g.c<? super AnonymousClass2> cVar) {
super(1, cVar);
this.this$0 = homePageFragment;
}
@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<HomePageModel>> 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) {
i.j.a.e.t.d.Q4(obj);
Objects.requireNonNull(AppClient.a);
AppClient appClient = AppClient.Companion.f15176d;
String str = this.this$0.f15834k;
this.label = 1;
obj = appClient.b(str, this);
if (obj == coroutineSingletons) {
return coroutineSingletons;
}
} else if (i2 != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
} else {
i.j.a.e.t.d.Q4(obj);
}
return obj;
}
}
{
super(1);
}
@Override
public e invoke(Request<HomePageModel, BaseModel<HomePageModel>> request) {
invoke2(request);
return e.a;
}
public final void invoke2(Request<HomePageModel, BaseModel<HomePageModel>> request) {
h.e(request, "$this$request");
final HomePageFragment homePageFragment = HomePageFragment.this;
request.f15179k = new a<e>() {
{
super(0);
}
@Override
public e invoke() {
invoke2();
return e.a;
}
public final void invoke2() {
RecyclerView.Adapter adapter;
View view = HomePageFragment.this.getView();
RecyclerView recyclerView = (RecyclerView) (view == null ? null : view.findViewById(R$id.rv_list));
int i2 = 0;
if (recyclerView != null && (adapter = recyclerView.getAdapter()) != null) {
i2 = adapter.getItemCount();
}
if (i2 == 0) {
View view2 = HomePageFragment.this.getView();
LoadingLayout loadingLayout = (LoadingLayout) (view2 != null ? view2.findViewById(R$id.loading_layout) : null);
if (loadingLayout == null) {
return;
}
loadingLayout.k();
}
}
};
request.f(new AnonymousClass2(HomePageFragment.this, null));
final HomePageFragment homePageFragment2 = HomePageFragment.this;
request.f15180l = new l<HomePageModel, e>() {
{
super(1);
}
@Override
public e invoke(HomePageModel homePageModel) {
invoke2(homePageModel);
return e.a;
}
public final void invoke2(HomePageModel homePageModel) {
boolean z2;
HomePageFragment homePageFragment3;
View view;
List<BaseCategoryModel> list;
List<HomeThreeTruthsData.VideoListBean> videoList;
h.e(homePageModel, "model");
boolean z3 = false;
if (v.i() && (!homePageModel.getList().isEmpty()) && (homePageModel.getList().get(0) instanceof HomeBannerModel)) {
n.i.b.o.c(homePageModel.getList()).remove(0);
}
List<BaseCategoryModel> list2 = homePageModel.getList();
if (list2 == null || list2.isEmpty()) {
HomePageFragment.I(HomePageFragment.this);
return;
}
VideoClient.b = !n.o.a.f(homePageModel.getPlatform(), "Vimeo", true);
for (BaseCategoryModel baseCategoryModel : homePageModel.getList()) {
if (baseCategoryModel instanceof HomeThreeTruthsData) {
if (!VideoClient.b && (videoList = ((HomeThreeTruthsData) baseCategoryModel).getVideoList()) != null) {
for (HomeThreeTruthsData.VideoListBean videoListBean : videoList) {
videoListBean.setVideoId(videoListBean.getOtherId());
}
}
HomeThreeTruthsData homeThreeTruthsData = (HomeThreeTruthsData) baseCategoryModel;
List<HomeThreeTruthsData.VideoListBean> videoList2 = homeThreeTruthsData.getVideoList();
ArrayList R = i.a.b.a.a.R(videoList2, "it.videoList");
for (Object obj : videoList2) {
String videoId = ((HomeThreeTruthsData.VideoListBean) obj).getVideoId();
if (!(videoId == null || videoId.length() == 0)) {
R.add(obj);
}
}
homeThreeTruthsData.setVideoList(R);
}
}
if (h.a(HomePageFragment.this.f15835l, homePageModel)) {
return;
}
HomePageFragment.this.f15835l = homePageModel;
List<BaseCategoryModel> list3 = homePageModel.getList();
BaseCategoryModel baseCategoryModel2 = list3 == null ? null : (BaseCategoryModel) g.o(list3);
View view2 = HomePageFragment.this.getView();
if (((RecyclerView) (view2 == null ? null : view2.findViewById(R$id.rv_list))) == null) {
return;
}
HomePageFragment homePageFragment4 = HomePageFragment.this;
View view3 = homePageFragment4.getView();
if (((RecyclerView) (view3 == null ? null : view3.findViewById(R$id.rv_list))).getAdapter() == null) {
if (!(baseCategoryModel2 instanceof HomeVideoModel)) {
if (baseCategoryModel2 instanceof HomeNormalModel) {
String playlist = ((HomeNormalModel) baseCategoryModel2).getPlaylist();
}
}
z2 = true;
homePageFragment4.f15839p = z2;
homePageFragment3 = HomePageFragment.this;
if (homePageFragment3.f15839p) {
View view4 = homePageFragment3.getView();
((LoadingLayout) (view4 == null ? null : view4.findViewById(R$id.loading_layout))).i();
} else {
View view5 = homePageFragment3.getView();
View findViewById = view5 == null ? null : view5.findViewById(R$id.rv_list);
h.d(findViewById, "rv_list");
n0.b(findViewById, false);
}
view = HomePageFragment.this.getView();
if (((RecyclerView) (view != null ? null : view.findViewById(R$id.rv_list))).getAdapter() != null) {
View view6 = HomePageFragment.this.getView();
((RecyclerView) (view6 == null ? null : view6.findViewById(R$id.rv_list))).setAdapter(new HomePageFragment.ModeAdapter(HomePageFragment.this, homePageModel.getList()));
} else {
View view7 = HomePageFragment.this.getView();
RecyclerView.Adapter adapter = ((RecyclerView) (view7 == null ? null : view7.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.godfootsteps.home.HomePageFragment.ModeAdapter");
HomePageFragment.ModeAdapter modeAdapter = (HomePageFragment.ModeAdapter) adapter;
List<BaseCategoryModel> list4 = homePageModel.getList();
h.e(list4, "<set-?>");
modeAdapter.a = list4;
modeAdapter.notifyDataSetChanged();
}
HomePageFragment homePageFragment5 = HomePageFragment.this;
list = homePageModel.getList();
Objects.requireNonNull(homePageFragment5);
if (!(list != null || list.isEmpty())) {
if (h.a(homePageFragment5.f15834k, "listen")) {
ArrayList arrayList = new ArrayList();
for (Object obj2 : list) {
if (h.a(((BaseCategoryModel) obj2).getCategory(), "Reveals")) {
arrayList.add(obj2);
}
}
} else if (h.a(homePageFragment5.f15834k, "simplify")) {
ArrayList arrayList2 = new ArrayList();
for (Object obj3 : list) {
if (h.a(((BaseCategoryModel) obj3).getCategory(), "Video")) {
arrayList2.add(obj3);
}
}
}
}
if (z3 || homePageModel.getList() == null) {
}
View view8 = HomePageFragment.this.getView();
((RecyclerView) (view8 != null ? view8.findViewById(R$id.rv_list) : null)).setItemViewCacheSize(homePageModel.getList().size());
return;
}
z2 = false;
homePageFragment4.f15839p = z2;
homePageFragment3 = HomePageFragment.this;
if (homePageFragment3.f15839p) {
}
view = HomePageFragment.this.getView();
if (((RecyclerView) (view != null ? null : view.findViewById(R$id.rv_list))).getAdapter() != null) {
}
HomePageFragment homePageFragment52 = HomePageFragment.this;
list = homePageModel.getList();
Objects.requireNonNull(homePageFragment52);
if (!(list != null || list.isEmpty())) {
}
if (z3) {
}
}
};
final HomePageFragment homePageFragment3 = HomePageFragment.this;
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");
HomePageFragment homePageFragment4 = HomePageFragment.this;
homePageFragment4.f15837n = 0L;
HomePageFragment.I(homePageFragment4);
}
};
}
});
}
}
@Override
public void onConfigurationChanged(Configuration configuration) {
h.e(configuration, "newConfig");
super.onConfigurationChanged(configuration);
if (this.f15840q == e.c0.a.R()) {
if (v.i()) {
View view = getView();
RecyclerView.Adapter adapter = ((RecyclerView) (view == null ? null : view.findViewById(R$id.rv_list))).getAdapter();
if (adapter == null) {
return;
}
adapter.notifyDataSetChanged();
return;
}
return;
}
this.f15840q = e.c0.a.R();
}
@Override
public void onResume() {
super.onResume();
if (this.f15836m) {
return;
}
J(false);
}
}