package com.ss.android.ugc.aweme.story.interaction.cell;

import X.2nK;
import X.3EX;
import X.3ae;
import X.4ZZ;
import X.AE2;
import X.AE4;
import X.C0725ADx;
import X.C0726ADy;
import X.C0727ADz;
import X.CwZ;
import X.Cwu;
import X.DaP;
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.graphics.Color;
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.lighten.loader.SmartImageView;
import java.util.List;
import kotlin.h.b.n;

public final class ReactionBubbleEmojiCell extends BaseReactionBubbleCell<C0725ADx> {
    public static final AE2 LIZ = new AE2((byte) 0);
    public SmartImageView LIZIZ;
    public 4ZZ LJIIIZ;
    public Qeg LJIIJ;

    static {
        Covode.recordClassIndex(117796);
    }

    private final void LIZ(List<Integer> list) {
        4ZZ r1 = this.LJIIIZ;
        if (r1 == null) {
            n.LIZ("");
        }
        r1.setVisibility(8);
        Qeg qeg = this.LJIIJ;
        if (qeg == null) {
            n.LIZ("");
        }
        qeg.setVisibility(0);
        StringBuilder sb = new StringBuilder();
        for (Integer intValue : list) {
            sb.append(C0727ADz.LIZIZ.LIZ(intValue.intValue()));
        }
        Qeg qeg2 = this.LJIIJ;
        if (qeg2 == null) {
            n.LIZ("");
        }
        qeg2.setText(sb.toString());
    }

    public final View LIZ(ViewGroup viewGroup) {
        MethodCollector.i(9943);
        M12.LIZ(viewGroup);
        View inflate = View.inflate(viewGroup.getContext(), 2131561414, (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(9943);
        return inflate;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        String str;
        C0725ADx aDx = (C0725ADx) daP;
        M12.LIZ(aDx);
        ReactionBubbleEmojiCell.super.LIZ(aDx);
        SmartImageView smartImageView = this.LIZIZ;
        if (smartImageView == null) {
            n.LIZ("");
        }
        if (smartImageView != null) {
            3ae r4 = new 3ae();
            r4.LIZ = Integer.valueOf(Color.parseColor("#80545454"));
            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(aDx.LIZ.getAvatarThumb()));
        LIZ2.LIZ("ReactionBubbleCommentCell");
        SmartImageView smartImageView2 = this.LIZIZ;
        if (smartImageView2 == null) {
            n.LIZ("");
        }
        LIZ2.LJJIIZ = smartImageView2;
        LIZ2.LJIL = LIZ();
        LIZ2.LIZJ = true;
        LIZ2.LIZJ();
        SmartImageView smartImageView3 = this.LIZIZ;
        if (smartImageView3 == null) {
            n.LIZ("");
        }
        smartImageView3.setOnClickListener(new C0726ADy(this, aDx));
        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 = aDx.LIZIZ;
        String str2 = "emoji_react";
        if (list.size() == 1) {
            int intValue = list.get(0).intValue();
            if (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);
                if (intValue == 1001) {
                    str2 = "like";
                } else {
                    str2 = "";
                    if (intValue == 1002) {
                        str2 = "view";
                    }
                }
                4ZZ r1 = this.LJIIIZ;
                if (r1 == null) {
                    n.LIZ("");
                } else if (intValue == 1001) {
                    r1.setIconRes(2131755303);
                } else if (intValue == 1002) {
                    r1.setIconRes(2131755347);
                }
            } else {
                LIZ(list);
            }
        } else {
            LIZ(list);
        }
        View view = this.itemView;
        n.LIZIZ(view, "");
        view.setVisibility(4);
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        view2.setTag(0);
        Cwu[] cwuArr = new Cwu[3];
        AE4 ae4 = aDx.LIZJ;
        if (ae4 != null) {
            str = ae4.LIZIZ;
        } else {
            str = null;
        }
        cwuArr[0] = CwZ.LIZ(str, "enter_from");
        cwuArr[1] = CwZ.LIZ(str2, "notice_type");
        cwuArr[2] = CwZ.LIZ(aDx.LIZ.getUid(), "from_user_id");
        2nK.LIZ("interaction_bullet_show", cwuArr);
    }
}
