<commit_before>package pingbits.com.emojikeyboard.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import pingbits.com.emojikeyboard.EmojiManager;
import pingbits.com.emojikeyboard.R;
import pingbits.com.emojikeyboard.objects.Emoji;

/**
 * Created by aagam on 6/2/15.
 */
public class EmojiAdapter extends BaseAdapter {

    public LayoutInflater inflater;
    public Context ctx;
    public Emoji[] emojis;
    public EmojiAdapter(Context context, Emoji[] mData) {
        ctx = context;
        inflater = LayoutInflater.from(ctx);
        emojis = mData;
    }

    @Override
    public int getCount() {
        return emojis.length;
    }

    @Override
    public Object getItem(int position) {
        return emojis[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView == null){
            convertView = inflater.inflate(R.layout.item_emoji_grid,null,false);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else{
            holder = (ViewHolder)convertView.getTag();
        }
        holder.emojiIcon.setImageResource(EmojiManager.sEmojisMap.get(emojis[position].codepoint));
        return convertView;
    }<commit_msg>add picasso to remove lag in emojis<commit_after>package pingbits.com.emojikeyboard.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

import pingbits.com.emojikeyboard.EmojiManager;
import pingbits.com.emojikeyboard.R;
import pingbits.com.emojikeyboard.objects.Emoji;

/**
 * Created by aagam on 6/2/15.
 */
public class EmojiAdapter extends BaseAdapter {

    public LayoutInflater inflater;
    public Context ctx;
    public Emoji[] emojis;
    public EmojiAdapter(Context context, Emoji[] mData) {
        ctx = context;
        inflater = LayoutInflater.from(ctx);
        emojis = mData;
    }

    @Override
    public int getCount() {
        return emojis.length;
    }

    @Override
    public Object getItem(int position) {
        return emojis[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView == null){
            convertView = inflater.inflate(R.layout.item_emoji_grid,null,false);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else{
            holder = (ViewHolder)convertView.getTag();
        }
//        holder.emojiIcon.setImageResource(EmojiManager.sEmojisMap.get(emojis[position].codepoint));
        Picasso.with(ctx).load(EmojiManager.sEmojisMap.get(emojis[position].codepoint)).into(holder.emojiIcon);
        return convertView;
    }
{'fraction_non_alphanumeric': 0.0957972805933251, 'fraction_numerical': 0.002472187886279357, 'mean_word_length': 3.081967213114754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2277752', 'n_tokens_mistral': 992, 'n_tokens_neox': 974, 'n_words': 199}