package com.ss.android.ugc.aweme.ecommerce.pdp.vh.desc;

import X.070;
import X.0CB;
import X.0CH;
import X.3Pm;
import X.3SB;
import X.4r1;
import X.6Is;
import X.C5930CIc;
import X.C6042CMk;
import X.C6348CYe;
import X.CBZ;
import X.CIO;
import X.CIP;
import X.CIR;
import X.COS;
import X.COU;
import X.Crj;
import X.F1s;
import X.LnI;
import X.LsC;
import X.M12;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.ecommerce.pdp.vh.AbsBrickFullSpanVH;
import kotlin.h.b.n;

public final class ProductDescTextViewHolder extends AbsBrickFullSpanVH<C6042CMk> implements 6Is {
    public final Crj LJFF;
    public final LsC<Integer, Object> LJI;
    public boolean LJIIIZ;

    static {
        Covode.recordClassIndex(71701);
    }

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

    public final void LJI() {
        ProductDescTextViewHolder.super.LJI();
        if (n.LIZ(((C6042CMk) LJIIJJI()).LIZJ, "title")) {
            LIZ(new C5930CIc(LJIIJJI(), (byte) 0));
        } else {
            LIZ((C5930CIc) null);
        }
    }

    /* access modifiers changed from: private */
    public void LIZ(C6042CMk cMk) {
        int i;
        int i2;
        C6042CMk cMk2 = cMk;
        M12.LIZ(cMk2);
        super.LIZ(cMk2);
        View view = this.itemView;
        n.LIZIZ(view, "");
        3Pm findViewById = view.findViewById(2131371081);
        String str = cMk2.LIZJ;
        int hashCode = str.hashCode();
        if (hashCode != 3735) {
            if (hashCode != 3556653) {
                if (hashCode == 110371416 && str.equals("title")) {
                    Object invoke = this.LJI.invoke(Integer.valueOf(getAbsoluteAdapterPosition() + 1));
                    findViewById.setTuxFont(42);
                    if (!(invoke instanceof C6042CMk) || !n.LIZ(((C6042CMk) invoke).LIZJ, "text")) {
                        View view2 = this.itemView;
                        View view3 = this.itemView;
                        n.LIZIZ(view3, "");
                        int paddingLeft = view3.getPaddingLeft();
                        Resources system = Resources.getSystem();
                        n.LIZIZ(system, "");
                        int LIZ = LnI.LIZ(TypedValue.applyDimension(1, 20.0f, system.getDisplayMetrics()));
                        View view4 = this.itemView;
                        n.LIZIZ(view4, "");
                        int paddingRight = view4.getPaddingRight();
                        Resources system2 = Resources.getSystem();
                        n.LIZIZ(system2, "");
                        view2.setPadding(paddingLeft, LIZ, paddingRight, LnI.LIZ(TypedValue.applyDimension(1, 11.0f, system2.getDisplayMetrics())));
                    } else {
                        View view5 = this.itemView;
                        View view6 = this.itemView;
                        n.LIZIZ(view6, "");
                        int paddingLeft2 = view6.getPaddingLeft();
                        Resources system3 = Resources.getSystem();
                        n.LIZIZ(system3, "");
                        int LIZ2 = LnI.LIZ(TypedValue.applyDimension(1, 20.0f, system3.getDisplayMetrics()));
                        View view7 = this.itemView;
                        n.LIZIZ(view7, "");
                        view5.setPadding(paddingLeft2, LIZ2, view7.getPaddingRight(), 0);
                    }
                    View view8 = this.itemView;
                    n.LIZIZ(view8, "");
                    FrameLayout frameLayout = (FrameLayout) view8.findViewById(2131364198);
                    n.LIZIZ(frameLayout, "");
                    frameLayout.setVisibility(8);
                    findViewById.setTextColorRes(2130968666);
                }
            } else if (str.equals("text")) {
                Object invoke2 = this.LJI.invoke(Integer.valueOf(getAbsoluteAdapterPosition() + 1));
                Object invoke3 = this.LJI.invoke(Integer.valueOf(getAbsoluteAdapterPosition() - 1));
                findViewById.setTuxFont(61);
                findViewById.setTextColor(070.LIZJ(findViewById.getContext(), 2131099750));
                Resources system4 = Resources.getSystem();
                n.LIZIZ(system4, "");
                int LIZ3 = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system4.getDisplayMetrics()));
                Resources system5 = Resources.getSystem();
                n.LIZIZ(system5, "");
                int LIZ4 = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system5.getDisplayMetrics()));
                if (invoke2 instanceof C6042CMk) {
                    C6042CMk cMk3 = (C6042CMk) invoke2;
                    if (n.LIZ(cMk3.LIZJ, "text") || n.LIZ(cMk3.LIZJ, "title")) {
                        LIZ4 = 0;
                    }
                }
                if ((invoke3 instanceof C6042CMk) && n.LIZ(((C6042CMk) invoke3).LIZJ, "text")) {
                    LIZ3 = 0;
                }
                View view9 = this.itemView;
                View view10 = this.itemView;
                n.LIZIZ(view10, "");
                int paddingLeft3 = view10.getPaddingLeft();
                View view11 = this.itemView;
                n.LIZIZ(view11, "");
                view9.setPadding(paddingLeft3, LIZ3, view11.getPaddingRight(), LIZ4);
                View view12 = this.itemView;
                n.LIZIZ(view12, "");
                FrameLayout frameLayout2 = (FrameLayout) view12.findViewById(2131364198);
                n.LIZIZ(frameLayout2, "");
                frameLayout2.setVisibility(8);
            }
        } else if (str.equals("ul")) {
            findViewById.setTuxFont(61);
            findViewById.setTextColor(070.LIZJ(findViewById.getContext(), 2131099750));
            View view13 = this.itemView;
            n.LIZIZ(view13, "");
            FrameLayout frameLayout3 = (FrameLayout) view13.findViewById(2131364198);
            n.LIZIZ(frameLayout3, "");
            frameLayout3.setVisibility(0);
            Object invoke4 = this.LJI.invoke(Integer.valueOf(getAbsoluteAdapterPosition() - 1));
            Object invoke5 = this.LJI.invoke(Integer.valueOf(getAbsoluteAdapterPosition() + 1));
            if ((invoke4 instanceof COS) || (invoke4 instanceof COU)) {
                Resources system6 = Resources.getSystem();
                n.LIZIZ(system6, "");
                i = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system6.getDisplayMetrics()));
            } else {
                i = 0;
            }
            if ((invoke5 instanceof COS) || (invoke5 instanceof COU) || invoke5 == null) {
                Resources system7 = Resources.getSystem();
                n.LIZIZ(system7, "");
                i2 = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system7.getDisplayMetrics()));
            } else {
                i2 = 0;
            }
            View view14 = this.itemView;
            View view15 = this.itemView;
            n.LIZIZ(view15, "");
            int paddingLeft4 = view15.getPaddingLeft();
            View view16 = this.itemView;
            n.LIZIZ(view16, "");
            view14.setPadding(paddingLeft4, i, view16.getPaddingRight(), i2);
        }
        View view17 = this.itemView;
        n.LIZIZ(view17, "");
        3Pm findViewById2 = view17.findViewById(2131371081);
        n.LIZIZ(findViewById2, "");
        findViewById2.setText(cMk2.LIZIZ);
        if (cMk2.LIZLLL) {
            View view18 = this.itemView;
            n.LIZIZ(view18, "");
            F1s.LIZIZ(view18.findViewById(2131372933));
            if (!this.LJIIIZ) {
                this.LJIIIZ = true;
                View view19 = this.itemView;
                n.LIZIZ(view19, "");
                LinearLayout linearLayout = (LinearLayout) view19.findViewById(2131372933);
                n.LIZIZ(linearLayout, "");
                CBZ.LIZ(linearLayout, new C6348CYe(), CIR.LIZ, CIP.LIZ);
            }
            View view20 = this.itemView;
            n.LIZIZ(view20, "");
            LinearLayout linearLayout2 = (LinearLayout) view20.findViewById(2131372933);
            n.LIZIZ(linearLayout2, "");
            3SB.LIZ(linearLayout2, (0CH) null, 0, new CIO(this, (4r1) null), 3);
            return;
        }
        View view21 = this.itemView;
        n.LIZIZ(view21, "");
        F1s.LIZ(view21.findViewById(2131372933));
    }

    /* JADX WARNING: Illegal instructions before constructor call */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public ProductDescTextViewHolder(android.view.ViewGroup r4, X.LsC<? super java.lang.Integer, ? extends java.lang.Object> r5) {
        /*
            r3 = this;
            X.M12.LIZ(r4, r5)
            android.content.Context r2 = r4.getContext()
            r1 = 2131559127(0x7f0d02d7, float:1.874359E38)
            r0 = 0
            android.view.View r1 = X.C6489CbV.LIZ(r2, r1, r4, r0)
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            r3.<init>(r1)
            r3.LJI = r5
            java.lang.Class<com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel> r1 = com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel.class
            X.KEN r0 = X.KEM.LIZ
            X.D1G r1 = r0.LIZ(r1)
            X.BHd r0 = new X.BHd
            r0.<init>(r3, r1, r1)
            X.Crj r0 = X.7he.LIZ(r0)
            r3.LJFF = r0
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.ecommerce.pdp.vh.desc.ProductDescTextViewHolder.<init>(android.view.ViewGroup, X.LsC):void");
    }
}
