CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 ThumbnailVH.java 源代码,内容仅作参考
package org.godfootsteps.home.viewholder;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import d.c.a.j.v;
import d.c.a.j.z;
import d.c.i.f;
import i.c.a.c.a0;
import i.c.a.c.n0;
import i.c.a.c.y;
import i.j.a.e.t.d;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.collections.EmptyList;
import n.e;
import n.f.g;
import n.i.a.a;
import n.i.a.l;
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.BaseCategoryModel;
import org.godfootsteps.arch.api.model.HomeNormalModel;
import org.godfootsteps.arch.customSystemViews.CustomThumbnailView;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.arch.videoApi.VideoClient;
import org.godfootsteps.arch.view.MyRecyclerView;
import org.godfootsteps.home.GospelWitnessListActivity;
import org.godfootsteps.home.MultipleListActivity;
import org.godfootsteps.home.NewsListActivity;
import org.godfootsteps.home.R$drawable;
import org.godfootsteps.home.R$id;
import org.godfootsteps.home.R$layout;
import org.godfootsteps.home.viewholder.ThumbnailVH;
import org.godfootsteps.router.model.PlaylistData;
import org.godfootsteps.router.model.Video;
@Metadata(d1 = {"\u0000^\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010 \n\u0002\b\u0006\b\u0016\u0018\u0000 E2\u00020\u0001:\u0002EFB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J6\u0010'\u001a\u00020\u001c2\b\u0010(\u001a\u0004\u0018\u00010)2\b\u0010*\u001a\u0004\u0018\u00010\u00062\u0006\u0010+\u001a\u00020,2\u0006\u0010-\u001a\u00020\u00062\b\b\u0002\u0010.\u001a\u00020/H\u0014J(\u00100\u001a\u00020\u001c2\u0006\u0010(\u001a\u00020)2\u0006\u00101\u001a\u00020,2\u0006\u0010-\u001a\u00020\u00062\u0006\u0010.\u001a\u00020/H\u0014J\u0019\u00102\u001a\u0004\u0018\u0001032\b\u00101\u001a\u0004\u0018\u00010,H\u0014¢\u0006\u0002\u00104J\u000e\u00105\u001a\u0002032\u0006\u0010.\u001a\u00020/J\b\u00106\u001a\u000203H\u0014J\u0012\u00107\u001a\u00020\u001c2\b\u00108\u001a\u0004\u0018\u000109H\u0016J\u0010\u0010:\u001a\u00020\u001c2\u0006\u0010;\u001a\u00020<H\u0014J\u0012\u0010=\u001a\u00020\u001c2\b\u00108\u001a\u0004\u0018\u000109H\u0014J4\u0010>\u001a\u00020\u001c2\b\u0010*\u001a\u0004\u0018\u00010\u00062\b\u0010?\u001a\u0004\u0018\u00010\u00062\f\u0010@\u001a\b\u0012\u0004\u0012\u00020,0A2\b\b\u0002\u0010B\u001a\u00020/H\u0002J\u0018\u0010C\u001a\u0004\u0018\u00010\u0006*\u00020\u00062\b\b\u0002\u0010D\u001a\u00020/H\u0004R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001a\u0010\u000b\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\b\"\u0004\b\r\u0010\nR\u001a\u0010\u000e\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000f\u0010\b\"\u0004\b\u0010\u0010\nR\u001a\u0010\u0011\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0012\u0010\b\"\u0004\b\u0013\u0010\nR\u001a\u0010\u0014\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0015\u0010\b\"\u0004\b\u0016\u0010\nR\u001a\u0010\u0017\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0018\u0010\b\"\u0004\b\u0019\u0010\nR\"\u0010\u001a\u001a\n\u0012\u0004\u0012\u00020\u001c\u0018\u00010\u001bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 R\u001a\u0010!\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\"\u0010\b\"\u0004\b#\u0010\nR\u001a\u0010$\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b%\u0010\b\"\u0004\b&\u0010\n¨\u0006G"}, d2 = {"Lorg/godfootsteps/home/viewholder/ThumbnailVH;", "Lorg/godfootsteps/home/viewholder/BaseHomeViewHolder;", "itemView", "Landroid/view/View;", "(Landroid/view/View;)V", "article", "", "getArticle", "()Ljava/lang/String;", "setArticle", "(Ljava/lang/String;)V", "categoryTitle", "getCategoryTitle", "setCategoryTitle", "cssUrl", "getCssUrl", "setCssUrl", "gospelTruthImageURL", "getGospelTruthImageURL", "setGospelTruthImageURL", "imageBaseUrl", "getImageBaseUrl", "setImageBaseUrl", "imageUrl", "getImageUrl", "setImageUrl", "loadFinishListener", "Lkotlin/Function0;", "", "getLoadFinishListener", "()Lkotlin/jvm/functions/Function0;", "setLoadFinishListener", "(Lkotlin/jvm/functions/Function0;)V", "pokeUrl", "getPokeUrl", "setPokeUrl", "turnURL", "getTurnURL", "setTurnURL", "bindItem", "holder", "Lorg/commons/screenadapt/recyclerview/ScreenViewHolder;", "category", "item", "Lorg/godfootsteps/arch/api/model/HomeNormalModel$ListBean;", "listId", "isHeader", "", "bindVideoHeader", "headItem", "getHeadItemLayoutId", "", "(Lorg/godfootsteps/arch/api/model/HomeNormalModel$ListBean;)Ljava/lang/Integer;", "getImageWidth", "getItemLayoutId", "onBind", "model", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "setItemData", "dataModel", "Lorg/godfootsteps/arch/api/model/HomeNormalModel;", "setUpRVLayoutManager", "setVideoDataAndArticleData", "playlist", "articleList", "", "needHead", "choosePicDpi", "isHead", "Companion", "ThumbnailAdapter", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public class ThumbnailVH extends BaseHomeViewHolder {
public static final ThumbnailVH f15908s = null;
public static Map<String, PlaylistData> f15909t = new LinkedHashMap();
public a<e> f15910k;
public String f15911l;
public String f15912m;
public String f15913n;
public String f15914o;
public String f15915p;
public String f15916q;
public String f15917r;
@Metadata(d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\b\u0086\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u000f\u0010\f\u001a\u0004\u0018\u00010\rH\u0014¢\u0006\u0002\u0010\u000eJ\b\u0010\u000f\u001a\u00020\rH\u0014J\u001a\u0010\u0010\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u00132\u0006\u0010\u0014\u001a\u00020\u0002H\u0014J\u0010\u0010\u0015\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0013H\u0014J\u0018\u0010\u0016\u001a\u00020\u00132\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\rH\u0016JB\u0010\u001a\u001a\u00020\u00112\b\u0010\u0004\u001a\u0004\u0018\u00010\u00052\b\u0010\u000b\u001a\u0004\u0018\u00010\u00052\u000e\u0010\u001b\u001a\n\u0012\u0004\u0012\u00020\u001d\u0018\u00010\u001c2\f\u0010\u001e\u001a\b\u0012\u0004\u0012\u00020\u00020\u001c2\b\b\u0002\u0010\u001f\u001a\u00020 R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010\u0006\u001a\u0004\u0018\u00010\u0002X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u0010\u0010\u000b\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006!"}, d2 = {"Lorg/godfootsteps/home/viewholder/ThumbnailVH$ThumbnailAdapter;", "Lorg/commons/screenadapt/recyclerview/FastScreenListAdapter;", "Lorg/godfootsteps/arch/api/model/HomeNormalModel$ListBean;", "(Lorg/godfootsteps/home/viewholder/ThumbnailVH;)V", "category", "", "headItem", "getHeadItem", "()Lorg/godfootsteps/arch/api/model/HomeNormalModel$ListBean;", "setHeadItem", "(Lorg/godfootsteps/arch/api/model/HomeNormalModel$ListBean;)V", "listId", "getHeaderLayoutId", "", "()Ljava/lang/Integer;", "getLayoutId", "onBind", "", "holder", "Lorg/commons/screenadapt/recyclerview/ScreenViewHolder;", "item", "onBindHeader", "onCreateViewHolder", "parent", "Landroid/view/ViewGroup;", "viewType", "setData", "videoList", "", "Lorg/godfootsteps/router/model/Video;", "dataList", "needHead", "", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ThumbnailAdapter extends FastScreenListAdapter<HomeNormalModel.ListBean> {
public String b;
public String c;
public HomeNormalModel.ListBean f15918d;
public final ThumbnailVH f15919e;
public ThumbnailAdapter(ThumbnailVH thumbnailVH) {
super(null, 1);
h.e(thumbnailVH, "this$0");
this.f15919e = thumbnailVH;
this.c = "";
}
@Override
public Integer f() {
return this.f15919e.e(this.f15918d);
}
@Override
public int g() {
return this.f15919e.g();
}
@Override
public void i(ScreenViewHolder screenViewHolder, HomeNormalModel.ListBean listBean) {
View view;
HomeNormalModel.ListBean listBean2 = listBean;
h.e(listBean2, "item");
if (screenViewHolder == null || (view = screenViewHolder.itemView) == null) {
return;
}
ThumbnailVH thumbnailVH = this.f15919e;
String str = this.c;
String str2 = this.b;
if (str2 == null) {
str2 = "";
}
thumbnailVH.c(screenViewHolder, str, listBean2, str2, screenViewHolder.getLayoutPosition() == 0);
TextView textView = (TextView) view.findViewById(R$id.tv_title);
if (textView == null) {
return;
}
textView.setText(listBean2.getTitle());
}
@Override
public void j(ScreenViewHolder screenViewHolder) {
h.e(screenViewHolder, "holder");
HomeNormalModel.ListBean listBean = this.f15918d;
if (listBean != null) {
h.c(listBean);
String videoId = listBean.getVideoId();
if (videoId == null || videoId.length() == 0) {
View view = screenViewHolder.itemView;
ThumbnailVH thumbnailVH = this.f15919e;
TextView textView = (TextView) view.findViewById(R$id.tv_summary);
if (textView != null) {
HomeNormalModel.ListBean listBean2 = this.f15918d;
h.c(listBean2);
textView.setText(listBean2.getContent());
}
HomeNormalModel.ListBean listBean3 = this.f15918d;
h.c(listBean3);
((TextView) view.findViewById(R$id.tv_title)).setText(listBean3.getTitle());
String str = this.c;
HomeNormalModel.ListBean listBean4 = this.f15918d;
h.c(listBean4);
String str2 = this.b;
thumbnailVH.c(screenViewHolder, str, listBean4, str2 == null ? "" : str2, true);
return;
}
ThumbnailVH thumbnailVH2 = this.f15919e;
HomeNormalModel.ListBean listBean5 = this.f15918d;
h.c(listBean5);
String str3 = this.b;
thumbnailVH2.d(screenViewHolder, listBean5, str3 != null ? str3 : "", true);
}
}
@Override
public ScreenViewHolder onCreateViewHolder(ViewGroup viewGroup, int i2) {
h.e(viewGroup, "parent");
ScreenViewHolder onCreateViewHolder = super.onCreateViewHolder(viewGroup, i2);
if (v.j() && i2 == 0) {
View view = onCreateViewHolder.itemView;
h.d(view, "vh.itemView");
n0.p(view, y.E(14.0f));
}
return onCreateViewHolder;
}
public final void l(String str, String str2, List<? extends Video> list, List<HomeNormalModel.ListBean> list2, boolean z) {
List arrayList;
String thumbnailURL;
String str3;
int parseInt;
h.e(list2, "dataList");
this.c = str;
this.b = str2;
HomeNormalModel.ListBean listBean = null;
if (list == null) {
arrayList = null;
} else {
arrayList = new ArrayList(d.S(list, 10));
int i2 = 0;
for (Object obj : list) {
int i3 = i2 + 1;
if (i2 >= 0) {
Video video = (Video) obj;
HomeNormalModel.ListBean listBean2 = new HomeNormalModel.ListBean();
String id = video.getId();
h.d(id, "video.id");
listBean2.setVideoId(id);
if (i2 == 0) {
thumbnailURL = video.getHqThumbnailURL();
str3 = "video.hqThumbnailURL";
} else {
thumbnailURL = video.getThumbnailURL();
str3 = "video.thumbnailURL";
}
h.d(thumbnailURL, str3);
listBean2.setImage(thumbnailURL);
String description = video.getDescription();
listBean2.setContent(description != null ? n.o.a.w(n.o.a.w(description, h.j(video.getTitle(), "\n"), "", false, 4), "\n", "", false, 4) : "");
String duration = video.getDuration();
h.d(duration, "video.duration");
h.e(duration, "<this>");
List A = n.o.a.A(duration, new String[]{":"}, false, 0, 6);
int size = A.size();
if (size != 2) {
parseInt = size != 3 ? 0 : Integer.parseInt((String) A.get(2)) + (Integer.parseInt((String) A.get(1)) * 60) + (Integer.parseInt((String) A.get(0)) * 3600);
} else {
parseInt = Integer.parseInt((String) A.get(1)) + (Integer.parseInt((String) A.get(0)) * 60);
}
listBean2.setDuration(parseInt);
String title = video.getTitle();
h.d(title, "video.title");
listBean2.setTitle(title);
listBean2.setType("video");
arrayList.add(listBean2);
i2 = i3;
} else {
g.X();
throw null;
}
}
}
if (arrayList == null) {
arrayList = EmptyList.INSTANCE;
}
ArrayList arrayList2 = new ArrayList();
int i4 = v.i() ? 7 : 5;
int i5 = i4 - 1;
if (list2.size() >= i5) {
if (!arrayList.isEmpty()) {
arrayList2.add(arrayList.get(0));
arrayList2.addAll(g.W(list2, i5));
} else {
arrayList2.addAll(g.W(list2, i4));
}
} else {
if (arrayList.size() > i4 - list2.size()) {
arrayList2.addAll(g.W(arrayList, i4 - list2.size()));
} else {
arrayList2.addAll(arrayList);
}
arrayList2.addAll(list2);
}
if ((true ^ arrayList2.isEmpty()) && z) {
listBean = (HomeNormalModel.ListBean) arrayList2.remove(0);
}
this.f15918d = listBean;
this.a = arrayList2;
notifyDataSetChanged();
}
}
public ThumbnailVH(View view) {
super(view);
h.e(view, "itemView");
this.f15911l = "";
this.f15912m = "";
this.f15913n = "";
this.f15914o = "";
this.f15915p = "";
this.f15916q = "";
this.f15917r = "";
}
@Override
public void b(final BaseCategoryModel baseCategoryModel) {
if (v.i()) {
i(baseCategoryModel);
}
View view = this.f15173i;
((MyRecyclerView) (view == null ? null : view.findViewById(R$id.rv_list))).setAdapter(new ThumbnailAdapter(this));
if (baseCategoryModel == null) {
return;
}
HomeNormalModel homeNormalModel = (HomeNormalModel) baseCategoryModel;
View view2 = this.f15173i;
TextView textView = (TextView) (view2 == null ? null : view2.findViewById(R$id.tv_mode_title));
String title = homeNormalModel.getTitle();
if (h.a("soul", this.f15876j)) {
title = null;
}
if (title == null) {
title = homeNormalModel.getTag();
}
textView.setText(title);
String title2 = homeNormalModel.getTitle();
if (h.a("soul", this.f15876j)) {
title2 = null;
}
if (title2 == null) {
title2 = homeNormalModel.getTag();
}
h.e(title2, "<set-?>");
this.f15917r = title2;
h(homeNormalModel);
View view3 = this.f15173i;
((TextView) (view3 != null ? view3.findViewById(R$id.tv_read_more) : null)).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
String str;
ThumbnailVH thumbnailVH;
BaseCategoryModel baseCategoryModel2 = BaseCategoryModel.this;
ThumbnailVH thumbnailVH2 = this;
BaseCategoryModel baseCategoryModel3 = baseCategoryModel;
ThumbnailVH thumbnailVH3 = ThumbnailVH.f15908s;
n.i.b.h.e(baseCategoryModel2, "$this_apply");
n.i.b.h.e(thumbnailVH2, "this$0");
HomeNormalModel homeNormalModel2 = (HomeNormalModel) baseCategoryModel2;
if (n.i.b.h.a("Poke", homeNormalModel2.getCategory())) {
str = "cssUrl";
thumbnailVH = thumbnailVH2;
} else if (!n.i.b.h.a("Return", homeNormalModel2.getCategory())) {
if (!n.i.b.h.a("Life", homeNormalModel2.getCategory()) && !n.i.b.h.a("Winner", homeNormalModel2.getCategory()) && !n.i.b.h.a("Wonderful", homeNormalModel2.getCategory()) && !n.i.b.h.a("Rescue", homeNormalModel2.getCategory()) && !n.i.b.h.a("soul", thumbnailVH2.f15876j) && !n.i.b.h.a("Sermon", homeNormalModel2.getCategory())) {
if (n.i.b.h.a(thumbnailVH2.f15876j, "news")) {
View view5 = thumbnailVH2.f15173i;
String obj = ((TextView) (view5 != null ? view5.findViewById(R$id.tv_mode_title) : null)).getText().toString();
String type = baseCategoryModel3.getType();
n.i.b.h.d(type, "model.type");
NewsListActivity.c0(obj, type);
}
thumbnailVH = thumbnailVH2;
} else {
GospelWitnessListActivity.a aVar = GospelWitnessListActivity.f15810v;
View view6 = thumbnailVH2.f15173i;
String obj2 = ((TextView) (view6 != null ? view6.findViewById(R$id.tv_mode_title) : null)).getText().toString();
String str2 = thumbnailVH2.f15876j;
String category = homeNormalModel2.getCategory();
String tag = homeNormalModel2.getTag();
String playlist = homeNormalModel2.getPlaylist();
boolean isHasVideoData = homeNormalModel2.isHasVideoData();
String str3 = thumbnailVH2.f15911l;
String str4 = thumbnailVH2.f15914o;
ArrayList arrayList = (ArrayList) homeNormalModel2.getList();
n.i.b.h.e(tag, "tag");
n.i.b.h.e(arrayList, "dataList");
n.i.b.h.e("Youtube", "videoPlatform");
ArrayList<? extends Parcelable> arrayList2 = new ArrayList<>();
arrayList2.addAll(arrayList);
Bundle bundle = new Bundle();
bundle.putString("title", obj2);
bundle.putString("mode", str2);
bundle.putString("category", category);
bundle.putString("tag", tag);
bundle.putString("playlist", playlist);
bundle.putBoolean("hasVideoData", isHasVideoData);
bundle.putString("imageUrl", str3);
bundle.putString("articleUrl", str4);
bundle.putString("cssUrl", "");
bundle.putParcelableArrayList("dataList", arrayList2);
bundle.putString("videoPlatform", "Youtube");
e.c0.a.j0(bundle, GospelWitnessListActivity.class);
thumbnailVH = thumbnailVH2;
}
GAEventSendUtil.a.n(thumbnailVH.f15917r);
} else {
thumbnailVH = thumbnailVH2;
str = "cssUrl";
}
View view7 = thumbnailVH.f15173i;
String obj3 = ((TextView) (view7 != null ? view7.findViewById(R$id.tv_mode_title) : null)).getText().toString();
String category2 = homeNormalModel2.getCategory();
n.i.b.h.d(category2, "category");
String str5 = thumbnailVH.f15876j;
n.i.b.h.e(obj3, "title");
n.i.b.h.e(category2, "category");
n.i.b.h.e(str5, "mode");
n.i.b.h.e("", str);
Bundle bundle2 = new Bundle();
bundle2.putString("title", obj3);
bundle2.putString("category", category2);
bundle2.putString("mode", str5);
bundle2.putString(str, "");
e.c0.a.j0(bundle2, MultipleListActivity.class);
GAEventSendUtil.a.n(thumbnailVH.f15917r);
}
});
}
public void c(ScreenViewHolder screenViewHolder, final String str, final HomeNormalModel.ListBean listBean, final String str2, boolean z) {
h.e(listBean, "item");
h.e(str2, "listId");
int f2 = f(z);
String str3 = (!h.a("gospel", this.f15876j) || h.a(str, "Sermon")) ? this.f15911l : this.f15913n;
String videoId = listBean.getVideoId();
if (videoId == null || videoId.length() == 0) {
View view = screenViewHolder.f15173i;
CustomThumbnailView customThumbnailView = (CustomThumbnailView) (view != null ? view.findViewById(R$id.iv_thumbnail) : null);
if (customThumbnailView != null) {
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(str3);
sb.append("ld/");
sb.append(listBean.getImage());
String sb2 = sb.toString();
h.e(sb2, "<this>");
customThumbnailView.e(z ? n.o.a.w(sb2, "/ld/", "/hd/", false, 4) : sb2, R$drawable.ic_placeholder_16_9, f2, (f2 * 9) / 16, true);
customThumbnailView.setDuration("");
}
} else {
View view2 = screenViewHolder.f15173i;
CustomThumbnailView customThumbnailView2 = (CustomThumbnailView) (view2 != null ? view2.findViewById(R$id.iv_thumbnail) : null);
if (customThumbnailView2 != null) {
customThumbnailView2.e(listBean.getImage(), R$drawable.ic_video_default, (r14 & 4) != 0 ? -1 : f2, (r14 & 8) != 0 ? -1 : (f2 * 9) / 16, (r14 & 16) != 0 ? false : false);
customThumbnailView2.setDuration(z.c(listBean.getDuration()));
}
}
View view3 = screenViewHolder.itemView;
if (view3 == null) {
return;
}
view3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
String str4;
HomeNormalModel.ListBean listBean2 = HomeNormalModel.ListBean.this;
String str5 = str;
ThumbnailVH thumbnailVH = this;
String str6 = str2;
ThumbnailVH thumbnailVH2 = ThumbnailVH.f15908s;
n.i.b.h.e(listBean2, "$item");
n.i.b.h.e(thumbnailVH, "this$0");
n.i.b.h.e(str6, "$listId");
String videoId2 = listBean2.getVideoId();
boolean z2 = false;
if (videoId2 == null || videoId2.length() == 0) {
String bookId = listBean2.getBookId();
if (!(bookId == null || bookId.length() == 0)) {
String chapterId = listBean2.getChapterId();
if (!(chapterId == null || chapterId.length() == 0)) {
d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar != null) {
cVar.e(listBean2.getBookId(), listBean2.getChapterId(), listBean2.getShare());
}
}
}
String str7 = null;
if (!n.i.b.h.a("Poke", str5) && !n.i.b.h.a("Return", str5)) {
String str8 = thumbnailVH.f15914o;
if (!(str8 == null || str8.length() == 0)) {
str7 = thumbnailVH.f15914o;
}
}
if (str7 == null || str7.length() == 0) {
String str9 = thumbnailVH.f15915p;
if (!((str9 == null || str9.length() == 0) ? true : true)) {
str4 = thumbnailVH.f15915p;
} else {
str4 = thumbnailVH.f15916q;
}
str7 = str4;
}
d.c.i.c cVar2 = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar2 != null) {
StringBuilder sb3 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb3.append("https://appservercn.kingdomsalvation.org");
sb3.append((Object) str7);
sb3.append(listBean2.getName());
cVar2.k(sb3.toString(), listBean2.getId(), thumbnailVH.f15876j, "", listBean2.getShare());
}
} else {
d.c.i.f fVar = (d.c.i.f) k.a.a.a.a.b(d.c.i.f.class);
if (fVar != null) {
d.c.a.m.a.s0(fVar, listBean2.getVideoId(), str6, null, 4, null);
}
}
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
String str10 = thumbnailVH.f15917r;
String title = listBean2.getTitle();
if (title == null) {
title = "";
}
companion.l(str10, title);
}
});
}
public void d(ScreenViewHolder screenViewHolder, final HomeNormalModel.ListBean listBean, final String str, boolean z) {
h.e(screenViewHolder, "holder");
h.e(listBean, "headItem");
h.e(str, "listId");
final int f2 = f(true);
View view = screenViewHolder.itemView;
TextView textView = (TextView) view.findViewById(R$id.tv_title);
TextView textView2 = (TextView) view.findViewById(R$id.tv_summary);
textView.setText(listBean.getTitle());
String w2 = n.o.a.w(n.o.a.w(listBean.getContent(), h.j(listBean.getTitle(), "\n"), "", false, 4), "\n", "", false, 4);
if (w2.length() == 0) {
textView.setMaxLines(4);
if (textView2 != null) {
n0.c(textView2, false, 1);
}
} else {
textView.setMaxLines(2);
if (textView2 != null) {
textView2.setText(w2);
}
if (textView2 != null) {
n0.t(textView2);
}
}
TextView textView3 = (TextView) view.findViewById(R$id.tv_publish_date);
if (textView3 != null) {
textView3.setText(z.b(listBean.getDate()));
}
final CustomThumbnailView customThumbnailView = (CustomThumbnailView) view.findViewById(R$id.iv_thumbnail);
customThumbnailView.setDuration(z.c(listBean.getDuration()));
VideoClient.a.a(listBean.getVideoId(), new l<String, e>() {
{
super(1);
}
@Override
public e invoke(String str2) {
invoke2(str2);
return e.a;
}
public final void invoke2(String str2) {
h.e(str2, "url");
CustomThumbnailView customThumbnailView2 = CustomThumbnailView.this;
h.d(customThumbnailView2, "");
int i2 = R$drawable.ic_video_default;
int i3 = f2;
customThumbnailView2.e(str2, i2, (r14 & 4) != 0 ? -1 : i3, (r14 & 8) != 0 ? -1 : (i3 * 9) / 16, (r14 & 16) != 0 ? false : false);
}
}, true);
view.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
HomeNormalModel.ListBean listBean2 = HomeNormalModel.ListBean.this;
String str2 = str;
ThumbnailVH thumbnailVH = this;
ThumbnailVH thumbnailVH2 = ThumbnailVH.f15908s;
n.i.b.h.e(listBean2, "$headItem");
n.i.b.h.e(str2, "$listId");
n.i.b.h.e(thumbnailVH, "this$0");
d.c.i.f fVar = (d.c.i.f) k.a.a.a.a.b(d.c.i.f.class);
if (fVar != null) {
String videoId = listBean2.getVideoId();
if (videoId == null) {
videoId = "";
}
d.c.a.m.a.s0(fVar, videoId, str2, null, 4, null);
}
GAEventSendUtil.a.o(thumbnailVH.f15917r, listBean2.getTitle());
}
});
}
public Integer e(HomeNormalModel.ListBean listBean) {
if (listBean != null) {
return Integer.valueOf(v.i() ? R$layout.item_video_pad : R$layout.item_video_tb);
}
return null;
}
public final int f(boolean z) {
if (z) {
return v.i() ? (int) ((y.L() - y.E(72.0f)) * 0.42d) : y.L();
}
return (int) ((v.i() ? (y.L() - y.E(72.0f)) / 2 : y.L()) * 0.42f);
}
public int g() {
return R$layout.item_thumbnail_title;
}
public void h(final HomeNormalModel homeNormalModel) {
h.e(homeNormalModel, "dataModel");
final ArrayList arrayList = new ArrayList();
arrayList.addAll(homeNormalModel.getList());
homeNormalModel.setHasVideoData(false);
String playlist = homeNormalModel.getPlaylist();
if (!(playlist == null || playlist.length() == 0)) {
if (f15909t.get(homeNormalModel.getPlaylist()) == null) {
Map<String, PlaylistData> map = f15909t;
String playlist2 = homeNormalModel.getPlaylist();
PlaylistData playlistData = new PlaylistData();
playlistData.setId(homeNormalModel.getPlaylist());
playlistData.setNumVideo(1);
Video video = new Video();
video.setId("temp");
video.setDescription("");
video.setThumbnailURL("");
video.setHqThumbnailURL("");
video.setTitle("");
video.setDuration("0:0");
playlistData.setVideos(d.r3(video));
map.put(playlist2, playlistData);
f fVar = (f) k.a.a.a.a.b(f.class);
if (fVar != null) {
fVar.f(homeNormalModel.getPlaylist(), new l<PlaylistData, e>() {
{
super(1);
}
@Override
public e invoke(PlaylistData playlistData2) {
invoke2(playlistData2);
return e.a;
}
public final void invoke2(PlaylistData playlistData2) {
h.e(playlistData2, "it");
ThumbnailVH thumbnailVH = ThumbnailVH.f15908s;
ThumbnailVH.f15909t.put(HomeNormalModel.this.getPlaylist(), playlistData2);
this.j(homeNormalModel.getCategory(), HomeNormalModel.this.getPlaylist(), arrayList, true);
HomeNormalModel.this.setHasVideoData(playlistData2.getVideos().size() > 0);
final ThumbnailVH thumbnailVH2 = this;
a0.a.postDelayed(new Runnable() {
@Override
public final void run() {
ThumbnailVH thumbnailVH3 = ThumbnailVH.this;
n.i.b.h.e(thumbnailVH3, "this$0");
n.i.a.a<n.e> aVar = thumbnailVH3.f15910k;
if (aVar == null) {
return;
}
aVar.invoke();
}
}, 200L);
}
}, new l<Integer, e>() {
{
super(1);
}
@Override
public e invoke(Integer num) {
invoke(num.intValue());
return e.a;
}
public final void invoke(int i2) {
ThumbnailVH thumbnailVH = ThumbnailVH.f15908s;
ThumbnailVH.f15909t.put(HomeNormalModel.this.getPlaylist(), new PlaylistData());
this.j(homeNormalModel.getCategory(), HomeNormalModel.this.getPlaylist(), arrayList, true);
HomeNormalModel.this.setHasVideoData(false);
final ThumbnailVH thumbnailVH2 = this;
a0.a.postDelayed(new Runnable() {
@Override
public final void run() {
ThumbnailVH thumbnailVH3 = ThumbnailVH.this;
n.i.b.h.e(thumbnailVH3, "this$0");
n.i.a.a<n.e> aVar = thumbnailVH3.f15910k;
if (aVar == null) {
return;
}
aVar.invoke();
}
}, 200L);
}
}, "");
}
} else {
PlaylistData playlistData2 = f15909t.get(homeNormalModel.getPlaylist());
h.c(playlistData2);
List<Video> videos = playlistData2.getVideos();
homeNormalModel.setHasVideoData((videos == null ? 0 : videos.size()) > 0);
a0.a.postDelayed(new Runnable() {
@Override
public final void run() {
ThumbnailVH thumbnailVH = ThumbnailVH.this;
ThumbnailVH thumbnailVH2 = ThumbnailVH.f15908s;
n.i.b.h.e(thumbnailVH, "this$0");
n.i.a.a<n.e> aVar = thumbnailVH.f15910k;
if (aVar == null) {
return;
}
aVar.invoke();
}
}, 200L);
}
}
j(homeNormalModel.getCategory(), homeNormalModel.getPlaylist(), arrayList, false);
}
public void i(BaseCategoryModel baseCategoryModel) {
View view = this.f15173i;
RecyclerView.n layoutManager = ((MyRecyclerView) (view == null ? null : view.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager).s(2);
if (h.a("soul", this.f15876j)) {
final boolean z = true;
if (getLayoutPosition() % 3 != 0 && getLayoutPosition() % 3 != 1) {
z = false;
}
View view2 = this.f15173i;
RecyclerView.n layoutManager2 = ((MyRecyclerView) (view2 != null ? view2.findViewById(R$id.rv_list) : null)).getLayoutManager();
Objects.requireNonNull(layoutManager2, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager2).f1424o = new GridLayoutManager.a() {
@Override
public int c(int i2) {
return (z && i2 == 0) ? 2 : 1;
}
};
return;
}
View view3 = this.f15173i;
RecyclerView.n layoutManager3 = ((MyRecyclerView) (view3 != null ? view3.findViewById(R$id.rv_list) : null)).getLayoutManager();
Objects.requireNonNull(layoutManager3, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager3).f1424o = new GridLayoutManager.a() {
@Override
public int c(int i2) {
return i2 == 0 ? 2 : 1;
}
};
}
public final void j(String str, String str2, List<HomeNormalModel.ListBean> list, boolean z) {
boolean z2;
int i2 = 5;
boolean z3 = true;
if (!h.a("witness", this.f15876j) && !h.a("Poke", str)) {
z3 = (h.a("soul", this.f15876j) && v.i() && getLayoutPosition() % 3 < 2) ? false : false;
r13.intValue();
r13 = v.j() ? 3 : null;
if (r13 == null) {
if (getLayoutPosition() % 3 == 2) {
i2 = 6;
}
} else {
i2 = r13.intValue();
}
z2 = z3;
} else {
r13.intValue();
r13 = v.j() ? 5 : null;
i2 = r13 == null ? 7 : r13.intValue();
z2 = true;
}
View view = this.f15173i;
RecyclerView.Adapter adapter = ((MyRecyclerView) (view == null ? null : view.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.godfootsteps.home.viewholder.ThumbnailVH.ThumbnailAdapter");
ThumbnailAdapter thumbnailAdapter = (ThumbnailAdapter) adapter;
PlaylistData playlistData = f15909t.get(str2);
thumbnailAdapter.l(str, str2, playlistData != null ? playlistData.getVideos() : null, g.W(list, i2), z2);
}
}