得物.apk(点击下载) / IMCOrderView.java


package com.shizhuang.duapp.modules.mall_seller.merchant.center.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import bu0.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.AbsModuleView;
import com.shizhuang.duapp.common.component.module.NormalModuleAdapter;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.mall_seller.merchant.center.individual_model.model.OrderInfo;
import com.shizhuang.duapp.modules.mall_seller.merchant.center.individual_model.model.OrderManagement;
import fi.b;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.JvmOverloads;
import kotlin.text.StringsKt__StringsJVMKt;
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\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B'\b\u0007\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0006\u001a\u0004\u0018\u00010\u0005\u0012\b\b\u0002\u0010\b\u001a\u00020\u0007¢\u0006\u0004\b\t\u0010\n¨\u0006\u000b"}, d2 = {"Lcom/shizhuang/duapp/modules/mall_seller/merchant/center/view/IMCOrderView;", "Lcom/shizhuang/duapp/common/component/module/AbsModuleView;", "Lbu0/h;", "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: IMCOrderView.kt */
public final class IMCOrderView extends AbsModuleView<h> {
    public static ChangeQuickRedirect changeQuickRedirect;
    public final NormalModuleAdapter b;

    /* renamed from: c  reason: collision with root package name */
    public HashMap f20276c;

    @JvmOverloads
    public IMCOrderView(@NotNull Context context) {
        this(context, null, 0, 6);
    }

    @JvmOverloads
    public IMCOrderView(@NotNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0, 4);
    }

    @JvmOverloads
    public IMCOrderView(@NotNull Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        NormalModuleAdapter normalModuleAdapter = new NormalModuleAdapter(false, 1);
        this.b = normalModuleAdapter;
        ViewExtensionKt.v(this, R.layout.layout_imc_order, true);
        normalModuleAdapter.getDelegate().C(OrderInfo.class, 1, null, -1, true, null, null, AnonymousClass1.INSTANCE);
        ((RecyclerView) _$_findCachedViewById(R.id.orderRecyclerView)).setLayoutManager(new LinearLayoutManager(context, 0, false));
        ((RecyclerView) _$_findCachedViewById(R.id.orderRecyclerView)).setAdapter(normalModuleAdapter);
    }

    public View _$_findCachedViewById(int i) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 225479, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.f20276c == null) {
            this.f20276c = new HashMap();
        }
        View view = (View) this.f20276c.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.f20276c.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
    @Override // com.shizhuang.duapp.common.component.module.IModuleView, com.shizhuang.duapp.common.component.module.AbsModuleView
    public void update(h hVar) {
        T t;
        h hVar2 = hVar;
        int i = 0;
        if (!PatchProxy.proxy(new Object[]{hVar2}, this, changeQuickRedirect, false, 225478, new Class[]{h.class}, Void.TYPE).isSupported) {
            super.update(hVar2);
            OrderManagement orderManagement = hVar2.a().getOrderManagement();
            if (orderManagement != null) {
                ((TextView) _$_findCachedViewById(R.id.tvOrder)).setText(orderManagement.getTitle());
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivOrder)).i(orderManagement.getIconUrl()).x();
                ((DuImageLoaderView) _$_findCachedViewById(R.id.maskOrder)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/merchant/bg_imc_list_mask_02.png").x();
                ViewExtensionKt.j((FrameLayout) _$_findCachedViewById(R.id.clOrder), 0, new IMCOrderView$update$$inlined$let$lambda$1(orderManagement, this), 1);
            }
            List<OrderInfo> orderInfoList = hVar2.a().getOrderInfoList();
            if (orderInfoList == null) {
                orderInfoList = CollectionsKt__CollectionsKt.emptyList();
            }
            ViewGroup.LayoutParams layoutParams = ((RecyclerView) _$_findCachedViewById(R.id.orderRecyclerView)).getLayoutParams();
            if (layoutParams instanceof ConstraintLayout.LayoutParams) {
                ConstraintLayout.LayoutParams layoutParams2 = (ConstraintLayout.LayoutParams) layoutParams;
                Iterator<T> it2 = orderInfoList.iterator();
                while (true) {
                    if (!it2.hasNext()) {
                        t = null;
                        break;
                    }
                    t = it2.next();
                    String subtitle = t.getSubtitle();
                    if (!(subtitle == null || StringsKt__StringsJVMKt.isBlank(subtitle))) {
                        break;
                    }
                }
                if (t != null) {
                    i = b.b((float) 8);
                }
                ((ViewGroup.MarginLayoutParams) layoutParams2).bottomMargin = i;
            }
            this.b.setItems(orderInfoList);
        }
    }

    /* JADX INFO: this call moved to the top of the method (can break code semantics) */
    public /* synthetic */ IMCOrderView(Context context, AttributeSet attributeSet, int i, int i3) {
        this(context, (i3 & 2) != 0 ? null : attributeSet, (i3 & 4) != 0 ? 0 : i);
    }
}