package ai.pai.client.utils;

import android.content.Context;

import java.util.Random;

import ai.pai.client.R;
import ai.pai.client.db.Preferences;

/**
 * Created by chengzhenyu on 16/3/6.
 */
public class GroupCreateUtils {

    private static final int MAX_DEFAULT_GROUP_TYPE = 19;

    private static final int[] GROUP_AVATAR_LIST = {
            R.drawable.apple,
            R.drawable.banana,
            R.drawable.broccoli,
            R.drawable.carambola,
            R.drawable.carrot,
            R.drawable.cherry,
            R.drawable.corn,
            R.drawable.dragon,
            R.drawable.eggplant,
            R.drawable.fig,
            R.drawable.grape,
            R.drawable.lemon,
            R.drawable.mangosteen,
            R.drawable.orange,
            R.drawable.papaya,
            R.drawable.peach,
            R.drawable.pineapple,
            R.drawable.strawberry,
            R.drawable.watermelon
           };


    public static int getRandomSeqForCreateGroup(){
        return new Random().nextInt(MAX_DEFAULT_GROUP_TYPE);
    }

    public static int  getDrawableIdForAvatar(int seq){
        return GROUP_AVATAR_LIST[seq];
    }

    public static String getGroupName(Context context, int seq){
        return Preferences.getInstance(context).getNickName()+context.getResources().getStringArray(R.array.group_name)[seq];
    }

}
