package com.mooo.ziggypop.candconline;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;


import java.util.ArrayList;

/**
 * Created by ziggypop on 3/31/15.
 *
 */
public class DrawerAdapter extends ArrayAdapter<DrawerItem> {

    public DrawerAdapter(Context context, int resource, ArrayList<DrawerItem> items){
        super(context, resource, items);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View v = convertView;

        if (v == null) {

            LayoutInflater vi;
            vi = LayoutInflater.from(getContext());
            v = vi.inflate(R.layout.drawer_item_layout, null);


        }


        DrawerItem p = getItem(position);


        if (p != null) {
            TextView title = (TextView) v.findViewById(R.id.drawer_game_title);
            TextView playerCount = (TextView) v.findViewById(R.id.drawer_player_count);

            title.setText(p.getGameTitle());
            String playerCountText = "("+p.getPlayerCount()+")";
            playerCount.setText(playerCountText);

        }


        return v;
    }
}

@@ -298,16 +298,31 @@
 1/15.%0A *
+ Adapts Drawers
 %0A */%0Apub
@@ -806,25 +806,24 @@
 ut, null);%0A%0A
-%0A
         %7D%0A%0A%0A
@@ -813,33 +813,32 @@
 l);%0A%0A        %7D%0A%0A
-%0A
         DrawerIt
@@ -864,17 +864,16 @@
 tion);%0A%0A
-%0A
         
@@ -1144,12 +1144,29 @@
 t = 
-%22(%22+
+String.format(%22(%25s)%22,
 p.ge
@@ -1183,12 +1183,9 @@
 nt()
-+%22)%22
+)
 ;%0A  
@@ -1243,18 +1243,16 @@
       %7D%0A
-%0A%0A
         

change string concat to String.format()