得物.apk(点击下载) / SellerSVIPMarginDetailsView.java
package com.shizhuang.duapp.modules.mall_seller.merchant.margin.views;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.ViewModelLazy;
import androidx.recyclerview.widget.RecyclerView;
import b50.b;
import b50.c;
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.base.inter.IViewController;
import com.shizhuang.duapp.common.component.module.DuModuleAdapter;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.helper.loadmore.LoadMoreHelper;
import com.shizhuang.duapp.common.utils.livebus.PageEventBus;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.api.LoadResultKt;
import com.shizhuang.duapp.modules.du_mall_common.extension.LiveDataExtensionKt;
import com.shizhuang.duapp.modules.mall_seller.merchant.margin.helper.HalfExpandedType;
import com.shizhuang.duapp.modules.mall_seller.merchant.margin.helper.HalfExpandedUiHelper;
import com.shizhuang.duapp.modules.mall_seller.merchant.margin.model.SellerMarginItemDate;
import com.shizhuang.duapp.modules.mall_seller.merchant.margin.model.SellerMarginModel;
import com.shizhuang.duapp.modules.mall_seller.merchant.margin.viewmodel.SellerSVIPMarginViewModel;
import java.util.HashMap;
import java.util.List;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.JvmOverloads;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Reflection;
import o5.i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import qu0.c;
import qu0.d;
@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\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\u00020\u00012\u00020\u0002B'\b\u0007\u0012\u0006\u0010\n\u001a\u00020\t\u0012\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u000b\u0012\b\b\u0002\u0010\u000e\u001a\u00020\r¢\u0006\u0004\b\u000f\u0010\u0010R\u001b\u0010\b\u001a\u00020\u00038BX\u0002¢\u0006\f\n\u0004\b\u0004\u0010\u0005\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0011"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_seller/merchant/margin/views/SellerSVIPMarginDetailsView;", "Landroid/widget/LinearLayout;", "Lcom/shizhuang/duapp/modules/mall_seller/merchant/margin/helper/HalfExpandedUiHelper$OnHalfExpandedUiCallback;", "Lcom/shizhuang/duapp/modules/mall_seller/merchant/margin/viewmodel/SellerSVIPMarginViewModel;", "b", "Lkotlin/Lazy;", "getViewModel", "()Lcom/shizhuang/duapp/modules/mall_seller/merchant/margin/viewmodel/SellerSVIPMarginViewModel;", "viewModel", "Landroid/content/Context;", "context", "Landroid/util/AttributeSet;", "attrs", "", "defStyleAttr", "<init>", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "du_mall_seller_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: SellerSVIPMarginDetailsView.kt */
public final class SellerSVIPMarginDetailsView extends LinearLayout implements HalfExpandedUiHelper.OnHalfExpandedUiCallback {
public static ChangeQuickRedirect changeQuickRedirect;
public final Lazy b;
/* renamed from: c reason: collision with root package name */
public final DuModuleAdapter f20387c;
public LoadMoreHelper d;
public HashMap e;
@JvmOverloads
public SellerSVIPMarginDetailsView(@NotNull Context context) {
this(context, null, 0);
}
public View a(int i) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 228081, 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;
}
public final SellerSVIPMarginViewModel getViewModel() {
PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 228076, new Class[0], SellerSVIPMarginViewModel.class);
return (SellerSVIPMarginViewModel) (proxy.isSupported ? proxy.result : this.b.getValue());
}
@Override // com.shizhuang.duapp.modules.mall_seller.merchant.margin.helper.HalfExpandedUiHelper.OnHalfExpandedUiCallback
public void onSlide(@NotNull View view, float f) {
boolean z = PatchProxy.proxy(new Object[]{view, new Float(f)}, this, changeQuickRedirect, false, 228080, new Class[]{View.class, Float.TYPE}, Void.TYPE).isSupported;
}
@Override // com.shizhuang.duapp.modules.mall_seller.merchant.margin.helper.HalfExpandedUiHelper.OnHalfExpandedUiCallback
public void onStateChanged(@NotNull View view, @NotNull HalfExpandedType halfExpandedType) {
if (!PatchProxy.proxy(new Object[]{view, halfExpandedType}, this, changeQuickRedirect, false, 228079, new Class[]{View.class, HalfExpandedType.class}, Void.TYPE).isSupported) {
SellerSVIPMarginDetailsView$onStateChanged$1 sellerSVIPMarginDetailsView$onStateChanged$1 = new SellerSVIPMarginDetailsView$onStateChanged$1(this);
SellerSVIPMarginDetailsView$onStateChanged$2 sellerSVIPMarginDetailsView$onStateChanged$2 = new SellerSVIPMarginDetailsView$onStateChanged$2(this);
int i = c.f37535a[halfExpandedType.ordinal()];
if (i == 1) {
sellerSVIPMarginDetailsView$onStateChanged$1.invoke(i.f36333a);
sellerSVIPMarginDetailsView$onStateChanged$2.invoke();
} else if (i == 2) {
sellerSVIPMarginDetailsView$onStateChanged$1.invoke(180.0f);
sellerSVIPMarginDetailsView$onStateChanged$2.invoke();
}
}
}
@JvmOverloads
public SellerSVIPMarginDetailsView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
@JvmOverloads
public SellerSVIPMarginDetailsView(@NotNull final Context context, @Nullable AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
AppCompatActivity g3 = ViewExtensionKt.g(this);
this.b = new ViewModelLazy(Reflection.getOrCreateKotlinClass(SellerSVIPMarginViewModel.class), new SellerSVIPMarginDetailsView$$special$$inlined$activityViewModels$2(g3), new SellerSVIPMarginDetailsView$$special$$inlined$activityViewModels$1(g3));
DuModuleAdapter duModuleAdapter = new DuModuleAdapter(false, 0, null, 7);
this.f20387c = duModuleAdapter;
ViewExtensionKt.v(this, R.layout.activity_seller_svip_margin_details, true);
((DuImageLoaderView) a(R.id.arrowDetails)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/merchant/icon_arrow_condensed_line@3x.png").x();
ViewExtensionKt.j((DuImageLoaderView) a(R.id.arrowDetails), 0, new Function0<Unit>() {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.margin.views.SellerSVIPMarginDetailsView.AnonymousClass1 */
public static ChangeQuickRedirect changeQuickRedirect;
@Override // kotlin.jvm.functions.Function0
public final void invoke() {
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 228085, new Class[0], Void.TYPE).isSupported) {
PageEventBus.g(context).e("SVIP_MARGINS_WITCH_EXPAND_STATE");
}
}
}, 1);
duModuleAdapter.getDelegate().C(SellerMarginItemDate.class, 1, null, -1, true, null, null, new Function1<ViewGroup, SellerMarginItemView>() {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.margin.views.SellerSVIPMarginDetailsView.AnonymousClass2 */
public static ChangeQuickRedirect changeQuickRedirect;
@NotNull
public final SellerMarginItemView invoke(@NotNull ViewGroup viewGroup) {
PatchProxyResult proxy = PatchProxy.proxy(new Object[]{viewGroup}, this, changeQuickRedirect, false, 228086, new Class[]{ViewGroup.class}, SellerMarginItemView.class);
return proxy.isSupported ? (SellerMarginItemView) proxy.result : new SellerMarginItemView(context, null, 0, 6);
}
});
((RecyclerView) a(R.id.recyclerViewDetails)).setAdapter(duModuleAdapter);
if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 228078, new Class[0], Void.TYPE).isSupported) {
LoadMoreHelper f = LoadMoreHelper.f(new d(this));
f.d((RecyclerView) a(R.id.recyclerViewDetails));
f.k(true);
Unit unit = Unit.INSTANCE;
this.d = f;
}
LiveDataExtensionKt.b(getViewModel().getDetailsLiveData(), h.f(this), new Function1<List<? extends SellerMarginItemDate>, Unit>(this) {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.margin.views.SellerSVIPMarginDetailsView.AnonymousClass3 */
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ SellerSVIPMarginDetailsView 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(List<? extends SellerMarginItemDate> list) {
invoke((List<SellerMarginItemDate>) list);
return Unit.INSTANCE;
}
public final void invoke(@NotNull List<SellerMarginItemDate> list) {
if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 228087, new Class[]{List.class}, Void.TYPE).isSupported) {
SellerSVIPMarginDetailsView sellerSVIPMarginDetailsView = this.this$0;
if (!PatchProxy.proxy(new Object[]{list}, sellerSVIPMarginDetailsView, SellerSVIPMarginDetailsView.changeQuickRedirect, false, 228077, new Class[]{List.class}, Void.TYPE).isSupported) {
sellerSVIPMarginDetailsView.f20387c.setItems(list);
}
}
}
});
if (context instanceof IViewController) {
LiveDataExtensionKt.c(getViewModel().getPageResult(), h.f(this), (IViewController) context, new Function1<b.d<? extends SellerMarginModel>, Unit>(this) {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.margin.views.SellerSVIPMarginDetailsView.AnonymousClass4 */
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ SellerSVIPMarginDetailsView 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(b.d<? extends SellerMarginModel> dVar) {
invoke((b.d<SellerMarginModel>) dVar);
return Unit.INSTANCE;
}
public final void invoke(@NotNull b.d<SellerMarginModel> dVar) {
if (!PatchProxy.proxy(new Object[]{dVar}, this, changeQuickRedirect, false, 228088, new Class[]{b.d.class}, Void.TYPE).isSupported) {
List<SellerMarginItemDate> list = dVar.a().getList();
if ((list == null || !(!list.isEmpty())) && !(!this.this$0.f20387c.getList().isEmpty())) {
((IViewController) context).showEmptyView();
} else {
((IViewController) context).showDataView();
}
}
}
});
}
LoadResultKt.j(getViewModel().getLoadStatus(), h.f(this), null, new Function1<c.a, Unit>(this) {
/* class com.shizhuang.duapp.modules.mall_seller.merchant.margin.views.SellerSVIPMarginDetailsView.AnonymousClass5 */
public static ChangeQuickRedirect changeQuickRedirect;
public final /* synthetic */ SellerSVIPMarginDetailsView 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(c.a aVar) {
invoke(aVar);
return Unit.INSTANCE;
}
public final void invoke(@NotNull c.a aVar) {
if (!PatchProxy.proxy(new Object[]{aVar}, this, changeQuickRedirect, false, 228089, new Class[]{c.a.class}, Void.TYPE).isSupported) {
if (aVar.a()) {
LoadMoreHelper loadMoreHelper = this.this$0.d;
if (loadMoreHelper != null) {
loadMoreHelper.b("more");
return;
}
return;
}
LoadMoreHelper loadMoreHelper2 = this.this$0.d;
if (loadMoreHelper2 != null) {
loadMoreHelper2.m();
}
}
}
}, 2);
}
}