package com.tencent.mm.plugin.brandservice.ui.a;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.aj.f;
import com.tencent.mm.bp.d;
import com.tencent.mm.kernel.g;
import com.tencent.mm.model.s;
import com.tencent.mm.model.t;
import com.tencent.mm.plugin.brandservice.ui.a.a.a;
import com.tencent.mm.plugin.fts.a.d.a.a.b;
import com.tencent.mm.plugin.fts.ui.m;
import com.tencent.mm.plugin.websearch.api.ai;
import com.tencent.ytcommon.BuildConfig;

public class a$b extends b {
    final /* synthetic */ a jNc;

    public a$b(a aVar) {
        this.jNc = aVar;
        super(aVar);
    }

    public final View a(Context context, ViewGroup viewGroup) {
        AppMethodBeat.i(14081);
        View inflate = LayoutInflater.from(context).inflate(2130969608, viewGroup, false);
        a aVar = this.jNc.jNb;
        aVar.ejo = (ImageView) inflate.findViewById(2131821183);
        aVar.gnB = (TextView) inflate.findViewById(2131821185);
        aVar.gnC = (TextView) inflate.findViewById(2131820991);
        aVar.contentView = inflate.findViewById(2131821182);
        inflate.setTag(aVar);
        AppMethodBeat.o(14081);
        return inflate;
    }

    public final void a(Context context, com.tencent.mm.plugin.fts.a.d.a.a.a aVar, com.tencent.mm.plugin.fts.a.d.a.a aVar2, Object... objArr) {
        AppMethodBeat.i(14082);
        a aVar3 = (a) aVar2;
        a aVar4 = (a) aVar;
        m.p(aVar4.contentView, this.jNc.mFk);
        m.a(context, aVar4.ejo, aVar3.iconUrl, null, 2130837985);
        if (t.mP(aVar3.username)) {
            m.a(((com.tencent.mm.openim.a.b) g.K(com.tencent.mm.openim.a.b.class)).a(context, aVar3.jMY), aVar4.gnB);
        } else {
            m.a(aVar3.jMY, aVar4.gnB);
        }
        m.a(aVar3.jMZ, aVar4.gnC);
        AppMethodBeat.o(14082);
    }

    public final boolean a(Context context, com.tencent.mm.plugin.fts.a.d.a.a aVar) {
        AppMethodBeat.i(14083);
        a aVar2 = (a) aVar;
        a(this.jNc.mDz.mDY, aVar2.hpS);
        Intent intent;
        if (f.rc(aVar2.username)) {
            intent = new Intent();
            intent.putExtra("enterprise_biz_name", aVar2.username);
            intent.putExtra("enterprise_biz_display_name", s.mJ(aVar2.username));
            intent.putExtra("enterprise_from_scene", 3);
            d.f(context, ".ui.conversation.EnterpriseConversationUI", intent);
        } else if (f.kq(aVar2.username)) {
            intent = new Intent();
            intent.putExtra("Contact_User", aVar2.username);
            intent.addFlags(67108864);
            intent.putExtra("biz_chat_from_scene", 5);
            d.f(context, ".ui.bizchat.BizChatConversationUI", intent);
        } else if (f.rd(aVar2.username)) {
            com.tencent.mm.aj.d qX = f.qX(aVar2.username);
            String adT = qX == null ? null : qX.adT();
            if (adT == null) {
                adT = BuildConfig.FLAVOR;
            }
            Intent intent2 = new Intent();
            intent2.putExtra("rawUrl", adT);
            intent2.putExtra("useJs", true);
            intent2.putExtra("srcUsername", aVar2.username);
            intent2.putExtra("bizofstartfrom", "enterpriseHomeSubBrand");
            intent2.addFlags(67108864);
            d.b(context, "webview", ".ui.tools.WebViewUI", intent2);
        } else {
            intent = new Intent();
            intent.putExtra("Chat_User", aVar2.username);
            intent.putExtra("finish_direct", true);
            intent.putExtra("specific_chat_from_scene", 3);
            intent.putExtra("preChatTYPE", 9);
            d.f(context, ".ui.chatting.ChattingUI", intent);
        }
        ai.adO(aVar2.username);
        AppMethodBeat.o(14083);
        return true;
    }
}
