得物.apk(点击下载) / ChannelBrandBannerView3.java
package com.shizhuang.duapp.modules.mall_dynamic.channel.views;
import a40.j;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.GradientDrawable;
import android.text.SpannableStringBuilder;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Space;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import cd.g;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.module.IModuleExposureObserver;
import com.shizhuang.duapp.common.exposure.DuExposureHelper;
import com.shizhuang.duapp.common.extension.DrawableScale;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.extension.LiveDataExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.utils.IViewAppearObserver;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.ModuleChildBoundExposureCallback;
import com.shizhuang.duapp.modules.mall_dynamic.channel.model.ChannelBannerItemModel3;
import com.shizhuang.duapp.modules.mall_dynamic.channel.model.ChannelBannerModel3;
import com.shizhuang.duapp.modules.mall_dynamic.channel.model.ChannelBannerSpuItemModel;
import com.shizhuang.duapp.modules.mall_dynamic.channel.model.ChannelInnerBrand;
import com.shizhuang.duapp.modules.mall_dynamic.channel.utils.MallTextHelper;
import com.youth.banner.Banner;
import com.youth.banner.adapter.BannerAdapter;
import com.youth.banner.listener.OnBannerListener;
import com.youth.banner.listener.OnPageScrolledListener;
import com.youth.banner.listener.OnPageSelectedListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.TypeCastException;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function1;
import kotlinx.android.extensions.LayoutContainer;
import l60.e;
import o5.i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Metadata(bv = {}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u00012\u00020\u00032\u00020\u00042\u00020\u0005:\u0002\u000f\u0010B'\b\u0007\u0012\u0006\u0010\t\u001a\u00020\b\u0012\n\b\u0002\u0010\u000b\u001a\u0004\u0018\u00010\n\u0012\b\b\u0002\u0010\f\u001a\u00020\u0006¢\u0006\u0004\b\r\u0010\u000eJ\b\u0010\u0007\u001a\u00020\u0006H\u0016¨\u0006\u0011"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/ChannelBrandBannerView3;", "Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/BaseChannelView;", "Lcom/shizhuang/duapp/modules/mall_dynamic/channel/model/ChannelBannerModel3;", "Lcom/shizhuang/duapp/common/component/module/IModuleExposureObserver;", "Lcom/shizhuang/duapp/modules/du_mall_common/utils/IViewAppearObserver;", "Lcom/shizhuang/duapp/modules/du_mall_common/utils/exposure/ModuleChildBoundExposureCallback;", "", "getLayoutId", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "ChannelBannerAdapter", "ChannelBannerViewHolder", "du_mall_dynamic_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ChannelBrandBannerView3.kt */
public final class ChannelBrandBannerView3 extends BaseChannelView<ChannelBannerModel3> implements IModuleExposureObserver, IViewAppearObserver, ModuleChildBoundExposureCallback {
public static ChangeQuickRedirect changeQuickRedirect;
public final ChannelBannerAdapter f;
/* renamed from: g reason: collision with root package name */
public int f19280g;
/* renamed from: h reason: collision with root package name */
public boolean f19281h;
public final l60.a i;
public HashMap j;
@Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0004\u0018\u00002\u0012\u0012\u0004\u0012\u00020\u0002\u0012\b\u0012\u00060\u0003R\u00020\u00040\u0001¨\u0006\u0005"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/ChannelBrandBannerView3$ChannelBannerAdapter;", "Lcom/youth/banner/adapter/BannerAdapter;", "Lcom/shizhuang/duapp/modules/mall_dynamic/channel/model/ChannelBannerItemModel3;", "Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/ChannelBrandBannerView3$ChannelBannerViewHolder;", "Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/ChannelBrandBannerView3;", "du_mall_dynamic_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ChannelBrandBannerView3.kt */
public final class ChannelBannerAdapter extends BannerAdapter<ChannelBannerItemModel3, ChannelBannerViewHolder> {
public static ChangeQuickRedirect changeQuickRedirect;
/* JADX WARN: Incorrect args count in method signature: ()V */
public ChannelBannerAdapter() {
}
/* JADX WARNING: Code restructure failed: missing block: B:10:0x00ea, code lost:
if (r4 != null) goto L_0x00f5;
*/
/* JADX WARNING: Code restructure failed: missing block: B:12:0x00f1, code lost:
if (r4 != null) goto L_0x00f5;
*/
/* JADX WARNING: Code restructure failed: missing block: B:67:0x0248, code lost:
if ((r0 == null || r0.length() == 0) == false) goto L_0x024c;
*/
@Override // com.youth.banner.holder.IViewHolder
public void onBindView(Object obj, Object obj2, int i, int i3) {
String str;
String str2;
SpannableStringBuilder spannableStringBuilder;
SpannableStringBuilder spannableStringBuilder2;
ChannelBannerViewHolder channelBannerViewHolder = (ChannelBannerViewHolder) obj;
ChannelBannerItemModel3 channelBannerItemModel3 = (ChannelBannerItemModel3) obj2;
Object[] objArr = {channelBannerViewHolder, channelBannerItemModel3, new Integer(i), new Integer(i3)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 211464, new Class[]{ChannelBannerViewHolder.class, ChannelBannerItemModel3.class, cls, cls}, Void.TYPE).isSupported) {
if (!PatchProxy.proxy(new Object[]{channelBannerItemModel3, new Integer(i)}, channelBannerViewHolder, ChannelBannerViewHolder.changeQuickRedirect, false, 211465, new Class[]{ChannelBannerItemModel3.class, cls}, Void.TYPE).isSupported) {
float f = (float) 2;
float b = (float) fi.b.b(f);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(855638016);
gradientDrawable.setCornerRadius(b);
String n = ChannelBrandBannerView3.this.n(channelBannerItemModel3);
((GenericDraweeHierarchy) ((DuImageLoaderView) channelBannerViewHolder._$_findCachedViewById(R.id.ivImage)).getHierarchy()).setActualImageScaleType(e.f35034a);
((DuImageLoaderView) channelBannerViewHolder._$_findCachedViewById(R.id.ivImage)).i(n).R(b).h0(gradientDrawable).x();
boolean o = ChannelBrandBannerView3.this.o(channelBannerItemModel3, i);
of.a aVar = new of.a(ChannelBrandBannerView3.this.getContext(), R.drawable.ic_channel_brand_banner_enter2, 2, fi.b.b((float) 4), 0, 0, 48);
if (o) {
ChannelInnerBrand innerBrand = channelBannerItemModel3.getInnerBrand();
str = innerBrand != null ? innerBrand.getBrandName() : null;
} else {
str = channelBannerItemModel3.getMainTitle();
}
str = "";
if (o || (str2 = channelBannerItemModel3.getSubTitle()) == null) {
str2 = "";
}
TextView textView = (TextView) channelBannerViewHolder._$_findCachedViewById(R.id.tvTitle);
if (str.length() > 0) {
spannableStringBuilder = MallTextHelper.f19252a.a(ChannelBrandBannerView3.this.getContext(), str, 24, fi.b.b(f));
if (str2.length() == 0) {
spannableStringBuilder.append("#", aVar, 17);
}
} else {
spannableStringBuilder = null;
}
textView.setText(spannableStringBuilder);
TextView textView2 = (TextView) channelBannerViewHolder._$_findCachedViewById(R.id.tvSubTitle);
if (str2.length() > 0) {
spannableStringBuilder2 = new SpannableStringBuilder(str2);
spannableStringBuilder2.append("#", aVar, 17);
Unit unit = Unit.INSTANCE;
} else {
spannableStringBuilder2 = null;
}
textView2.setText(spannableStringBuilder2);
((TextView) channelBannerViewHolder._$_findCachedViewById(R.id.bannerTag)).setText(channelBannerItemModel3.getTag());
List<ChannelBannerSpuItemModel> spuList = channelBannerItemModel3.getSpuList();
if (spuList == null) {
spuList = CollectionsKt__CollectionsKt.emptyList();
}
List<ChannelBannerSpuItemModel> take = CollectionsKt___CollectionsKt.take(spuList, 3);
((LinearLayout) channelBannerViewHolder._$_findCachedViewById(R.id.productContainer)).removeAllViews();
for (ChannelBannerSpuItemModel channelBannerSpuItemModel : take) {
View w = ViewExtensionKt.w((LinearLayout) channelBannerViewHolder._$_findCachedViewById(R.id.productContainer), R.layout.item_channel_brand_product_item, false, 2);
GradientDrawable d = j.d(-1);
d.setCornerRadius((float) fi.b.b(f));
Unit unit2 = Unit.INSTANCE;
w.setBackground(d);
TextView textView3 = (TextView) w.findViewById(R.id.tvCountText);
String spuFavoriteCountText = channelBannerSpuItemModel.getSpuFavoriteCountText();
if (spuFavoriteCountText == null) {
spuFavoriteCountText = "";
}
textView3.setText(spuFavoriteCountText);
DuImageLoaderView duImageLoaderView = (DuImageLoaderView) w.findViewById(R.id.ivProduct);
String imgUrl = channelBannerSpuItemModel.getImgUrl();
if (imgUrl == null) {
imgUrl = "";
}
g.a(duImageLoaderView.i(imgUrl).m0(1.0f).d0(300), DrawableScale.OneToOne).x();
com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt.e(w, 0, new ChannelBrandBannerView3$ChannelBannerViewHolder$bindData$$inlined$forEach$lambda$1(channelBannerSpuItemModel, channelBannerViewHolder), 1);
((LinearLayout) channelBannerViewHolder._$_findCachedViewById(R.id.productContainer)).addView(w);
}
boolean z = true;
((LinearLayout) channelBannerViewHolder._$_findCachedViewById(R.id.productContainer)).setVisibility(o ? 0 : 8);
((TextView) channelBannerViewHolder._$_findCachedViewById(R.id.tvSubTitle)).setVisibility(o ^ true ? 0 : 8);
TextView textView4 = (TextView) channelBannerViewHolder._$_findCachedViewById(R.id.bannerTag);
if (!o) {
String tag = channelBannerItemModel3.getTag();
}
z = false;
textView4.setVisibility(z ? 0 : 8);
}
}
}
@Override // com.youth.banner.holder.IViewHolder
public Object onCreateHolder(ViewGroup viewGroup, int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{viewGroup, new Integer(i)}, this, changeQuickRedirect, false, 211463, new Class[]{ViewGroup.class, Integer.TYPE}, ChannelBannerViewHolder.class);
if (proxy.isSupported) {
return (ChannelBannerViewHolder) proxy.result;
}
return new ChannelBannerViewHolder(ViewExtensionKt.w(viewGroup, R.layout.item_channel_brand_banner3, false, 2));
}
}
@Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0004\u0018\u00002\u00020\u00012\u00020\u0002¨\u0006\u0003"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_dynamic/channel/views/ChannelBrandBannerView3$ChannelBannerViewHolder;", "Landroidx/recyclerview/widget/RecyclerView$ViewHolder;", "Lkotlinx/android/extensions/LayoutContainer;", "du_mall_dynamic_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: ChannelBrandBannerView3.kt */
public final class ChannelBannerViewHolder extends RecyclerView.ViewHolder implements LayoutContainer {
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
public final View b;
public HashMap d;
public ChannelBannerViewHolder(@NotNull View view) {
super(view);
this.b = view;
}
public View _$_findCachedViewById(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 211467, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.d == null) {
this.d = new HashMap();
}
View view = (View) this.d.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View containerView = getContainerView();
if (containerView == null) {
return null;
}
View findViewById = containerView.findViewById(i);
this.d.put(Integer.valueOf(i), findViewById);
return findViewById;
}
@Override // kotlinx.android.extensions.LayoutContainer
@NotNull
public View getContainerView() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 211466, new Class[0], View.class);
return proxy.isSupported ? (View) proxy.result : this.b;
}
}
/* compiled from: ChannelBrandBannerView3.kt */
public static final class a implements OnPageScrolledListener {
public static ChangeQuickRedirect changeQuickRedirect;
/* renamed from: a reason: collision with root package name */
public final /* synthetic */ ChannelBrandBannerView3 f19284a;
public a(ChannelBrandBannerView3 channelBrandBannerView3) {
this.f19284a = channelBrandBannerView3;
}
@Override // com.youth.banner.listener.OnPageScrolledListener
public final void onPageScrolled(int i, float f, int i3) {
Object[] objArr = {new Integer(i), new Float(f), new Integer(i3)};
ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
Class cls = Integer.TYPE;
if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 211460, new Class[]{cls, Float.TYPE, cls}, Void.TYPE).isSupported) {
this.f19284a.q(i, f);
}
}
}
/* compiled from: ChannelBrandBannerView3.kt */
public static final class b implements OnPageSelectedListener {
public static ChangeQuickRedirect changeQuickRedirect;
/* renamed from: a reason: collision with root package name */
public final /* synthetic */ ChannelBrandBannerView3 f19285a;
public b(ChannelBrandBannerView3 channelBrandBannerView3) {
this.f19285a = channelBrandBannerView3;
}
@Override // com.youth.banner.listener.OnPageSelectedListener
public final void onPageSelected(int i) {
if (!PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 211461, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
this.f19285a.m(i);
}
}
}
/* compiled from: ChannelBrandBannerView3.kt */
public static final class c<T> implements OnBannerListener<ChannelBannerItemModel3> {
public static ChangeQuickRedirect changeQuickRedirect;
/* renamed from: a reason: collision with root package name */
public final /* synthetic */ ChannelBrandBannerView3 f19286a;
public final /* synthetic */ Context b;
public c(ChannelBrandBannerView3 channelBrandBannerView3, Context context) {
this.f19286a = channelBrandBannerView3;
this.b = context;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, int] */
@Override // com.youth.banner.listener.OnBannerListener
public void OnBannerClick(ChannelBannerItemModel3 channelBannerItemModel3, int i) {
ChannelBannerItemModel3 channelBannerItemModel32 = channelBannerItemModel3;
if (!PatchProxy.proxy(new Object[]{channelBannerItemModel32, new Integer(i)}, this, changeQuickRedirect, false, 211462, new Class[]{ChannelBannerItemModel3.class, Integer.TYPE}, Void.TYPE).isSupported) {
Map<String, String> map = null;
if (this.f19286a.o(channelBannerItemModel32, i)) {
ChannelBrandBannerView3 channelBrandBannerView3 = this.f19286a;
ChannelInnerBrand innerBrand = channelBannerItemModel32.getInnerBrand();
if (innerBrand != null) {
map = innerBrand.getTrack();
}
channelBrandBannerView3.h("recommendbanner", map);
} else {
BaseChannelView.i(this.f19286a, null, channelBannerItemModel32.getTrack(), 1, null);
}
Context context = this.b;
String redirect = channelBannerItemModel32.getRedirect();
if (redirect == null) {
redirect = "";
}
u91.e.G(context, redirect);
}
}
}
@JvmOverloads
public ChannelBrandBannerView3(@NotNull Context context) {
this(context, null, 0, 6);
}
@JvmOverloads
public ChannelBrandBannerView3(@NotNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0, 4);
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ ChannelBrandBannerView3(Context context, AttributeSet attributeSet, int i3, int i12) {
this(context, (i12 & 2) != 0 ? null : attributeSet, (i12 & 4) != 0 ? 0 : i3);
}
public View _$_findCachedViewById(int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 211457, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.j == null) {
this.j = new HashMap();
}
View view = (View) this.j.get(Integer.valueOf(i3));
if (view != null) {
return view;
}
View findViewById = findViewById(i3);
this.j.put(Integer.valueOf(i3), findViewById);
return findViewById;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // com.shizhuang.duapp.modules.mall_dynamic.channel.views.BaseChannelView
public void c(ChannelBannerModel3 channelBannerModel3) {
ChannelBannerModel3 channelBannerModel32 = channelBannerModel3;
if (!PatchProxy.proxy(new Object[]{channelBannerModel32}, this, changeQuickRedirect, false, 211456, new Class[]{ChannelBannerModel3.class}, Void.TYPE).isSupported) {
this.f19280g = -1;
ChannelBannerAdapter channelBannerAdapter = this.f;
List<ChannelBannerItemModel3> list = channelBannerModel32.getList();
if (list == null) {
list = CollectionsKt__CollectionsKt.emptyList();
}
channelBannerAdapter.setItems(list);
q(((Banner) _$_findCachedViewById(R.id.banner)).getCurrentItem(), i.f36333a);
}
}
@Override // com.shizhuang.duapp.modules.du_mall_common.utils.exposure.ModuleChildBoundExposureCallback
public void getExposureBound(@NotNull Rect rect) {
if (!PatchProxy.proxy(new Object[]{rect}, this, changeQuickRedirect, false, 211448, new Class[]{Rect.class}, Void.TYPE).isSupported) {
com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt.j((Banner) _$_findCachedViewById(R.id.banner), this, rect);
}
}
@Override // com.shizhuang.duapp.common.component.module.AbsModuleView
public int getLayoutId() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 211446, new Class[0], Integer.TYPE);
return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.layout_channel_brand_banner_view3;
}
public final void m(int i3) {
ChannelBannerModel3 channelBannerModel3;
List<ChannelBannerItemModel3> list;
ChannelBannerItemModel3 channelBannerItemModel3;
int i12 = 0;
if (!(PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 211449, new Class[]{Integer.TYPE}, Void.TYPE).isSupported || !this.f19281h || (channelBannerModel3 = (ChannelBannerModel3) getAcquireData()) == null || (list = channelBannerModel3.getList()) == null || (channelBannerItemModel3 = (ChannelBannerItemModel3) CollectionsKt___CollectionsKt.getOrNull(list, i3)) == null)) {
Map<String, String> map = null;
if (o(channelBannerItemModel3, i3)) {
ChannelInnerBrand innerBrand = channelBannerItemModel3.getInnerBrand();
if (innerBrand != null) {
map = innerBrand.getTrack();
}
j("recommendbanner", map);
List<ChannelBannerSpuItemModel> spuList = channelBannerItemModel3.getSpuList();
if (spuList != null) {
for (T t : spuList) {
int i13 = i12 + 1;
if (i12 < 0) {
CollectionsKt__CollectionsKt.throwIndexOverflow();
}
j("bannerProduct", t.getDataTrack());
i12 = i13;
}
return;
}
return;
}
BaseChannelView.k(this, null, channelBannerItemModel3.getTrack(), 1, null);
}
}
public final String n(ChannelBannerItemModel3 channelBannerItemModel3) {
boolean z = true;
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{channelBannerItemModel3}, this, changeQuickRedirect, false, 211454, new Class[]{ChannelBannerItemModel3.class}, String.class);
if (proxy.isSupported) {
return (String) proxy.result;
}
if (channelBannerItemModel3 == null) {
return "https://cdn.dewu.com/node-common/024b2ac6-744d-7ff8-3746-2a56ed111f27-1005-435.png";
}
String imgUrl = channelBannerItemModel3.getImgUrl();
if (!(imgUrl == null || imgUrl.length() == 0)) {
z = false;
}
if (!z) {
return channelBannerItemModel3.getImgUrl();
}
return "https://cdn.dewu.com/node-common/024b2ac6-744d-7ff8-3746-2a56ed111f27-1005-435.png";
}
public final boolean o(ChannelBannerItemModel3 channelBannerItemModel3, int i3) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{channelBannerItemModel3, new Integer(i3)}, this, changeQuickRedirect, false, 211455, new Class[]{ChannelBannerItemModel3.class, Integer.TYPE}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
if (i3 != 0) {
return false;
}
ChannelInnerBrand innerBrand = channelBannerItemModel3.getInnerBrand();
String brandName = innerBrand != null ? innerBrand.getBrandName() : null;
return !(brandName == null || brandName.length() == 0);
}
@Override // com.shizhuang.duapp.modules.du_mall_common.utils.IViewAppearObserver
public void onAppeared() {
boolean z = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 211450, new Class[0], Void.TYPE).isSupported;
}
@Override // com.shizhuang.duapp.modules.du_mall_common.utils.IViewAppearObserver
public void onDisappeared() {
boolean z = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 211451, new Class[0], Void.TYPE).isSupported;
}
@Override // com.shizhuang.duapp.common.component.module.IModuleExposureObserver
public void onExposure(@Nullable DuExposureHelper.State state) {
if (!PatchProxy.proxy(new Object[]{state}, this, changeQuickRedirect, false, 211447, new Class[]{DuExposureHelper.State.class}, Void.TYPE).isSupported) {
this.f19281h = true;
m(((Banner) _$_findCachedViewById(R.id.banner)).getCurrentItem());
}
}
public final void p(DuImageLoaderView duImageLoaderView, int i3) {
if (!PatchProxy.proxy(new Object[]{duImageLoaderView, new Integer(i3)}, this, changeQuickRedirect, false, 211453, new Class[]{DuImageLoaderView.class, Integer.TYPE}, Void.TYPE).isSupported) {
String n = n((ChannelBannerItemModel3) this.f.getItem(i3));
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(1711276032);
gradientDrawable.setCornerRadius((float) fi.b.b((float) 2));
((GenericDraweeHierarchy) duImageLoaderView.getHierarchy()).setActualImageScaleType(this.i);
((co.c) duImageLoaderView.i(n).q(25)).h0(gradientDrawable).d0(300).x();
}
}
public final void q(int i3, float f12) {
if (!PatchProxy.proxy(new Object[]{new Integer(i3), new Float(f12)}, this, changeQuickRedirect, false, 211452, new Class[]{Integer.TYPE, Float.TYPE}, Void.TYPE).isSupported) {
if (this.f19280g != i3) {
this.f19280g = i3;
p((DuImageLoaderView) _$_findCachedViewById(R.id.bannerBlurImageBack), i3);
int realCount = this.f.getRealCount();
if (realCount > 0) {
p((DuImageLoaderView) _$_findCachedViewById(R.id.bannerBlurImageFront), (i3 + 1) % realCount);
}
}
((DuImageLoaderView) _$_findCachedViewById(R.id.bannerBlurImageBack)).setAlpha(((float) 1) - f12);
((DuImageLoaderView) _$_findCachedViewById(R.id.bannerBlurImageFront)).setAlpha(f12);
}
}
@JvmOverloads
public ChannelBrandBannerView3(@NotNull Context context, @Nullable AttributeSet attributeSet, int i3) {
super(context, attributeSet, i3);
ChannelBannerAdapter channelBannerAdapter = new ChannelBannerAdapter();
this.f = channelBannerAdapter;
this.f19280g = -1;
this.i = new l60.a(1.5f);
LiveDataExtensionKt.b(getMainViewModel().j(), e(), new Function1<Integer, Unit>(this) {
/* class com.shizhuang.duapp.modules.mall_dynamic.channel.views.ChannelBrandBannerView3.AnonymousClass1 */
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ ChannelBrandBannerView3 this$0;
{
this.this$0 = r1;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Integer num) {
invoke(num);
return Unit.INSTANCE;
}
public final void invoke(Integer num) {
if (!PatchProxy.proxy(new Object[]{num}, this, changeQuickRedirect, false, 211459, new Class[]{Integer.class}, Void.TYPE).isSupported) {
Space space = (Space) this.this$0._$_findCachedViewById(R.id.toolbarSpace);
ViewGroup.LayoutParams layoutParams = space.getLayoutParams();
if (layoutParams != null) {
layoutParams.width = layoutParams.width;
layoutParams.height = num != null ? num.intValue() : layoutParams.height;
space.setLayoutParams(layoutParams);
return;
}
throw new TypeCastException("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
}
}
});
((Banner) _$_findCachedViewById(R.id.banner)).setAdapter(channelBannerAdapter, 0);
((Banner) _$_findCachedViewById(R.id.banner)).setIsAutoLoop(false);
((Banner) _$_findCachedViewById(R.id.banner)).setLifecycleOwner(e());
((Banner) _$_findCachedViewById(R.id.banner)).setBannerGalleryEffect(12, 8, 1.0f);
((Banner) _$_findCachedViewById(R.id.banner)).addOnPageScrolledListener(new a(this));
((Banner) _$_findCachedViewById(R.id.banner)).addOnPageSelectedListener(new b(this));
channelBannerAdapter.setOnBannerListener(new c(this, context));
}
}