package com.tencent.mm.plugin.emoji.ui.v2;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.emoji.ui.v2.EmojiStoreV2RewardUI.c;
import com.tencent.mm.protocal.protobuf.EmotionPrice;
import com.tencent.mm.ui.v;
import java.util.LinkedList;

class EmojiStoreV2RewardUI$b extends BaseAdapter {
    final /* synthetic */ EmojiStoreV2RewardUI leK;
    private LinkedList<EmotionPrice> lei;

    EmojiStoreV2RewardUI$b(EmojiStoreV2RewardUI emojiStoreV2RewardUI) {
        this.leK = emojiStoreV2RewardUI;
    }

    public final /* synthetic */ Object getItem(int i) {
        AppMethodBeat.i(53710);
        EmotionPrice uk = uk(i);
        AppMethodBeat.o(53710);
        return uk;
    }

    public final void Q(LinkedList<EmotionPrice> linkedList) {
        AppMethodBeat.i(53706);
        if (this.lei == null) {
            this.lei = new LinkedList();
        }
        this.lei.clear();
        this.lei.addAll(linkedList);
        notifyDataSetChanged();
        AppMethodBeat.o(53706);
    }

    public final int getCount() {
        AppMethodBeat.i(53707);
        if (this.lei == null) {
            AppMethodBeat.o(53707);
            return 0;
        }
        int size = this.lei.size();
        AppMethodBeat.o(53707);
        return size;
    }

    public final EmotionPrice uk(int i) {
        AppMethodBeat.i(53708);
        if (i < 0 || i > getCount()) {
            AppMethodBeat.o(53708);
            return null;
        } else if (this.lei == null) {
            AppMethodBeat.o(53708);
            return null;
        } else {
            EmotionPrice emotionPrice = (EmotionPrice) this.lei.get(i);
            AppMethodBeat.o(53708);
            return emotionPrice;
        }
    }

    public final long getItemId(int i) {
        return (long) i;
    }

    public final View getView(int i, View view, ViewGroup viewGroup) {
        c cVar;
        AppMethodBeat.i(53709);
        if (view == null || view.getTag() == null) {
            view = v.hu(this.leK.mController.ylL).inflate(2130969375, null);
            cVar = new c(this.leK, view);
            view.setTag(cVar);
        } else {
            cVar = (c) view.getTag();
        }
        EmotionPrice uk = uk(i);
        if (uk != null) {
            cVar.leO.setVisibility(0);
            cVar.leO.setText(uk.Number + uk.Label);
        } else {
            cVar.leO.setVisibility(8);
        }
        AppMethodBeat.o(53709);
        return view;
    }
}
