CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 ListWithHeaderVH.java 源代码,内容仅作参考
package org.godfootsteps.home.viewholder;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import carbon.custom.AutoEllipsizeView;
import com.google.android.gms.measurement.api.AppMeasurementSdk;
import d.c.a.j.v;
import d.c.i.f;
import i.c.a.c.n0;
import i.c.a.c.y;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
import kotlin.Metadata;
import kotlin.collections.EmptyList;
import n.e;
import n.f.g;
import n.i.a.l;
import n.i.b.h;
import n.o.a;
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.HomeThreeTruthsData;
import org.godfootsteps.arch.customSystemViews.CustomThumbnailView;
import org.godfootsteps.arch.util.GAEventSendUtil;
import org.godfootsteps.arch.view.MyRecyclerView;
import org.godfootsteps.home.GospelTrueListActivity;
import org.godfootsteps.home.R$drawable;
import org.godfootsteps.home.R$id;
import org.godfootsteps.home.R$layout;
import org.godfootsteps.home.viewholder.ListWithHeaderVH;
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\u000e\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \u00182\u00020\u0001:\u0002\u0018\u0019B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0014\u001a\u00020\u00152\b\u0010\u0016\u001a\u0004\u0018\u00010\u0017H\u0016R\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\n¨\u0006\u001a"}, d2 = {"Lorg/godfootsteps/home/viewholder/ListWithHeaderVH;", "Lorg/godfootsteps/home/viewholder/BaseHomeViewHolder;", "itemView", "Landroid/view/View;", "(Landroid/view/View;)V", "category", "", "getCategory", "()Ljava/lang/String;", "setCategory", "(Ljava/lang/String;)V", "categoryTitle", "getCategoryTitle", "setCategoryTitle", "gospelTruthImageURL", "getGospelTruthImageURL", "setGospelTruthImageURL", "platform", "getPlatform", "setPlatform", "onBind", "", "model", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "Companion", "ThreeTruthsAdapter", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ListWithHeaderVH extends BaseHomeViewHolder {
public static final int f15890n = 0;
public String f15891k;
public String f15892l;
public String f15893m;
@Metadata(d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J \u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u0011H\u0002J\u000f\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0014¢\u0006\u0002\u0010\u0014J\b\u0010\u0015\u001a\u00020\u0013H\u0014J&\u0010\u0016\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u0018J \u0010\u001a\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u001b2\u0006\u0010\u0010\u001a\u00020\u0011H\u0002J\u001a\u0010\u001c\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\r2\u0006\u0010\u001d\u001a\u00020\u0002H\u0014J\u0010\u0010\u001e\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0014J\u0018\u0010\u001f\u001a\u00020\r2\u0006\u0010 \u001a\u00020!2\u0006\u0010\"\u001a\u00020\u0013H\u0016R(\u0010\u0005\u001a\u0004\u0018\u00010\u00022\b\u0010\u0004\u001a\u0004\u0018\u00010\u0002@FX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\t¨\u0006#"}, d2 = {"Lorg/godfootsteps/home/viewholder/ListWithHeaderVH$ThreeTruthsAdapter;", "Lorg/commons/screenadapt/recyclerview/FastScreenListAdapter;", "Lorg/godfootsteps/arch/api/model/HomeThreeTruthsData$ListBean;", "(Lorg/godfootsteps/home/viewholder/ListWithHeaderVH;)V", AppMeasurementSdk.ConditionalUserProperty.VALUE, "headItem", "getHeadItem", "()Lorg/godfootsteps/arch/api/model/HomeThreeTruthsData$ListBean;", "setHeadItem", "(Lorg/godfootsteps/arch/api/model/HomeThreeTruthsData$ListBean;)V", "bindArticleData", "", "holder", "Lorg/commons/screenadapt/recyclerview/ScreenViewHolder;", "listBean", "Lorg/godfootsteps/arch/api/model/HomeThreeTruthsData$PostListBean;", "loadHd", "", "getHeaderLayoutId", "", "()Ljava/lang/Integer;", "getLayoutId", "loadThumbnail", "hqThumbnailURL", "", "thumbnailURL", "loadVideoData", "Lorg/godfootsteps/arch/api/model/HomeThreeTruthsData$VideoListBean;", "onBind", "item", "onBindHeader", "onCreateViewHolder", "parent", "Landroid/view/ViewGroup;", "viewType", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ThreeTruthsAdapter extends FastScreenListAdapter<HomeThreeTruthsData.ListBean> {
public HomeThreeTruthsData.ListBean b;
public final ListWithHeaderVH c;
public ThreeTruthsAdapter(ListWithHeaderVH listWithHeaderVH) {
super(null, 1);
h.e(listWithHeaderVH, "this$0");
this.c = listWithHeaderVH;
}
@Override
public Integer f() {
if (this.b == null) {
return null;
}
return Integer.valueOf(v.i() ? R$layout.item_video_pad : R$layout.item_video_tb);
}
@Override
public int g() {
return R$layout.item_thumbnail_title;
}
@Override
public void i(ScreenViewHolder screenViewHolder, HomeThreeTruthsData.ListBean listBean) {
HomeThreeTruthsData.ListBean listBean2 = listBean;
h.e(listBean2, "item");
if (listBean2 instanceof HomeThreeTruthsData.VideoListBean) {
h.c(screenViewHolder);
n(screenViewHolder, (HomeThreeTruthsData.VideoListBean) listBean2, false);
} else if (listBean2 instanceof HomeThreeTruthsData.PostListBean) {
h.c(screenViewHolder);
l(screenViewHolder, (HomeThreeTruthsData.PostListBean) listBean2, false);
}
}
@Override
public void j(ScreenViewHolder screenViewHolder) {
h.e(screenViewHolder, "holder");
HomeThreeTruthsData.ListBean listBean = this.b;
if (listBean instanceof HomeThreeTruthsData.VideoListBean) {
Objects.requireNonNull(listBean, "null cannot be cast to non-null type org.godfootsteps.arch.api.model.HomeThreeTruthsData.VideoListBean");
n(screenViewHolder, (HomeThreeTruthsData.VideoListBean) listBean, true);
} else if (listBean instanceof HomeThreeTruthsData.PostListBean) {
Objects.requireNonNull(listBean, "null cannot be cast to non-null type org.godfootsteps.arch.api.model.HomeThreeTruthsData.PostListBean");
l(screenViewHolder, (HomeThreeTruthsData.PostListBean) listBean, 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(ScreenViewHolder screenViewHolder, final HomeThreeTruthsData.PostListBean postListBean, boolean z) {
int L;
View view = screenViewHolder.f15173i;
((TextView) (view == null ? null : view.findViewById(R$id.tv_title))).setText(postListBean.getTitle());
View view2 = screenViewHolder.f15173i;
((TextView) (view2 != null ? view2.findViewById(R$id.tv_title) : null)).setMaxLines(4);
if (z) {
L = v.i() ? (int) ((y.L() - y.E(72.0f)) * 0.42d) : y.L();
} else {
L = (int) ((v.i() ? (y.L() - y.E(72.0f)) / 2 : y.L()) * 0.42f);
}
int i2 = L;
CustomThumbnailView customThumbnailView = (CustomThumbnailView) screenViewHolder.itemView.findViewById(R$id.iv_thumbnail);
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(this.c.f15891k);
sb.append(z ? "hd" : "ld");
sb.append('/');
sb.append((Object) postListBean.getImage());
customThumbnailView.e(sb.toString(), R$drawable.ic_placeholder_16_9, i2, (i2 * 9) / 16, true);
View view3 = screenViewHolder.itemView;
final ListWithHeaderVH listWithHeaderVH = this.c;
view3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view4) {
HomeThreeTruthsData.PostListBean postListBean2 = HomeThreeTruthsData.PostListBean.this;
ListWithHeaderVH listWithHeaderVH2 = listWithHeaderVH;
n.i.b.h.e(postListBean2, "$listBean");
n.i.b.h.e(listWithHeaderVH2, "this$0");
d.c.i.c cVar = (d.c.i.c) k.a.a.a.a.b(d.c.i.c.class);
if (cVar != null) {
String bookId = postListBean2.getBookId();
n.i.b.h.d(bookId, "listBean.bookId");
String chapterId = postListBean2.getChapterId();
n.i.b.h.d(chapterId, "listBean.chapterId");
cVar.e(bookId, chapterId, postListBean2.getShare());
}
GAEventSendUtil.a.l(listWithHeaderVH2.f15893m, postListBean2.getTitle());
}
});
}
public final void m(ScreenViewHolder screenViewHolder, boolean z, String str, String str2) {
h.e(screenViewHolder, "holder");
h.e(str, "hqThumbnailURL");
h.e(str2, "thumbnailURL");
if (z) {
int L = v.i() ? (int) ((y.L() - y.E(72.0f)) * 0.42d) : y.L();
View view = screenViewHolder.f15173i;
((CustomThumbnailView) (view != null ? view.findViewById(R$id.iv_thumbnail) : null)).e(str, R$drawable.ic_video_default, L, (L * 9) / 16, true);
return;
}
int L2 = (int) ((v.i() ? (y.L() - y.E(72.0f)) / 2 : y.L()) * 0.42f);
View view2 = screenViewHolder.f15173i;
((CustomThumbnailView) (view2 != null ? view2.findViewById(R$id.iv_thumbnail) : null)).e(str2, R$drawable.ic_video_default, L2, (L2 * 9) / 16, true);
}
public final void n(final ScreenViewHolder screenViewHolder, final HomeThreeTruthsData.VideoListBean videoListBean, final boolean z) {
View view = screenViewHolder.f15173i;
View findViewById = view == null ? null : view.findViewById(R$id.iv_thumbnail);
h.d(findViewById, "holder.iv_thumbnail");
((CustomThumbnailView) findViewById).e("", R$drawable.ic_video_default, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : false);
String videoId = videoListBean.getVideoId();
h.d(videoId, "listBean.videoId");
h.e(videoId, "<this>");
boolean z2 = true;
if (!a.B(videoId, "Vimeo_", true) && !Pattern.matches("^[0-9]+$", videoId)) {
z2 = false;
}
if (!z2) {
String videoId2 = videoListBean.getVideoId();
h.d(videoId2, "listBean.videoId");
h.e(videoId2, "<this>");
String videoId3 = videoListBean.getVideoId();
h.d(videoId3, "listBean.videoId");
h.e(videoId3, "<this>");
m(screenViewHolder, z, "http://img.youtube.com/vi/" + videoId2 + "/hqdefault.jpg", "http://img.youtube.com/vi/" + videoId3 + "/mqdefault.jpg");
}
f fVar = (f) k.a.a.a.a.b(f.class);
if (fVar != null) {
String videoId4 = videoListBean.getVideoId();
h.d(videoId4, "listBean.videoId");
fVar.l(videoId4, 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, "video");
if (ScreenViewHolder.this.itemView.getPaddingTop() == 0) {
View view2 = ScreenViewHolder.this.itemView;
h.d(view2, "holder.itemView");
n0.r(view2, y.E(8.0f));
}
View view3 = ScreenViewHolder.this.f15173i;
((TextView) (view3 == null ? null : view3.findViewById(R$id.tv_title))).setText(video.getTitle());
View view4 = ScreenViewHolder.this.f15173i;
((CustomThumbnailView) (view4 == null ? null : view4.findViewById(R$id.iv_thumbnail))).setDuration(video.getDuration());
String description = video.getDescription();
String w2 = description == null ? null : a.w(a.w(description, h.j(video.getTitle(), "\n"), "", false, 4), "\n", "", false, 4);
if (w2 == null || w2.length() == 0) {
View view5 = ScreenViewHolder.this.f15173i;
((TextView) (view5 == null ? null : view5.findViewById(R$id.tv_title))).setMaxLines(4);
View view6 = ScreenViewHolder.this.f15173i;
AutoEllipsizeView autoEllipsizeView = (AutoEllipsizeView) (view6 != null ? view6.findViewById(R$id.tv_summary) : null);
if (autoEllipsizeView != null) {
n0.c(autoEllipsizeView, false, 1);
}
} else {
View view7 = ScreenViewHolder.this.f15173i;
((TextView) (view7 == null ? null : view7.findViewById(R$id.tv_title))).setMaxLines(2);
View view8 = ScreenViewHolder.this.f15173i;
AutoEllipsizeView autoEllipsizeView2 = (AutoEllipsizeView) (view8 == null ? null : view8.findViewById(R$id.tv_summary));
if (autoEllipsizeView2 != null) {
autoEllipsizeView2.setText(w2);
}
View view9 = ScreenViewHolder.this.f15173i;
AutoEllipsizeView autoEllipsizeView3 = (AutoEllipsizeView) (view9 != null ? view9.findViewById(R$id.tv_summary) : null);
if (autoEllipsizeView3 != null) {
n0.t(autoEllipsizeView3);
}
}
ListWithHeaderVH.ThreeTruthsAdapter threeTruthsAdapter = this;
ScreenViewHolder screenViewHolder2 = ScreenViewHolder.this;
boolean z3 = z;
String hqThumbnailURL = video.getHqThumbnailURL();
h.d(hqThumbnailURL, "video.hqThumbnailURL");
String thumbnailURL = video.getThumbnailURL();
h.d(thumbnailURL, "video.thumbnailURL");
threeTruthsAdapter.m(screenViewHolder2, z3, hqThumbnailURL, thumbnailURL);
}
}, new l<Integer, e>() {
{
super(1);
}
@Override
public e invoke(Integer num) {
invoke(num.intValue());
return e.a;
}
public final void invoke(int i2) {
View view2 = ScreenViewHolder.this.f15173i;
View findViewById2 = view2 == null ? null : view2.findViewById(R$id.iv_thumbnail);
h.d(findViewById2, "holder.iv_thumbnail");
((CustomThumbnailView) findViewById2).e("", R$drawable.ic_video_default, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : false);
}
});
}
View view2 = screenViewHolder.itemView;
final ListWithHeaderVH listWithHeaderVH = this.c;
view2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view3) {
String obj;
HomeThreeTruthsData.VideoListBean videoListBean2 = HomeThreeTruthsData.VideoListBean.this;
ListWithHeaderVH listWithHeaderVH2 = listWithHeaderVH;
ScreenViewHolder screenViewHolder2 = screenViewHolder;
n.i.b.h.e(videoListBean2, "$listBean");
n.i.b.h.e(listWithHeaderVH2, "this$0");
n.i.b.h.e(screenViewHolder2, "$holder");
d.c.i.f fVar2 = (d.c.i.f) k.a.a.a.a.b(d.c.i.f.class);
String str = "";
if (fVar2 != null) {
String videoId5 = videoListBean2.getVideoId();
if (videoId5 == null) {
videoId5 = "";
}
String id = videoListBean2.getId();
n.i.b.h.d(id, "listBean.id");
fVar2.m(videoId5, id, listWithHeaderVH2.f15876j);
}
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
String str2 = listWithHeaderVH2.f15893m;
View view4 = screenViewHolder2.f15173i;
CharSequence text = ((TextView) (view4 == null ? null : view4.findViewById(R$id.tv_title))).getText();
if (text != null && (obj = text.toString()) != null) {
str = obj;
}
companion.o(str2, str);
}
});
}
}
public ListWithHeaderVH(View view) {
super(view);
h.e(view, "itemView");
this.f15891k = "";
this.f15892l = "";
this.f15893m = "";
}
@Override
public void b(final BaseCategoryModel baseCategoryModel) {
if (v.i()) {
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);
View view2 = this.f15173i;
RecyclerView.n layoutManager2 = ((MyRecyclerView) (view2 == null ? null : view2.findViewById(R$id.rv_list))).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 i2 == 0 ? 2 : 1;
}
};
}
if (baseCategoryModel == null) {
return;
}
baseCategoryModel.getCategory();
HomeThreeTruthsData homeThreeTruthsData = (HomeThreeTruthsData) baseCategoryModel;
View view3 = this.f15173i;
((TextView) (view3 == null ? null : view3.findViewById(R$id.tv_mode_title))).setText(homeThreeTruthsData.getTitle());
String title = homeThreeTruthsData.getTitle();
h.d(title, "model.title");
this.f15893m = title;
View view4 = this.f15173i;
MyRecyclerView myRecyclerView = (MyRecyclerView) (view4 == null ? null : view4.findViewById(R$id.rv_list));
ThreeTruthsAdapter threeTruthsAdapter = new ThreeTruthsAdapter(this);
List<HomeThreeTruthsData.ListBean> mergeList = homeThreeTruthsData.getMergeList();
if (!(mergeList == null || mergeList.isEmpty())) {
threeTruthsAdapter.b = mergeList.remove(0);
threeTruthsAdapter.notifyItemChanged(0);
h.d(mergeList, "data");
threeTruthsAdapter.a = g.W(mergeList, v.i() ? 4 : 3);
threeTruthsAdapter.notifyDataSetChanged();
} else {
threeTruthsAdapter.a = EmptyList.INSTANCE;
threeTruthsAdapter.notifyDataSetChanged();
}
myRecyclerView.setAdapter(threeTruthsAdapter);
View view5 = this.f15173i;
e.c0.a.d(view5 != null ? view5.findViewById(R$id.tv_read_more) : null, 500L, new View.OnClickListener() {
@Override
public final void onClick(View view6) {
ListWithHeaderVH listWithHeaderVH = ListWithHeaderVH.this;
BaseCategoryModel baseCategoryModel2 = baseCategoryModel;
int i2 = ListWithHeaderVH.f15890n;
n.i.b.h.e(listWithHeaderVH, "this$0");
View view7 = listWithHeaderVH.f15173i;
GospelTrueListActivity.Z(((TextView) (view7 == null ? null : view7.findViewById(R$id.tv_mode_title))).getText().toString(), ((HomeThreeTruthsData) baseCategoryModel2).getId(), listWithHeaderVH.f15892l, listWithHeaderVH.f15876j);
GAEventSendUtil.a.n(listWithHeaderVH.f15893m);
}
});
}
}