package com.ss.android.ugc.aweme.ecommerce.semipdp.vh;

import X.0CB;
import X.0CH;
import X.3SM;
import X.6Is;
import X.7he;
import X.BI1;
import X.BTH;
import X.C6076CNs;
import X.C6082CNy;
import X.C6099COp;
import X.CH4;
import X.CNV;
import X.CO0;
import X.CWR;
import X.Crj;
import X.D1G;
import X.DV0;
import X.KEM;
import X.M12;
import X.Qeg;
import X.StM;
import X.T3l;
import android.view.View;
import androidx.appcompat.widget.AppCompatImageView;
import com.bytedance.covode.number.Covode;
import com.bytedance.jedi.ext.adapter.JediSimpleViewHolder;
import com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel;
import com.ss.android.ugc.aweme.ecommerce.semipdp.SemiPdpViewModel;
import com.ss.android.ugc.aweme.ecommerce.service.vo.Image;
import java.util.List;
import kotlin.h.b.n;

public final class SemiPdpHeaderVH extends JediSimpleViewHolder<CNV> implements 6Is {
    public int LJFF;
    public CWR LJI;
    public final View LJIIIZ;
    public final Crj LJIIJ;

    static {
        Covode.recordClassIndex(72453);
    }

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

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

    public final void LJ() {
        SemiPdpHeaderVH.super.LJ();
        BTH.LIZLLL.LIZ(this.LJIIIZ, false);
        DV0.LIZ(this, LJIIL(), C6099COp.LIZ, new CO0(this));
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public SemiPdpHeaderVH(View view) {
        super(view);
        M12.LIZ(view);
        this.LJIIIZ = view;
        D1G LIZ = KEM.LIZ.LIZ(SemiPdpViewModel.class);
        this.LJIIJ = 7he.LIZ(new BI1(this, LIZ, LIZ));
    }

    public final /* synthetic */ void LIZ(Object obj) {
        boolean z;
        CNV cnv = (CNV) obj;
        M12.LIZ(cnv);
        View view = this.LJIIIZ;
        List<Image> list = cnv.LIZ;
        if (list == null || list.isEmpty()) {
            z = true;
        } else {
            z = false;
        }
        if (z) {
            StM findViewById = view.findViewById(2131363581);
            n.LIZIZ(findViewById, "");
            findViewById.setVisibility(8);
            View view2 = this.itemView;
            n.LIZIZ(view2, "");
            AppCompatImageView findViewById2 = view2.findViewById(2131363582);
            n.LIZIZ(findViewById2, "");
            findViewById2.setVisibility(0);
            return;
        }
        StM findViewById3 = view.findViewById(2131363581);
        n.LIZIZ(findViewById3, "");
        findViewById3.setVisibility(0);
        View view3 = this.itemView;
        n.LIZIZ(view3, "");
        AppCompatImageView findViewById4 = view3.findViewById(2131363582);
        n.LIZIZ(findViewById4, "");
        findViewById4.setVisibility(8);
        List<Image> list2 = cnv.LIZ;
        StM findViewById5 = view.findViewById(2131363581);
        n.LIZIZ(findViewById5, "");
        CWR cwr = new CWR(list2, findViewById5, "semi_pdp_head", (PdpViewModel) null);
        this.LJI = cwr;
        cwr.LIZ = LJIIL().LIZJ;
        CWR cwr2 = this.LJI;
        if (cwr2 != null) {
            cwr2.LIZLLL = new C6082CNy(this, cnv);
        }
        CWR cwr3 = this.LJI;
        if (cwr3 != null) {
            cwr3.LIZIZ = new CH4(this, cnv);
        }
        T3l findViewById6 = view.findViewById(2131363581);
        n.LIZIZ(findViewById6, "");
        findViewById6.setAdapter(this.LJI);
        Qeg findViewById7 = view.findViewById(2131365972);
        n.LIZIZ(findViewById7, "");
        findViewById7.setText(3SM.LJIIIIZZ.LIZ(String.valueOf(this.LJFF + 1), String.valueOf(cnv.LIZ.size())));
        LJIIL().LJIIJJI.add(cnv.LIZ.get(0));
        T3l findViewById8 = view.findViewById(2131363581);
        n.LIZIZ(findViewById8, "");
        findViewById8.setCurrentItem(this.LJFF);
        view.findViewById(2131363581).setOnPageChangeListener(new C6076CNs(view, this, cnv));
    }
}
