package com.ss.android.ugc.aweme.relation.usercard.impl.cell;

import X.3ae;
import X.BT2;
import X.BTG;
import X.C1381DXd;
import X.C1383DXf;
import X.C1481DaP;
import X.C1907DhH;
import X.C4191Ed1;
import X.C4363Efn;
import X.CsH;
import X.DW9;
import X.DXU;
import X.LnI;
import X.M12;
import X.Qeg;
import X.Qen;
import android.content.Context;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.friends.model.MutualStruct;
import com.ss.android.ugc.aweme.profile.model.User;
import java.util.List;
import java.util.Objects;
import kotlin.h.b.n;

public final class SquareRecUserCell extends AbsRecUserCell<DW9> {
    static {
        Covode.recordClassIndex(103531);
    }

    public final int LIZJ() {
        return 2131560985;
    }

    public final void bD_() {
        super.bD_();
        LJJII().setStrokeStyle(1);
    }

    public final void LJJIIJZLJL() {
        DXU LIZLLL = LIZLLL();
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        Qen.LIZIZ(LIZLLL, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 12.0f, system.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
        Qeg LJ = LJ();
        Resources system2 = Resources.getSystem();
        n.LIZIZ(system2, "");
        Qen.LIZIZ(LJ, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 8.0f, system2.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
    }

    public final /* bridge */ /* synthetic */ void LIZ(C1481DaP daP) {
        LIZ((DW9) daP);
    }

    public final void LIZ(DW9 dw9) {
        boolean z;
        int LIZ;
        M12.LIZ(dw9);
        super.LIZ(dw9);
        MutualStruct LIZIZ = C1907DhH.LIZIZ(dw9.LIZ);
        if (LIZIZ != null) {
            List userList = LIZIZ.getUserList();
            if (userList == null || userList.isEmpty()) {
                z = true;
            } else {
                z = false;
            }
            if (z) {
                LJJII().LIZ();
                LJJII().getTvDesc().setMaxLines(2);
                LJJII().getTvDesc().setGravity(17);
                if (dw9.LIZJ.LIZ == 101) {
                    Resources system = Resources.getSystem();
                    n.LIZIZ(system, "");
                    LIZ = LnI.LIZ(TypedValue.applyDimension(1, 136.0f, system.getDisplayMetrics()));
                } else {
                    Resources system2 = Resources.getSystem();
                    n.LIZIZ(system2, "");
                    LIZ = LnI.LIZ(TypedValue.applyDimension(1, 126.0f, system2.getDisplayMetrics()));
                }
                BTG.LIZ(LJJII().getTvDesc(), Integer.valueOf(LIZ), 1);
                BT2 LJJII = LJJII();
                Resources system3 = Resources.getSystem();
                n.LIZIZ(system3, "");
                Qen.LIZIZ(LJJII, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 2.0f, system3.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
                return;
            }
            BT2 LJJII2 = LJJII();
            Resources system4 = Resources.getSystem();
            n.LIZIZ(system4, "");
            Qen.LIZIZ(LJJII2, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 1.0f, system4.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
            LJJII().setTuxTextSize(61);
            LJJII().getTvDesc().setMaxWidth(Integer.MAX_VALUE);
            LJJII().LIZ(LIZIZ, 160.0f);
        }
    }

    /* JADX WARNING: type inference failed for: r4v4, types: [X.EdN, android.view.View] */
    private final void LIZ(DXU dxu, int i) {
        C4191Ed1 liveCircleView = dxu.getLiveCircleView();
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        Integer valueOf = Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 8.0f, system.getDisplayMetrics())) + i);
        Resources system2 = Resources.getSystem();
        n.LIZIZ(system2, "");
        CsH.LIZ(liveCircleView, valueOf, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 13.0f, system2.getDisplayMetrics())) + i));
        dxu.getLiveCircleView().LIZ();
        dxu.getLiveCircleView().LIZ(5.0f, 5.0f);
        C4363Efn efn = (C4363Efn) dxu.getLiveCircleView().findViewById(2131366517);
        Resources system3 = Resources.getSystem();
        n.LIZIZ(system3, "");
        efn.setStrokeWidth(LnI.LIZ(TypedValue.applyDimension(1, 2.0f, system3.getDisplayMetrics())));
        ViewGroup.LayoutParams layoutParams = efn.getLayoutParams();
        Objects.requireNonNull(layoutParams, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams");
        FrameLayout.LayoutParams layoutParams2 = (FrameLayout.LayoutParams) layoutParams;
        FrameLayout.LayoutParams layoutParams3 = layoutParams2;
        Resources system4 = Resources.getSystem();
        n.LIZIZ(system4, "");
        layoutParams3.height = i + LnI.LIZ(TypedValue.applyDimension(1, 11.0f, system4.getDisplayMetrics()));
        layoutParams3.gravity = 17;
        efn.setLayoutParams(layoutParams2);
        dxu.getLiveCircleView().findViewById(2131372020).setTuxFont(62);
        C4191Ed1 liveCircleView2 = dxu.getLiveCircleView();
        ViewGroup.LayoutParams layoutParams4 = liveCircleView2.getLayoutParams();
        Objects.requireNonNull(layoutParams4, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams");
        FrameLayout.LayoutParams layoutParams5 = (FrameLayout.LayoutParams) layoutParams4;
        layoutParams5.gravity = 17;
        liveCircleView2.setLayoutParams(layoutParams5);
        ? avatarView = dxu.getAvatarView();
        ViewGroup.LayoutParams layoutParams6 = avatarView.getLayoutParams();
        Objects.requireNonNull(layoutParams6, "null cannot be cast to non-null type android.widget.FrameLayout.LayoutParams");
        FrameLayout.LayoutParams layoutParams7 = (FrameLayout.LayoutParams) layoutParams6;
        layoutParams7.gravity = 17;
        avatarView.setLayoutParams(layoutParams7);
        dxu.getLiveCircleView().setOnListItemLiveCircleStatusChange(new C1381DXd(this, dxu));
        DXU LIZLLL = LIZLLL();
        Resources system5 = Resources.getSystem();
        n.LIZIZ(system5, "");
        Qen.LIZIZ(LIZLLL, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 6.0f, system5.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
        Qeg LJ = LJ();
        Resources system6 = Resources.getSystem();
        n.LIZIZ(system6, "");
        Qen.LIZIZ(LJ, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 1.0f, system6.getDisplayMetrics()))), (Integer) null, (Integer) null, false, 29);
    }

    public final void LIZ(C1383DXf dXf, User user) {
        M12.LIZ(dXf, user);
        super.LIZ(dXf, user);
        int i = dXf.LIZ;
        if (i == 100) {
            View view = this.itemView;
            n.LIZIZ(view, "");
            Resources system = Resources.getSystem();
            n.LIZIZ(system, "");
            Integer valueOf = Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 150.0f, system.getDisplayMetrics())));
            Resources system2 = Resources.getSystem();
            n.LIZIZ(system2, "");
            CsH.LIZ(view, valueOf, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 210.0f, system2.getDisplayMetrics()))));
            FrameLayout LJJIFFI = LJJIFFI();
            Resources system3 = Resources.getSystem();
            n.LIZIZ(system3, "");
            Integer valueOf2 = Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 8.0f, system3.getDisplayMetrics())));
            Resources system4 = Resources.getSystem();
            n.LIZIZ(system4, "");
            Qen.LIZIZ(LJJIFFI, valueOf2, (Integer) null, Integer.valueOf(LnI.LIZ(TypedValue.applyDimension(1, 8.0f, system4.getDisplayMetrics()))), (Integer) null, false, 26);
            Qeg LJFF = LJFF();
            Resources system5 = Resources.getSystem();
            n.LIZIZ(system5, "");
            LJFF.setMaxWidth(LnI.LIZ(TypedValue.applyDimension(1, 126.0f, system5.getDisplayMetrics())));
            DXU LIZLLL = LIZLLL();
            Resources system6 = Resources.getSystem();
            n.LIZIZ(system6, "");
            LIZLLL.LIZ(LnI.LIZ(TypedValue.applyDimension(1, 96.0f, system6.getDisplayMetrics())));
            if (LIZLLL.getLiveCircleView().getVisibility() == 0) {
                Resources system7 = Resources.getSystem();
                n.LIZIZ(system7, "");
                LIZ(LIZLLL, LnI.LIZ(TypedValue.applyDimension(1, 96.0f, system7.getDisplayMetrics())));
            } else {
                LJJIIJZLJL();
            }
        } else if (i == 101) {
            DXU LIZLLL2 = LIZLLL();
            Resources system8 = Resources.getSystem();
            n.LIZIZ(system8, "");
            LIZLLL2.LIZ(LnI.LIZ(TypedValue.applyDimension(1, 120.0f, system8.getDisplayMetrics())));
            if (LIZLLL2.getLiveCircleView().getVisibility() == 0) {
                Resources system9 = Resources.getSystem();
                n.LIZIZ(system9, "");
                LIZ(LIZLLL2, LnI.LIZ(TypedValue.applyDimension(1, 120.0f, system9.getDisplayMetrics())));
            } else {
                LJJIIJZLJL();
            }
        }
        if (LJFF().getVisibility() == 0) {
            BTG.LIZ(LJFF(), (Integer) null, 3);
        }
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        if (view2.getBackground() == null) {
            View view3 = this.itemView;
            n.LIZIZ(view3, "");
            3ae r4 = new 3ae();
            r4.LIZIZ = 2130968605;
            Resources system10 = Resources.getSystem();
            n.LIZIZ(system10, "");
            r4.LIZJ = Float.valueOf(TypedValue.applyDimension(1, 2.0f, system10.getDisplayMetrics()));
            View view4 = this.itemView;
            n.LIZIZ(view4, "");
            Context context = view4.getContext();
            n.LIZIZ(context, "");
            view3.setBackground(r4.LIZ(context));
        }
        View view5 = this.itemView;
        n.LIZIZ(view5, "");
        Qen.LIZIZ(view5, (Integer) null, (Integer) null, Integer.valueOf(dXf.LJIIJJI), (Integer) null, false, 27);
    }
}
