package com.ss.android.ugc.aweme.comment.barrage.cell;

import X.2nK;
import X.3EX;
import X.3ae;
import X.4ZZ;
import X.ACX;
import X.C0682ACg;
import X.C0683ACh;
import X.C0685ACj;
import X.CwZ;
import X.Cwu;
import X.DaP;
import X.JIy;
import X.JIz;
import X.LnI;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import android.content.Context;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.powerlist.PowerCell;
import com.bytedance.lighten.loader.SmartImageView;
import java.util.List;
import java.util.Set;
import kotlin.h.b.n;

public class ReactionBubbleCommonCell extends PowerCell<ACX> {
    public static final C0685ACj LIZ = new C0685ACj((byte) 0);
    public SmartImageView LIZIZ;
    public 4ZZ LJIIIZ;
    public Qeg LJIIJ;
    public ACX LJIIJJI;

    static {
        Covode.recordClassIndex(56876);
    }

    private final String LIZ() {
        ACX acx = this.LJIIJJI;
        if (acx == null) {
            return "";
        }
        return acx.LJ + '_' + acx.LIZ.getUid();
    }

    public final void bE_() {
        C0682ACg aCg;
        Set<String> set;
        String str;
        ReactionBubbleCommonCell.super.bE_();
        ACX acx = this.LJIIJJI;
        if (acx != null && (aCg = acx.LIZLLL) != null && (set = aCg.LJI) != null && !set.contains(LIZ())) {
            set.add(LIZ());
            ACX acx2 = this.LJIIJJI;
            if (acx2 != null) {
                Cwu[] cwuArr = new Cwu[4];
                C0682ACg aCg2 = acx2.LIZLLL;
                String str2 = null;
                if (aCg2 != null) {
                    str = aCg2.LIZIZ;
                } else {
                    str = null;
                }
                cwuArr[0] = CwZ.LIZ(str, "enter_from");
                C0682ACg aCg3 = acx2.LIZLLL;
                if (aCg3 != null) {
                    str2 = aCg3.LJ;
                }
                cwuArr[1] = CwZ.LIZ(str2, "story_type");
                cwuArr[2] = CwZ.LIZ(acx2.LIZJ, "notice_type");
                cwuArr[3] = CwZ.LIZ(acx2.LIZ.getUid(), "from_user_id");
                2nK.LIZ("interaction_bullet_show", cwuArr);
            }
        }
    }

    public final View LIZ(ViewGroup viewGroup) {
        MethodCollector.i(8897);
        M12.LIZ(viewGroup);
        View inflate = View.inflate(viewGroup.getContext(), 2131558772, (ViewGroup) null);
        SmartImageView findViewById = inflate.findViewById(2131362513);
        n.LIZIZ(findViewById, "");
        this.LIZIZ = findViewById;
        4ZZ findViewById2 = inflate.findViewById(2131365693);
        n.LIZIZ(findViewById2, "");
        this.LJIIIZ = findViewById2;
        Qeg findViewById3 = inflate.findViewById(2131364500);
        n.LIZIZ(findViewById3, "");
        this.LJIIJ = findViewById3;
        n.LIZIZ(inflate, "");
        inflate.setVisibility(4);
        MethodCollector.o(8897);
        return inflate;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        int intValue;
        ACX acx = (ACX) daP;
        M12.LIZ(acx);
        ReactionBubbleCommonCell.super.LIZ(acx);
        SmartImageView smartImageView = this.LIZIZ;
        if (smartImageView == null) {
            n.LIZ("");
        }
        3ae r4 = new 3ae();
        r4.LIZIZ = 2130968615;
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        r4.LIZJ = Float.valueOf((float) LnI.LIZ(TypedValue.applyDimension(1, 24.0f, system.getDisplayMetrics())));
        Context context = smartImageView.getContext();
        n.LIZIZ(context, "");
        smartImageView.setBackground(r4.LIZ(context));
        QJt LIZ2 = QHW.LIZ(3EX.LIZ(acx.LIZ.getAvatarThumb()));
        LIZ2.LIZ("ReactionBubbleCommentCell");
        SmartImageView smartImageView2 = this.LIZIZ;
        if (smartImageView2 == null) {
            n.LIZ("");
        }
        LIZ2.LJJIIZ = smartImageView2;
        JIy jIy = new JIy();
        jIy.LIZ = true;
        JIz LIZ3 = jIy.LIZ();
        n.LIZIZ(LIZ3, "");
        LIZ2.LJIL = LIZ3;
        LIZ2.LIZJ = true;
        LIZ2.LIZJ();
        SmartImageView smartImageView3 = this.LIZIZ;
        if (smartImageView3 == null) {
            n.LIZ("");
        }
        smartImageView3.setOnClickListener(new C0683ACh(this, acx));
        this.LJIIJJI = acx;
        4ZZ r0 = this.LJIIIZ;
        if (r0 == null) {
            n.LIZ("");
        }
        r0.setVisibility(8);
        Qeg qeg = this.LJIIJ;
        if (qeg == null) {
            n.LIZ("");
        }
        qeg.setVisibility(8);
        List<Integer> list = acx.LIZIZ;
        if (list.size() == 1 && ((intValue = list.get(0).intValue()) == 1001 || intValue == 1002)) {
            4ZZ r02 = this.LJIIIZ;
            if (r02 == null) {
                n.LIZ("");
            }
            r02.setVisibility(0);
            Qeg qeg2 = this.LJIIJ;
            if (qeg2 == null) {
                n.LIZ("");
            }
            qeg2.setVisibility(8);
            4ZZ r1 = this.LJIIIZ;
            if (r1 == null) {
                n.LIZ("");
            } else if (intValue == 1001) {
                r1.setIconRes(2131755303);
            } else if (intValue == 1002) {
                r1.setIconRes(2131755347);
            }
        }
        View view = this.itemView;
        n.LIZIZ(view, "");
        view.setVisibility(4);
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        view2.setTag(0);
    }
}
