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

import X.3EX;
import X.3ae;
import X.46i;
import X.4lx;
import X.9Y3;
import X.AE4;
import X.AE5;
import X.AE6;
import X.AE7;
import X.C2573AuX;
import X.DMH;
import X.DMJ;
import X.DaP;
import X.DwO;
import X.F5u;
import X.LnI;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import X.S8e;
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 com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeStatus;
import com.ss.android.ugc.aweme.profile.model.User;
import java.util.Calendar;
import java.util.Objects;
import kotlin.h.b.n;

public final class ReactionBubblePublishCell extends BaseReactionBubbleCell<AE5> {
    public static final AE7 LIZIZ = new AE7((byte) 0);
    public SmartImageView LIZ;
    public Qeg LJIIIZ;
    public Qeg LJIIJ;
    public Qeg LJIIJJI;

    static {
        Covode.recordClassIndex(117799);
    }

    public final View LIZ(ViewGroup viewGroup) {
        MethodCollector.i(6753);
        M12.LIZ(viewGroup);
        DMJ inflate = View.inflate(viewGroup.getContext(), 2131561417, (ViewGroup) null);
        this.LIZ = inflate.findViewById(2131362513);
        this.LJIIIZ = inflate.findViewById(2131367878);
        this.LJIIJ = inflate.findViewById(2131371198);
        this.LJIIJJI = inflate.findViewById(2131364009);
        if (DwO.LIZ.LJIILJJIL()) {
            Qeg qeg = this.LJIIJJI;
            if (qeg != null) {
                qeg.setTuxFont(52);
            }
            Qeg qeg2 = this.LJIIJJI;
            if (qeg2 != null) {
                qeg2.setTextColorRes(2130968624);
            }
            DMJ dmj = inflate;
            dmj.setBackgroundAlpha(0.5f);
            dmj.setMode(DMH.BRAND_BACKGROUND);
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            dmj.setRadius(TypedValue.applyDimension(1, 24.0f, system.getDisplayMetrics()));
        } else {
            n.LIZIZ(inflate, "");
            3ae r1 = new 3ae();
            r1.LIZ = Integer.valueOf(Color.parseColor("#80545454"));
            Resources system2 = Resources.getSystem();
            n.LIZIZ(system2, "");
            r1.LIZJ = Float.valueOf((float) LnI.LIZ(TypedValue.applyDimension(1, 24.0f, system2.getDisplayMetrics())));
            Context context = viewGroup.getContext();
            n.LIZIZ(context, "");
            inflate.setBackground(r1.LIZ(context));
        }
        MethodCollector.o(6753);
        return inflate;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        String LIZLLL;
        Aweme aweme;
        AwemeStatus status;
        String sb;
        AE5 ae5 = (AE5) daP;
        M12.LIZ(ae5);
        ReactionBubblePublishCell.super.LIZ(ae5);
        QJt LIZ2 = QHW.LIZ(3EX.LIZ(ae5.LIZ.getAvatarThumb()));
        LIZ2.LIZ("ReactionBubblePublishCell");
        LIZ2.LJJIIZ = this.LIZ;
        LIZ2.LJIL = LIZ();
        LIZ2.LIZJ = true;
        LIZ2.LIZJ();
        Qeg qeg = this.LJIIIZ;
        if (qeg != null) {
            C2573AuX auX = new C2573AuX();
            String uniqueId = ae5.LIZ.getUniqueId();
            n.LIZIZ(uniqueId, "");
            auX.LIZ(uniqueId);
            qeg.setText(auX.LIZ);
        }
        long j = ae5.LIZIZ;
        Calendar instance = Calendar.getInstance();
        n.LIZIZ(instance, "");
        if (instance.getTimeInMillis() - j <= 0) {
            Calendar instance2 = Calendar.getInstance();
            n.LIZIZ(instance2, "");
            j = instance2.getTimeInMillis() - 1;
        }
        if (9Y3.LIZ(9Y3.LIZ(), true, "standardize_timestamp", false)) {
            LIZLLL = S8e.LJIJJLI.LIZ(j);
        } else {
            View view = this.itemView;
            n.LIZIZ(view, "");
            LIZLLL = F5u.LIZLLL(view.getContext(), j);
        }
        Qeg qeg2 = this.LJIIJ;
        if (qeg2 != null) {
            C2573AuX auX2 = new C2573AuX();
            auX2.LIZ(" · ".concat(String.valueOf(LIZLLL)));
            qeg2.setText(auX2.LIZ);
        }
        SmartImageView smartImageView = this.LIZ;
        if (smartImageView != null) {
            smartImageView.setOnClickListener(new AE6(this, ae5));
        }
        AE4 ae4 = ae5.LIZJ;
        if (ae4 != null) {
            aweme = ae4.LIZ;
        } else {
            aweme = null;
        }
        if (aweme != null && DwO.LIZ.LJIILJJIL() && 4lx.LIZ(aweme) && (status = aweme.getStatus()) != null) {
            int privateStatus = status.getPrivateStatus();
            if (privateStatus == 1) {
                StringBuilder sb2 = new StringBuilder(" · ");
                View view2 = this.itemView;
                n.LIZIZ(view2, "");
                sb2.append(view2.getResources().getString(2131830935));
                sb = sb2.toString();
            } else if (privateStatus != 2) {
                IAccountUserService LJFF = 46i.LJFF();
                n.LIZIZ(LJFF, "");
                User curUser = LJFF.getCurUser();
                n.LIZIZ(curUser, "");
                if (curUser.isAccuratePrivateAccount()) {
                    StringBuilder sb3 = new StringBuilder(" · ");
                    View view3 = this.itemView;
                    n.LIZIZ(view3, "");
                    sb3.append(view3.getResources().getString(2131833283));
                    sb = sb3.toString();
                } else {
                    sb = "";
                }
            } else {
                StringBuilder sb4 = new StringBuilder(" · ");
                View view4 = this.itemView;
                n.LIZIZ(view4, "");
                sb4.append(view4.getResources().getString(2131833284));
                sb = sb4.toString();
            }
            StringBuilder sb5 = new StringBuilder();
            View view5 = this.itemView;
            n.LIZIZ(view5, "");
            sb5.append(view5.getResources().getString(2131832086));
            sb5.append(sb);
            String sb6 = sb5.toString();
            Qeg qeg3 = this.LJIIJJI;
            if (qeg3 != null) {
                qeg3.setText(sb6);
            }
            DMJ dmj = this.itemView;
            Objects.requireNonNull(dmj, "null cannot be cast to non-null type com.ss.android.ugc.aweme.tux.business.story.StoryBrandView");
            dmj.setBackgroundAlpha(0.5f);
        }
        View view6 = this.itemView;
        n.LIZIZ(view6, "");
        view6.setTag(2);
    }
}
