CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f
以下内容为反编译后的 ImageTitleVH.java 源代码,内容仅作参考
package org.godfootsteps.home.viewholder;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.ReflectUtils;
import com.github.rubensousa.gravitysnaphelper.GravitySnapHelper;
import d.c.a.j.v;
import i.a.b.a.a;
import i.c.a.c.n0;
import i.c.a.c.y;
import java.util.Objects;
import kotlin.Metadata;
import n.i.b.h;
import org.commons.screenadapt.recyclerview.ScreenListAdapter;
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.BaseItemModel;
import org.godfootsteps.arch.api.model.HomeContinuedModel;
import org.godfootsteps.arch.api.model.HomeTwentyTruthsModel;
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.StoryListActivity;
import org.godfootsteps.home.viewholder.ImageTitleVH;
@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\u0011\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \u001b2\u00020\u0001:\u0002\u001b\u001cB\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0017\u001a\u00020\u00182\b\u0010\u0019\u001a\u0004\u0018\u00010\u001aH\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\nR\u001a\u0010\u0014\u001a\u00020\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0015\u0010\b\"\u0004\b\u0016\u0010\n¨\u0006\u001d"}, d2 = {"Lorg/godfootsteps/home/viewholder/ImageTitleVH;", "Lorg/godfootsteps/home/viewholder/BaseHomeViewHolder;", "itemView", "Landroid/view/View;", "(Landroid/view/View;)V", "article", "", "getArticle", "()Ljava/lang/String;", "setArticle", "(Ljava/lang/String;)V", "cssUrl", "getCssUrl", "setCssUrl", "gospelTruthImageURL", "getGospelTruthImageURL", "setGospelTruthImageURL", "platform", "getPlatform", "setPlatform", "storyImageURL", "getStoryImageURL", "setStoryImageURL", "onBind", "", "model", "Lorg/godfootsteps/arch/api/model/BaseCategoryModel;", "Companion", "ImageTitleAdapter", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ImageTitleVH extends BaseHomeViewHolder {
public static final int f15883n = 0;
public String f15884k;
public String f15885l;
public String f15886m;
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\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\u0010\u0007\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0005H\u0016J\b\u0010\t\u001a\u00020\u0005H\u0014J\u001a\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\r2\u0006\u0010\u000e\u001a\u00020\u0002H\u0014J\u0018\u0010\u000f\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\b\u001a\u00020\u0005H\u0016J\u0018\u0010\u0010\u001a\u00020\r2\u0006\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0005H\u0016R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0005X\u0082D¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Lorg/godfootsteps/home/viewholder/ImageTitleVH$ImageTitleAdapter;", "Lorg/commons/screenadapt/recyclerview/ScreenListAdapter;", "Lorg/godfootsteps/arch/api/model/BaseItemModel;", "(Lorg/godfootsteps/home/viewholder/ImageTitleVH;)V", "Continued", "", "TwentyTruths", "getItemViewType", "position", "getLayoutId", "onBind", "", "holder", "Lorg/commons/screenadapt/recyclerview/ScreenViewHolder;", "item", "onBindViewHolder", "onCreateViewHolder", "parent", "Landroid/view/ViewGroup;", "viewType", "home_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class ImageTitleAdapter extends ScreenListAdapter<BaseItemModel> {
public final int f15887k;
public final int f15888l;
public final ImageTitleVH f15889m;
public ImageTitleAdapter(ImageTitleVH imageTitleVH) {
super(null, 1);
h.e(imageTitleVH, "this$0");
this.f15889m = imageTitleVH;
this.f15887k = 3;
this.f15888l = 4;
}
@Override
public int getItemViewType(int i2) {
return this.f15170i.f8961f.get(i2) instanceof HomeTwentyTruthsModel.ListBean ? this.f15887k : this.f15888l;
}
@Override
public int h() {
return 0;
}
@Override
public void k(ScreenViewHolder screenViewHolder, int i2) {
h.e(screenViewHolder, "holder");
i(screenViewHolder, (BaseItemModel) this.f15170i.f8961f.get(i2));
}
@Override
public ScreenViewHolder onCreateViewHolder(ViewGroup viewGroup, int i2) {
h.e(viewGroup, "parent");
ScreenViewHolder screenViewHolder = new ScreenViewHolder(n0.f(viewGroup, i2 == this.f15887k ? R$layout.item_image_title_lr : R$layout.item_image_title_tb, false, 2));
if (v.i() && i2 != this.f15887k) {
screenViewHolder.itemView.getLayoutParams().width = -1;
((CustomThumbnailView) screenViewHolder.itemView.findViewById(R$id.iv_video_thumbnail)).getLayoutParams().width = -1;
}
return screenViewHolder;
}
@Override
public void i(ScreenViewHolder screenViewHolder, final BaseItemModel baseItemModel) {
h.e(baseItemModel, "item");
if (screenViewHolder == null) {
return;
}
final ImageTitleVH imageTitleVH = this.f15889m;
if (baseItemModel instanceof HomeTwentyTruthsModel.ListBean) {
float f0 = y.f0() * 0.23f;
if (v.i()) {
f0 = y.f0() * (y.w0() ? 0.13f : 0.16f);
}
View view = screenViewHolder.f15173i;
ViewGroup.LayoutParams layoutParams = ((CustomThumbnailView) (view == null ? null : view.findViewById(R$id.iv_video_thumbnail))).getLayoutParams();
int i2 = (int) f0;
layoutParams.width = i2;
layoutParams.height = i2;
View view2 = screenViewHolder.f15173i;
((CustomThumbnailView) (view2 == null ? null : view2.findViewById(R$id.iv_video_thumbnail))).setLayoutParams(layoutParams);
View view3 = screenViewHolder.f15173i;
View findViewById = view3 == null ? null : view3.findViewById(R$id.iv_video_thumbnail);
StringBuilder sb = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb.append("https://appservercn.kingdomsalvation.org");
sb.append(imageTitleVH.f15884k);
sb.append("ld/");
HomeTwentyTruthsModel.ListBean listBean = (HomeTwentyTruthsModel.ListBean) baseItemModel;
sb.append((Object) listBean.getImage());
((CustomThumbnailView) findViewById).e(sb.toString(), R$drawable.bg_continued_white, i2, i2, true);
View view4 = screenViewHolder.f15173i;
((TextView) (view4 != null ? view4.findViewById(R$id.tv_title) : null)).setText(listBean.getTitle());
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view5) {
BaseItemModel baseItemModel2 = BaseItemModel.this;
ImageTitleVH imageTitleVH2 = imageTitleVH;
n.i.b.h.e(baseItemModel2, "$item");
n.i.b.h.e(imageTitleVH2, "this$0");
HomeTwentyTruthsModel.ListBean listBean2 = (HomeTwentyTruthsModel.ListBean) baseItemModel2;
String title = listBean2.getTitle();
n.i.b.h.d(title, "item.title");
GospelTrueListActivity.Z(title, listBean2.getId(), imageTitleVH2.f15886m, imageTitleVH2.f15876j);
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
String title2 = listBean2.getTitle();
Bundle bundle = new Bundle();
i.a.b.a.a.x0(bundle, "语言", "分类", title2).a.zzx("首页福音真理分类", bundle);
}
});
if (v.i()) {
screenViewHolder.itemView.getLayoutParams().width = y.E(40.0f) + ((int) (y.f0() * (y.w0() ? 0.32f : 0.4f)));
} else {
screenViewHolder.itemView.getLayoutParams().width = y.E(32.0f) + ((int) (y.f0() * 0.58d));
}
} else if (baseItemModel instanceof HomeContinuedModel.ListBean) {
int f02 = v.i() ? (y.f0() - y.E(144.0f)) / 3 : y.E(217.0f);
View view5 = screenViewHolder.f15173i;
HomeContinuedModel.ListBean listBean2 = (HomeContinuedModel.ListBean) baseItemModel;
((TextView) (view5 == null ? null : view5.findViewById(R$id.tv_title))).setText(listBean2.getStoryTitle());
View view6 = screenViewHolder.f15173i;
View findViewById2 = view6 != null ? view6.findViewById(R$id.iv_video_thumbnail) : null;
StringBuilder sb2 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb2.append("https://appservercn.kingdomsalvation.org");
sb2.append(imageTitleVH.f15885l);
sb2.append("ld/");
sb2.append((Object) listBean2.getStoryImage());
((CustomThumbnailView) findViewById2).e(sb2.toString(), R$drawable.bg_continued_white, f02, (f02 * 123) / 217, true);
screenViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view7) {
BaseItemModel baseItemModel2 = BaseItemModel.this;
ImageTitleVH imageTitleVH2 = imageTitleVH;
n.i.b.h.e(baseItemModel2, "$item");
n.i.b.h.e(imageTitleVH2, "this$0");
HomeContinuedModel.ListBean listBean3 = (HomeContinuedModel.ListBean) baseItemModel2;
String storyTitle = listBean3.getStoryTitle();
n.i.b.h.d(storyTitle, "item.storyTitle");
int id = listBean3.getId();
String str = imageTitleVH2.f15876j;
StringBuilder sb3 = new StringBuilder();
Objects.requireNonNull(AppClient.a);
sb3.append("https://appservercn.kingdomsalvation.org");
sb3.append(imageTitleVH2.f15885l);
sb3.append("ld/");
sb3.append((Object) listBean3.getStoryImage());
String sb4 = sb3.toString();
n.i.b.h.e(storyTitle, "title");
n.i.b.h.e(str, "mode");
n.i.b.h.e(sb4, "thumbnailUrl");
Bundle bundle = new Bundle();
bundle.putString("title", storyTitle);
bundle.putString("mode", str);
bundle.putInt("id", id);
bundle.putString("thumbnailUrl", sb4);
e.c0.a.j0(bundle, StoryListActivity.class);
GAEventSendUtil.Companion companion = GAEventSendUtil.a;
String storyTitle2 = listBean3.getStoryTitle();
Bundle bundle2 = new Bundle();
i.a.b.a.a.x0(bundle2, "语言", "分类", storyTitle2).a.zzx("首页圣经故事分类", bundle2);
}
});
if (v.i()) {
screenViewHolder.itemView.getLayoutParams().width = -1;
}
}
}
@Override
public void onBindViewHolder(ScreenViewHolder screenViewHolder, int i2) {
ScreenViewHolder screenViewHolder2 = screenViewHolder;
h.e(screenViewHolder2, "holder");
i(screenViewHolder2, (BaseItemModel) this.f15170i.f8961f.get(i2));
}
}
public ImageTitleVH(View view) {
super(view);
h.e(view, "itemView");
this.f15884k = "";
this.f15885l = "";
this.f15886m = "";
}
@Override
public void b(BaseCategoryModel baseCategoryModel) {
View view = this.f15173i;
View findViewById = view == null ? null : view.findViewById(R$id.tv_read_more);
h.d(findViewById, "tv_read_more");
n0.c(findViewById, false, 1);
if (v.i()) {
View view2 = this.f15173i;
RecyclerView.n layoutManager = ((MyRecyclerView) (view2 == null ? null : view2.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
} else {
View view3 = this.f15173i;
View findViewById2 = view3 == null ? null : view3.findViewById(R$id.rv_list);
a.b0(findViewById2, "rv_list", 8.0f, findViewById2);
}
if (baseCategoryModel == null) {
return;
}
View view4 = this.f15173i;
if (((MyRecyclerView) (view4 == null ? null : view4.findViewById(R$id.rv_list))).getAdapter() == null) {
View view5 = this.f15173i;
((MyRecyclerView) (view5 == null ? null : view5.findViewById(R$id.rv_list))).setAdapter(new ImageTitleAdapter(this));
GravitySnapHelper gravitySnapHelper = new GravitySnapHelper(8388611);
gravitySnapHelper.f2648h = true;
View view6 = this.f15173i;
gravitySnapHelper.attachToRecyclerView((RecyclerView) (view6 == null ? null : view6.findViewById(R$id.rv_list)));
View view7 = this.f15173i;
((MyRecyclerView) (view7 == null ? null : view7.findViewById(R$id.rv_list))).setTag(gravitySnapHelper);
} else {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
ImageTitleVH imageTitleVH = ImageTitleVH.this;
int i2 = ImageTitleVH.f15883n;
n.i.b.h.e(imageTitleVH, "this$0");
try {
View view8 = imageTitleVH.f15173i;
ReflectUtils.l(((MyRecyclerView) (view8 == null ? null : view8.findViewById(R$id.rv_list))).getTag()).h("snapToTargetExistingView", new Object[0]);
} catch (Exception unused) {
}
}
}, 300L);
}
if (baseCategoryModel instanceof HomeTwentyTruthsModel) {
View view8 = this.f15173i;
HomeTwentyTruthsModel homeTwentyTruthsModel = (HomeTwentyTruthsModel) baseCategoryModel;
((TextView) (view8 == null ? null : view8.findViewById(R$id.tv_mode_title))).setText(homeTwentyTruthsModel.getTitle());
int i2 = v.i() ? 3 : 4;
int size = homeTwentyTruthsModel.getList().size();
if (i2 > size) {
i2 = size;
}
r3 = i2 >= 1 ? i2 : 1;
View view9 = this.f15173i;
if (!(((MyRecyclerView) (view9 == null ? null : view9.findViewById(R$id.rv_list))).getLayoutManager() instanceof GridLayoutManager)) {
View view10 = this.f15173i;
MyRecyclerView myRecyclerView = (MyRecyclerView) (view10 == null ? null : view10.findViewById(R$id.rv_list));
View view11 = this.f15173i;
myRecyclerView.setLayoutManager(new GridLayoutManager(((MyRecyclerView) (view11 == null ? null : view11.findViewById(R$id.rv_list))).getContext(), r3, 0, false));
} else {
View view12 = this.f15173i;
RecyclerView.n layoutManager2 = ((MyRecyclerView) (view12 == null ? null : view12.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager2, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager2).s(r3);
View view13 = this.f15173i;
RecyclerView.n layoutManager3 = ((MyRecyclerView) (view13 == null ? null : view13.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager3, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager3).setOrientation(0);
}
View view14 = this.f15173i;
RecyclerView.Adapter adapter = ((MyRecyclerView) (view14 == null ? null : view14.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter, "null cannot be cast to non-null type org.godfootsteps.home.viewholder.ImageTitleVH.ImageTitleAdapter");
((ImageTitleAdapter) adapter).m(homeTwentyTruthsModel.getList());
} else if (baseCategoryModel instanceof HomeContinuedModel) {
View view15 = this.f15173i;
HomeContinuedModel homeContinuedModel = (HomeContinuedModel) baseCategoryModel;
((TextView) (view15 == null ? null : view15.findViewById(R$id.tv_mode_title))).setText(homeContinuedModel.getTitle());
if (v.i()) {
r3 = 3;
} else if (homeContinuedModel.getList().size() > 6) {
r3 = 2;
}
View view16 = this.f15173i;
if (!(((MyRecyclerView) (view16 == null ? null : view16.findViewById(R$id.rv_list))).getLayoutManager() instanceof GridLayoutManager)) {
View view17 = this.f15173i;
MyRecyclerView myRecyclerView2 = (MyRecyclerView) (view17 == null ? null : view17.findViewById(R$id.rv_list));
View view18 = this.f15173i;
myRecyclerView2.setLayoutManager(new GridLayoutManager(((MyRecyclerView) (view18 == null ? null : view18.findViewById(R$id.rv_list))).getContext(), r3, v.i() ? 1 : 0, false));
} else {
View view19 = this.f15173i;
RecyclerView.n layoutManager4 = ((MyRecyclerView) (view19 == null ? null : view19.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager4, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager4).s(r3);
View view20 = this.f15173i;
RecyclerView.n layoutManager5 = ((MyRecyclerView) (view20 == null ? null : view20.findViewById(R$id.rv_list))).getLayoutManager();
Objects.requireNonNull(layoutManager5, "null cannot be cast to non-null type androidx.recyclerview.widget.GridLayoutManager");
((GridLayoutManager) layoutManager5).setOrientation(v.i() ? 1 : 0);
}
View view21 = this.f15173i;
RecyclerView.Adapter adapter2 = ((MyRecyclerView) (view21 == null ? null : view21.findViewById(R$id.rv_list))).getAdapter();
Objects.requireNonNull(adapter2, "null cannot be cast to non-null type org.godfootsteps.home.viewholder.ImageTitleVH.ImageTitleAdapter");
((ImageTitleAdapter) adapter2).m(homeContinuedModel.getList());
}
View view22 = this.f15173i;
RecyclerView.Adapter adapter3 = ((MyRecyclerView) (view22 != null ? view22.findViewById(R$id.rv_list) : null)).getAdapter();
h.c(adapter3);
adapter3.notifyDataSetChanged();
}
}