package com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.viewholder;

import X.0CB;
import X.0CH;
import X.36a;
import X.6Is;
import X.7he;
import X.B3G;
import X.BTH;
import X.C3363BHj;
import X.C4855BqF;
import X.C4856BqG;
import X.C4889Bqn;
import X.C4890Bqo;
import X.C4891Bqp;
import X.C4892Bqq;
import X.C4893Bqr;
import X.C5044BtI;
import X.C5393Byv;
import X.C5502C1q;
import X.C5513C2b;
import X.Crj;
import X.D1G;
import X.DV0;
import X.KEM;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import android.view.View;
import android.widget.LinearLayout;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.bytedance.jedi.ext.adapter.JediSimpleViewHolder;
import com.ss.android.ugc.aweme.ecommerce.combinepayment.ordersubmit.OrderSubmitViewModel;
import com.ss.android.ugc.aweme.ecommerce.service.vo.Image;
import kotlin.h.b.n;

public final class ShopInfoVH extends JediSimpleViewHolder<C4893Bqr> implements 6Is {
    public static final C5044BtI LJIIIZ = new C5044BtI((byte) 0);
    public final View LJFF;
    public final Fragment LJI;
    public final Crj LJIIJ;
    public final Crj LJIIJJI = 7he.LIZ(new C4890Bqo(this));

    static {
        Covode.recordClassIndex(69170);
    }

    private final C5513C2b LJIILIIL() {
        return (C5513C2b) this.LJIIJJI.getValue();
    }

    public final OrderSubmitViewModel LJIIL() {
        return (OrderSubmitViewModel) this.LJIIJ.getValue();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final void LJ() {
        ShopInfoVH.super.LJ();
        BTH.LIZLLL.LIZ(this.LJFF, true);
        View view = this.LJFF;
        RecyclerView findViewById = view.findViewById(2131367533);
        n.LIZIZ(findViewById, "");
        view.getContext();
        findViewById.setLayoutManager(new LinearLayoutManager());
        RecyclerView findViewById2 = view.findViewById(2131367533);
        n.LIZIZ(findViewById2, "");
        findViewById2.setAdapter(LJIILIIL());
    }

    /* JADX WARNING: type inference failed for: r0v17, types: [android.view.View$OnClickListener, X.BqF] */
    public final /* synthetic */ void LIZ(Object obj) {
        boolean z;
        B3G b3g;
        B3G thumbFirstImageUrlModel;
        C4893Bqr bqr = (C4893Bqr) obj;
        M12.LIZ(bqr);
        View view = this.LJFF;
        Image image = bqr.LIZIZ;
        if (!(image == null || (thumbFirstImageUrlModel = image.toThumbFirstImageUrlModel()) == null)) {
            QJt LIZ = QHW.LIZ(thumbFirstImageUrlModel);
            LIZ.LJJIIZ = view.findViewById(2131370286);
            LIZ.LIZJ();
        }
        LJIILIIL().LIZ(bqr.LIZLLL);
        Qeg findViewById = view.findViewById(2131370290);
        n.LIZIZ(findViewById, "");
        findViewById.setText(bqr.LIZJ);
        C4889Bqn bqn = bqr.LJI;
        if (bqn != null) {
            Qeg findViewById2 = view.findViewById(2131369029);
            n.LIZIZ(findViewById2, "");
            findViewById2.setText(bqn.LIZ);
            C5393Byv byv = C5393Byv.LIZIZ;
            Image image2 = bqn.LIZIZ;
            if (image2 != null) {
                b3g = image2.toThumbFirstImageUrlModel();
            } else {
                b3g = null;
            }
            QJt LIZ2 = byv.LIZ((Object) b3g);
            LIZ2.LJJIIZ = view.findViewById(2131369027);
            LIZ2.LIZJ();
        }
        LinearLayout linearLayout = (LinearLayout) view.findViewById(2131369028);
        if (linearLayout != null) {
            if (bqr.LJI != null) {
                z = true;
            } else {
                z = false;
            }
            C5502C1q.LIZ((View) linearLayout, z);
        }
        if (bqr.LIZLLL.size() == 1) {
            View findViewById3 = view.findViewById(2131362863);
            n.LIZIZ(findViewById3, "");
            C5502C1q.LIZ(findViewById3, false);
            View findViewById4 = view.findViewById(2131362864);
            n.LIZIZ(findViewById4, "");
            C5502C1q.LIZ(findViewById4, false);
        } else if (bqr.LIZLLL.size() > 1 && 36a.LIZ(bqr.LJFF)) {
            View findViewById5 = view.findViewById(2131362863);
            n.LIZIZ(findViewById5, "");
            C5502C1q.LIZ(findViewById5, true);
            View findViewById6 = view.findViewById(2131362864);
            n.LIZIZ(findViewById6, "");
            C5502C1q.LIZ(findViewById6, true);
            C5044BtI btI = LJIIIZ;
            View findViewById7 = view.findViewById(2131362863);
            n.LIZIZ(findViewById7, "");
            btI.LIZ(findViewById7, LJIIL(), bqr);
        }
        withState(LJIIL(), new C4892Bqq(view, this, bqr));
        ConstraintLayout findViewById8 = view.findViewById(2131367601);
        n.LIZIZ(findViewById8, "");
        findViewById8.setVisibility(0);
        ConstraintLayout findViewById9 = view.findViewById(2131367601);
        n.LIZIZ(findViewById9, "");
        findViewById9.setOnClickListener(new C4855BqF(view, this, bqr));
        DV0.LIZ(this, LJIIL(), C4891Bqp.LIZ, new C4856BqG(view, this, bqr));
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public ShopInfoVH(View view, Fragment fragment) {
        super(view);
        M12.LIZ(view, fragment);
        this.LJFF = view;
        this.LJI = fragment;
        D1G LIZ = KEM.LIZ.LIZ(OrderSubmitViewModel.class);
        this.LJIIJ = 7he.LIZ(new C3363BHj(this, LIZ, LIZ));
    }
}
