CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 NewsThumbnailVH.java 源代码,内容仅作参考
package org.godfootsteps.home.viewholder;
import android.view.View;
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 java.util.List;
import java.util.Objects;
import kotlin.Metadata;
import n.e;
import n.f.g;
import n.i.a.l;
import n.i.b.h;
import n.i.b.o;
import n.o.a;
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.R$drawable;
import org.godfootsteps.home.R$id;
import org.godfootsteps.home.R$layout;
import org.godfootsteps.home.viewholder.NewsThumbnailVH;
import org.godfootsteps.home.viewholder.ThumbnailVH;
@Metadata(d1 = {"\u0000P\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\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\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\u0018\u0000 %2\u00020\u0001:\u0001%B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J4\u0010\u0011\u001a\u00020\u00122\b\u0010\u0013\u001a\u0004\u0018\u00010\u00142\b\u0010\u0015\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u00062\u0006\u0010\u0019\u001a\u00020\u001aH\u0014J(\u0010\u001b\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u001c\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u00062\u0006\u0010\u0019\u001a\u00020\u001aH\u0014J\u0019\u0010\u001d\u001a\u0004\u0018\u00010\u001e2\b\u0010\u001c\u001a\u0004\u0018\u00010\u0017H\u0014¢\u0006\u0002\u0010\u001fJ\b\u0010 \u001a\u00020\u001eH\u0014J\u0010\u0010!\u001a\u00020\u00122\u0006\u0010\u000b\u001a\u00020\fH\u0014J\u0012\u0010\"\u001a\u00020\u00122\b\u0010#\u001a\u0004\u0018\u00010$H\u0014R\u001c\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001c\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010¨\u0006&"}, d2 = {"Lorg/godfootsteps/home/viewholder/NewsThumbnailVH;", "Lorg/godfootsteps/home/viewholder/ThumbnailVH;", "itemView", "Landroid/view/View;", "(Landroid/view/View;)V", "categoryType", "", "getCategoryType", "()Ljava/lang/String;", "setCategoryType", "(Ljava/lang/String;)V", "dataModel", "Lorg/godfootsteps/arch/api/model/HomeNormalModel;", "getDataModel", "()Lorg/godfootsteps/arch/api/model/HomeNormalModel;", "setDataModel", "(Lorg/godfootsteps/arch/api/model/HomeNormalModel;)V", "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;", "getItemLayoutId", "setItemData", "setUpRVLayoutManager", "model", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "Companion", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class NewsThumbnailVH extends ThumbnailVH {
public static final int f15899v = 0;
public String f15900u;
public NewsThumbnailVH(View view) {
super(view);
h.e(view, "itemView");
}
@Override
public void c(final ScreenViewHolder screenViewHolder, String str, final HomeNormalModel.ListBean listBean, String str2, boolean z) {
h.e(listBean, "item");
h.e(str2, "listId");
View view = screenViewHolder.f15173i;
TextView textView = (TextView) (view == null ? null : view.findViewById(R$id.tv_publish_date));
if (textView != null) {
textView.setText(z.b(listBean.getDate()));
}
boolean z2 = true;
if (h.a("video", listBean.getType())) {
VideoClient videoClient = VideoClient.a;
String videoId = listBean.getVideoId();
l<String, e> lVar = new l<String, e>() {
{
super(1);
}
@Override
public e invoke(String str3) {
invoke2(str3);
return e.a;
}
public final void invoke2(String str3) {
h.e(str3, "url");
ScreenViewHolder screenViewHolder2 = ScreenViewHolder.this;
if (screenViewHolder2 == null) {
return;
}
View view2 = screenViewHolder2.f15173i;
CustomThumbnailView customThumbnailView = (CustomThumbnailView) (view2 == null ? null : view2.findViewById(R$id.iv_thumbnail));
if (customThumbnailView == null) {
return;
}
customThumbnailView.e(str3, R$drawable.ic_video_default, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : false);
}
};
if (!z) {
String str3 = this.f15900u;
if (!(str3 != null && a.c(str3, "Attention", false, 2))) {
z2 = false;
}
}
videoClient.a(videoId, lVar, z2);
View view2 = screenViewHolder.f15173i;
CustomThumbnailView customThumbnailView = (CustomThumbnailView) (view2 != null ? view2.findViewById(R$id.iv_thumbnail) : null);
if (customThumbnailView != null) {
customThumbnailView.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) {
HomeNormalModel.ListBean listBean2 = HomeNormalModel.ListBean.this;
NewsThumbnailVH newsThumbnailVH = this;
int i2 = NewsThumbnailVH.f15899v;
n.i.b.h.e(listBean2, "$item");
n.i.b.h.e(newsThumbnailVH, "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 valueOf = String.valueOf(listBean2.getId());
String videoId2 = listBean2.getVideoId();
if (videoId2 == null) {
videoId2 = "";
}
fVar.b(valueOf, videoId2);
}
GAEventSendUtil.a.o(newsThumbnailVH.f15917r, listBean2.getTitle());
}
});
return;
}
View view4 = screenViewHolder.f15173i;
CustomThumbnailView customThumbnailView2 = (CustomThumbnailView) (view4 != null ? view4.findViewById(R$id.iv_thumbnail) : null);
if (customThumbnailView2 != null) {
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(this.f15912m);
sb.append("ld/");
sb.append(listBean.getImage());
String sb2 = sb.toString();
if (!z) {
String str4 = this.f15900u;
if (!(str4 != null && a.c(str4, "Attention", false, 2))) {
z2 = false;
}
}
h.e(sb2, "<this>");
if (z2) {
sb2 = a.w(sb2, "/ld/", "/hd/", false, 4);
}
customThumbnailView2.e(sb2, R$drawable.ic_placeholder_16_9, (r14 & 4) != 0 ? -1 : 0, (r14 & 8) != 0 ? -1 : 0, (r14 & 16) != 0 ? false : true);
customThumbnailView2.setDuration("");
}
View view5 = screenViewHolder.itemView;
if (view5 == null) {
return;
}
view5.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view6) {
HomeNormalModel.ListBean listBean2 = HomeNormalModel.ListBean.this;
NewsThumbnailVH newsThumbnailVH = this;
int i2 = NewsThumbnailVH.f15899v;
n.i.b.h.e(listBean2, "$item");
n.i.b.h.e(newsThumbnailVH, "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) {
cVar.m(listBean2.getId(), listBean2.getShare());
}
GAEventSendUtil.a.l(newsThumbnailVH.f15917r, listBean2.getTitle());
}
});
}
@Override
public void d(ScreenViewHolder screenViewHolder, final HomeNormalModel.ListBean listBean, String str, boolean z) {
h.e(screenViewHolder, "holder");
h.e(listBean, "headItem");
h.e(str, "listId");
super.d(screenViewHolder, listBean, str, z);
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
HomeNormalModel.ListBean listBean2 = HomeNormalModel.ListBean.this;
NewsThumbnailVH newsThumbnailVH = this;
int i2 = NewsThumbnailVH.f15899v;
n.i.b.h.e(listBean2, "$headItem");
n.i.b.h.e(newsThumbnailVH, "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) {
fVar.b(String.valueOf(listBean2.getId()), listBean2.getVideoId());
}
GAEventSendUtil.a.o(newsThumbnailVH.f15917r, listBean2.getTitle());
}
});
}
@Override
public Integer e(HomeNormalModel.ListBean listBean) {
String str = this.f15900u;
if ((str != null && a.c(str, "Attention", false, 2)) || listBean == null) {
return null;
}
return Integer.valueOf(v.i() ? R$layout.item_thumbnail_title_date_header_lr : R$layout.item_thumbnail_title_date_tb);
}
@Override
public int g() {
String str = this.f15900u;
if (!(str != null && a.c(str, "Attention", false, 2))) {
if (v.i()) {
String str2 = this.f15900u;
}
return R$layout.item_thumbnail_title_date_lr;
}
return R$layout.item_thumbnail_title_date_tb;
}
@Override
public void h(HomeNormalModel homeNormalModel) {
int i2;
h.e(homeNormalModel, "dataModel");
this.f15900u = homeNormalModel.getType();
String type = homeNormalModel.getType();
h.d(type, "type");
if (!a.c(type, "Interview", false, 2)) {
String type2 = homeNormalModel.getType();
h.d(type2, "type");
if (!a.c(type2, "Society", false, 2)) {
String type3 = homeNormalModel.getType();
h.d(type3, "type");
if (!a.c(type3, "Religion", false, 2)) {
String type4 = homeNormalModel.getType();
h.d(type4, "type");
if (!a.c(type4, "Festival", false, 2)) {
String type5 = homeNormalModel.getType();
h.d(type5, "type");
i2 = a.c(type5, "Attention", false, 2) ? 2 : 0;
o.c(homeNormalModel.getList());
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");
List<HomeNormalModel.ListBean> W = g.W(homeNormalModel.getList(), i2);
String type6 = homeNormalModel.getType();
h.d(type6, "type");
((ThumbnailVH.ThumbnailAdapter) adapter).l("", "", null, W, !a.c(type6, "Attention", false, 2));
}
}
}
if (v.i()) {
i2 = 5;
o.c(homeNormalModel.getList());
View view2 = this.f15173i;
RecyclerView.Adapter adapter2 = ((MyRecyclerView) (view2 == null ? null : view2.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter2, "null cannot be cast to non-null type org.godfootsteps.home.viewholder.ThumbnailVH.ThumbnailAdapter");
List<HomeNormalModel.ListBean> W2 = g.W(homeNormalModel.getList(), i2);
String type62 = homeNormalModel.getType();
h.d(type62, "type");
((ThumbnailVH.ThumbnailAdapter) adapter2).l("", "", null, W2, !a.c(type62, "Attention", false, 2));
}
}
i2 = 4;
o.c(homeNormalModel.getList());
View view22 = this.f15173i;
RecyclerView.Adapter adapter22 = ((MyRecyclerView) (view22 == null ? null : view22.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter22, "null cannot be cast to non-null type org.godfootsteps.home.viewholder.ThumbnailVH.ThumbnailAdapter");
List<HomeNormalModel.ListBean> W22 = g.W(homeNormalModel.getList(), i2);
String type622 = homeNormalModel.getType();
h.d(type622, "type");
((ThumbnailVH.ThumbnailAdapter) adapter22).l("", "", null, W22, !a.c(type622, "Attention", false, 2));
}
@Override
public void i(BaseCategoryModel baseCategoryModel) {
String type;
String type2;
final int i2 = baseCategoryModel != null && (type = baseCategoryModel.getType()) != null && a.c(type, "Interview", false, 2) ? 3 : 2;
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(i2);
if ((baseCategoryModel == null || (type2 = baseCategoryModel.getType()) == null || !a.c(type2, "Attention", false, 2)) ? false : true) {
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 i3) {
return 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 i3) {
if (i3 == 0) {
return i2;
}
return 1;
}
};
}
}