package com.ss.android.ugc.aweme.search.middlepage;

import X.0HH;
import X.2ub;
import X.3EX;
import X.BTA;
import X.C3586Sbe;
import X.CE5;
import X.DaP;
import X.M12;
import X.QHW;
import X.QJt;
import X.Qeg;
import X.SZ8;
import X.SZ9;
import X.SZK;
import android.content.Context;
import android.text.SpannableStringBuilder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import com.ss.android.ugc.aweme.utils.UserVerify;
import kotlin.h.b.n;

public final class VisitedAccountCell extends PowerCell<SZ8> {
    public static final C3586Sbe LIZ = new C3586Sbe((byte) 0);

    static {
        Covode.recordClassIndex(104439);
    }

    public final void bE_() {
        VisitedAccountCell.super.bE_();
    }

    public final void bF_() {
        VisitedAccountCell.super.bF_();
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        View LIZ2 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131561164, viewGroup, false);
        n.LIZIZ(LIZ2, "");
        return LIZ2;
    }

    public final /* synthetic */ void LIZ(DaP daP) {
        boolean z;
        SZ8 sz8 = (SZ8) daP;
        M12.LIZ(sz8);
        UserVerify userVerify = new UserVerify((UrlModel) null, sz8.LIZ.getCustomVerify(), sz8.LIZ.getEnterpriseVerifyReason(), (Integer) null);
        View view = this.itemView;
        n.LIZIZ(view, "");
        2ub findViewById = view.findViewById(2131361897);
        View view2 = this.itemView;
        n.LIZIZ(view2, "");
        Context context = view2.getContext();
        String nickname = sz8.LIZ.getNickname();
        String relationShip = sz8.LIZ.getRelationShip();
        if (!(context == null || nickname == null)) {
            Qeg LIZ2 = findViewById.LIZ(2131372463);
            n.LIZIZ(LIZ2, "");
            LIZ2.setText(nickname);
            TextView textView = (TextView) findViewById.LIZ(2131372463);
            if (textView != null) {
                BTA.LIZ.LIZ(context, textView, BTA.LIZ(userVerify));
            }
            String LIZ3 = CE5.LIZ.LIZ(context, relationShip);
            if (LIZ3.length() > 0) {
                z = true;
            } else {
                z = false;
            }
            if (z) {
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                spannableStringBuilder.append(" • ");
                spannableStringBuilder.append(LIZ3);
                Qeg LIZ4 = findViewById.LIZ(2131372262);
                n.LIZIZ(LIZ4, "");
                LIZ4.setVisibility(0);
                Qeg LIZ5 = findViewById.LIZ(2131372262);
                n.LIZIZ(LIZ5, "");
                LIZ5.setText(spannableStringBuilder);
            } else {
                Qeg LIZ6 = findViewById.LIZ(2131372262);
                n.LIZIZ(LIZ6, "");
                LIZ6.setText("");
                Qeg LIZ7 = findViewById.LIZ(2131372262);
                n.LIZIZ(LIZ7, "");
                LIZ7.setVisibility(8);
            }
        }
        UrlModel avatarUrl = sz8.LIZ.getAvatarUrl();
        if (avatarUrl != null) {
            QJt LIZ8 = QHW.LIZ(3EX.LIZ(avatarUrl));
            View view3 = this.itemView;
            n.LIZIZ(view3, "");
            LIZ8.LJJIIZ = view3.findViewById(2131361891);
            LIZ8.LIZ("VisitedAccountCell");
            LIZ8.LIZJ();
        }
        this.itemView.setOnClickListener(new SZ9(sz8, this, sz8));
        View view4 = this.itemView;
        n.LIZIZ(view4, "");
        view4.findViewById(2131361892).setOnClickListener(new SZK(sz8, this, sz8));
    }
}
