package com.tencent.mm.plugin.emoji.a;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.at.o;
import com.tencent.mm.plugin.emoji.a.a.a;
import com.tencent.mm.plugin.emoji.a.a.e;
import com.tencent.mm.plugin.emoji.e.g;
import com.tencent.mm.protocal.protobuf.EmotionBannerSet;
import com.tencent.mm.protocal.protobuf.EmotionSummary;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ytcommon.BuildConfig;

public class f extends a {
    private final String TAG = "MicroMsg.emoji.EmojiStoreMainAdapter";
    public boolean kSk = false;
    public boolean kSl = true;
    public boolean kSm = false;
    public boolean kSn = true;

    public f(Context context) {
        super(context);
    }

    public final a d(Context context, View view) {
        AppMethodBeat.i(52747);
        a aVar = new a(this, context, view);
        aVar.a(this.kSQ);
        AppMethodBeat.o(52747);
        return aVar;
    }

    public final void clear() {
        AppMethodBeat.i(52748);
        super.clear();
        AppMethodBeat.o(52748);
    }

    public View b(int i, View view, ViewGroup viewGroup) {
        boolean z = true;
        AppMethodBeat.i(52749);
        a aVar = (a) view.getTag();
        com.tencent.mm.plugin.emoji.a.a.f tX = tX(i);
        if (this.kSm) {
            tX.kTh = true;
            tX.kTf = false;
            tX.kTg = false;
        }
        if (!(aVar == null || tX == null)) {
            tX.kTg = this.kSn;
            EmotionBannerSet emotionBannerSet = tX.kTc;
            if (emotionBannerSet == null) {
                aVar.tT(0);
                z = false;
            } else {
                aVar.setTitle(emotionBannerSet.Title);
                aVar.IR(emotionBannerSet.Desc);
                if (!bo.isNullOrNil(emotionBannerSet.IconUrl)) {
                    o.ahp().a(emotionBannerSet.IconUrl, aVar.bji(), g.dH(BuildConfig.FLAVOR, emotionBannerSet.IconUrl));
                }
                if (bo.isNullOrNil(emotionBannerSet.TagUrl)) {
                    aVar.tS(8);
                } else {
                    o.ahp().a(emotionBannerSet.TagUrl, aVar.bjk(), g.dH(BuildConfig.FLAVOR, emotionBannerSet.TagUrl));
                    aVar.tS(0);
                }
                aVar.tT(8);
            }
            if (!z) {
                EmotionSummary emotionSummary = tX.kTb;
                if (emotionSummary != null) {
                    aVar.setTitle(emotionSummary.PackName);
                    if (com.tencent.mm.plugin.emoji.h.a.g(emotionSummary)) {
                        o.ahp().a(BuildConfig.FLAVOR, aVar.bji());
                        aVar.bjj();
                    } else {
                        o.ahp().a(emotionSummary.IconUrl, aVar.bji(), g.dH(emotionSummary.ProductID, emotionSummary.IconUrl));
                    }
                    boolean dR = e.dR(emotionSummary.PackType, 2);
                    if (!TextUtils.isEmpty(emotionSummary.TagUri)) {
                        aVar.bjk().setImageDrawable(null);
                        aVar.bjk().setVisibility(0);
                        o.ahp().a(emotionSummary.TagUri, aVar.bjk(), g.dH(BuildConfig.FLAVOR, emotionSummary.TagUri));
                    } else if (dR) {
                        aVar.tS(0);
                        aVar.bjl();
                    } else {
                        aVar.tS(8);
                    }
                    aVar.IR(bjA() ? emotionSummary.ExptDesc : emotionSummary.Introduce);
                    if (this.kSk && aVar.kRC != null) {
                        aVar.kRC.setBackgroundResource(2130838398);
                    }
                }
            }
        }
        AppMethodBeat.o(52749);
        return view;
    }

    public int bjw() {
        return 0;
    }

    public void tU(int i) {
    }

    public int bjx() {
        return 0;
    }

    public void tV(int i) {
    }

    public int bjy() {
        return 0;
    }

    public void tW(int i) {
    }

    /* Access modifiers changed, original: protected */
    public boolean bjA() {
        return false;
    }
}
