得物.apk(点击下载) / McLightingInfoView.java
package com.shizhuang.duapp.modules.mall_seller.merchant.center.view;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.Group;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import bu0.s;
import bu0.t;
import cd.h;
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.NormalModuleAdapter;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.widget.font.IconFontTextView;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.modules.mall_seller.merchant.center.model.MerchantDepositItemModel;
import com.shizhuang.duapp.modules.mall_seller.merchant.center.model.OrderWareHouseEntranceModel;
import com.shizhuang.duapp.modules.mall_seller.widget.RecyclerHIndicator;
import df.b0;
import fi.b;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Ref;
import mn.a;
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\b\u0005\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0006\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001R\u0017\u0010\b\u001a\u00020\u00038\u0006¢\u0006\f\n\u0004\b\u0004\u0010\u0005\u001a\u0004\b\u0006\u0010\u0007R\u001f\u0010\u000f\u001a\n\u0012\u0004\u0012\u00020\n\u0018\u00010\t8\u0006¢\u0006\f\n\u0004\b\u000b\u0010\f\u001a\u0004\b\r\u0010\u000e¨\u0006\u0010"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_seller/merchant/center/view/McLightingInfoView;", "Lcom/shizhuang/duapp/modules/mall_seller/merchant/center/view/MCBaseView;", "Lbu0/s;", "Lcom/shizhuang/duapp/common/component/module/NormalModuleAdapter;", "c", "Lcom/shizhuang/duapp/common/component/module/NormalModuleAdapter;", "getAdapter", "()Lcom/shizhuang/duapp/common/component/module/NormalModuleAdapter;", "adapter", "Lkotlin/Function0;", "", "d", "Lkotlin/jvm/functions/Function0;", "getApplyLightingCallBack", "()Lkotlin/jvm/functions/Function0;", "applyLightingCallBack", "du_mall_seller_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: McLightingInfoView.kt */
public final class McLightingInfoView extends MCBaseView<s> {
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
/* renamed from: c reason: collision with root package name */
public final NormalModuleAdapter f20294c;
@Nullable
public final Function0<Unit> d;
public HashMap e;
@JvmOverloads
public McLightingInfoView(@NotNull Context context) {
this(context, null, 0, null, 14);
}
@JvmOverloads
public McLightingInfoView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0, null, 12);
}
@JvmOverloads
public McLightingInfoView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
this(context, attributeSet, i, null, 8);
}
/* JADX WARNING: Illegal instructions before constructor call */
public McLightingInfoView(final Context context, AttributeSet attributeSet, int i, Function0 function0, int i3) {
super(context, r2, r4);
Function0 function02 = null;
AttributeSet attributeSet2 = (i3 & 2) != 0 ? null : attributeSet;
int i12 = (i3 & 4) != 0 ? 0 : i;
function02 = (i3 & 8) == 0 ? function0 : function02;
this.d = function02;
NormalModuleAdapter normalModuleAdapter = new NormalModuleAdapter(false, 1);
this.f20294c = normalModuleAdapter;
ViewExtensionKt.v(this, R.layout.mc_view_lighting_info, true);
((DuRequestOptions) a.f35714a.g("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/merchant/deposit_more_hint_bg.png").u(new Function1<Bitmap, Unit>() {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.center.view.McLightingInfoView.AnonymousClass1 */
public static ChangeQuickRedirect changeQuickRedirect;
/* 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(Bitmap bitmap) {
invoke(bitmap);
return Unit.INSTANCE;
}
public final void invoke(@NotNull Bitmap bitmap) {
if (!PatchProxy.proxy(new Object[]{bitmap}, this, changeQuickRedirect, false, 225678, new Class[]{Bitmap.class}, Void.TYPE).isSupported) {
((RelativeLayout) McLightingInfoView.this._$_findCachedViewById(R.id.depositMoreHint)).setBackground(new BitmapDrawable(McLightingInfoView.this.getResources(), bitmap));
}
}
})).G(h.f(this)).y();
((RecyclerView) _$_findCachedViewById(R.id.recyclerDeposit)).setLayoutManager(new LinearLayoutManager(context, 0, false));
normalModuleAdapter.getDelegate().C(MerchantDepositItemModel.class, 1, null, -1, true, null, null, new Function1<ViewGroup, McDepositItemView>() {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.center.view.McLightingInfoView.AnonymousClass2 */
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
public final McDepositItemView invoke(@NotNull ViewGroup viewGroup) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{viewGroup}, this, changeQuickRedirect, false, 225679, new Class[]{ViewGroup.class}, McDepositItemView.class);
return proxy.isSupported ? (McDepositItemView) proxy.result : new McDepositItemView(context, null, 0, McLightingInfoView.this.getApplyLightingCallBack(), 6);
}
});
((RecyclerView) _$_findCachedViewById(R.id.recyclerDeposit)).setAdapter(normalModuleAdapter);
((RecyclerView) _$_findCachedViewById(R.id.recyclerDeposit)).addOnItemTouchListener(new RecyclerView.OnItemTouchListener(this) {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.center.view.McLightingInfoView.AnonymousClass3 */
public static ChangeQuickRedirect changeQuickRedirect;
public float b;
/* renamed from: c reason: collision with root package name */
public float f20297c;
public boolean d;
public final int e;
/* JADX WARN: Incorrect args count in method signature: ()V */
{
this.e = ViewConfiguration.get(r1.getContext()).getScaledTouchSlop();
}
@Override // androidx.recyclerview.widget.RecyclerView.OnItemTouchListener
public boolean onInterceptTouchEvent(@NotNull RecyclerView recyclerView, @NotNull MotionEvent motionEvent) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{recyclerView, motionEvent}, this, changeQuickRedirect, false, 225687, new Class[]{RecyclerView.class, MotionEvent.class}, Boolean.TYPE);
if (proxy.isSupported) {
return ((Boolean) proxy.result).booleanValue();
}
if (motionEvent.getAction() == 0) {
this.b = motionEvent.getX();
this.f20297c = motionEvent.getY();
this.d = false;
recyclerView.getParent().requestDisallowInterceptTouchEvent(true);
} else if (motionEvent.getAction() == 2 && !this.d) {
float x = motionEvent.getX() - this.b;
float y = motionEvent.getY() - this.f20297c;
if (Math.abs(y) > ((float) this.e) || Math.abs(x) > ((float) this.e)) {
this.d = true;
if (Math.abs(x) < Math.abs(y)) {
recyclerView.getParent().requestDisallowInterceptTouchEvent(false);
} else {
recyclerView.getParent().requestDisallowInterceptTouchEvent(true);
}
}
}
return false;
}
@Override // androidx.recyclerview.widget.RecyclerView.OnItemTouchListener
public void onRequestDisallowInterceptTouchEvent(boolean z) {
boolean z4 = PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 225689, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported;
}
@Override // androidx.recyclerview.widget.RecyclerView.OnItemTouchListener
public void onTouchEvent(@NotNull RecyclerView recyclerView, @NotNull MotionEvent motionEvent) {
boolean z = PatchProxy.proxy(new Object[]{recyclerView, motionEvent}, this, changeQuickRedirect, false, 225688, new Class[]{RecyclerView.class, MotionEvent.class}, Void.TYPE).isSupported;
}
});
((RecyclerHIndicator) _$_findCachedViewById(R.id.depositIndicator)).a((RecyclerView) _$_findCachedViewById(R.id.recyclerDeposit));
}
public View _$_findCachedViewById(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 225676, new Class[]{Integer.TYPE}, View.class);
if (proxy.isSupported) {
return (View) proxy.result;
}
if (this.e == null) {
this.e = new HashMap();
}
View view = (View) this.e.get(Integer.valueOf(i));
if (view != null) {
return view;
}
View findViewById = findViewById(i);
this.e.put(Integer.valueOf(i), findViewById);
return findViewById;
}
@NotNull
public final NormalModuleAdapter getAdapter() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 225672, new Class[0], NormalModuleAdapter.class);
return proxy.isSupported ? (NormalModuleAdapter) proxy.result : this.f20294c;
}
@Nullable
public final Function0<Unit> getApplyLightingCallBack() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 225675, new Class[0], Function0.class);
return proxy.isSupported ? (Function0) proxy.result : this.d;
}
@Override // com.shizhuang.duapp.common.component.module.AbsModuleView
public void onChanged(Object obj) {
s sVar = (s) obj;
boolean z = true;
int i = 0;
if (!PatchProxy.proxy(new Object[]{sVar}, this, changeQuickRedirect, false, 225674, new Class[]{s.class}, Void.TYPE).isSupported) {
if (sVar.b().size() > 4 && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 225673, new Class[0], Void.TYPE).isSupported && !((Boolean) b0.f("SHOW_DEPOSIT_MODULE_ANIM", Boolean.FALSE)).booleanValue()) {
ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, (float) b.b((float) 40));
ofFloat.setDuration(500L);
ofFloat.setRepeatCount(0);
Ref.BooleanRef booleanRef = new Ref.BooleanRef();
booleanRef.element = false;
ofFloat.addUpdateListener(new t(this));
ofFloat.addListener(new McLightingInfoView$initAnim$$inlined$doOnEnd$1(this, booleanRef, ofFloat));
ofFloat.start();
}
OrderWareHouseEntranceModel a5 = sVar.a();
boolean z4 = a5 != null && a5.getHasActivity();
((DuImageLoaderView) _$_findCachedViewById(R.id.ivWareHousingIcon)).setVisibility(z4 ? 0 : 8);
((TextView) _$_findCachedViewById(R.id.tvWarehousing)).setVisibility(z4 ? 0 : 8);
((IconFontTextView) _$_findCachedViewById(R.id.tvWareHousingEntranceTip)).setVisibility(z4 ? 0 : 8);
ViewExtensionKt.h((RelativeLayout) _$_findCachedViewById(R.id.llWareHousingEntranceParent), new McLightingInfoView$onChanged$1(this, z4));
DuImageLoaderView duImageLoaderView = (DuImageLoaderView) _$_findCachedViewById(R.id.ivWareHousingIcon);
OrderWareHouseEntranceModel a12 = sVar.a();
String str = null;
String activityLogoUrl = a12 != null ? a12.getActivityLogoUrl() : null;
String str2 = "";
if (activityLogoUrl == null) {
activityLogoUrl = str2;
}
duImageLoaderView.i(activityLogoUrl).x();
TextView textView = (TextView) _$_findCachedViewById(R.id.tvWarehousing);
OrderWareHouseEntranceModel a13 = sVar.a();
if (a13 != null) {
str = a13.getActivityTitle();
}
if (str != null) {
str2 = str;
}
textView.setText(str2);
this.f20294c.setItems(sVar.b());
Group group = (Group) _$_findCachedViewById(R.id.groupDeposit);
if (sVar.b().size() <= 4) {
z = false;
}
if (!z) {
i = 8;
}
group.setVisibility(i);
}
}
}