package com.androidbegin.buttonclicktutorial;

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

public class GridAdapter01 extends ArrayAdapter
{
         Context context;
      
         private LayoutInflater Inflater;


     public GridAdapter01(Context context)
     {
             super(context, 0);
             this.context=context;
            
     }
   
     public int getCount()
        {
                     return 24;
        }

     @Override
     public View getView(int position, View convertView, ViewGroup parent)
     {
             View row = convertView;
            
             if (row == null)
             {
                    // LayoutInflater inflater = ((Activity) context).getLayoutInflater();
                     
                     
                     
                     row = Inflater.inflate(R.layout.grid_layout, parent, false);


                     TextView textViewTitle = (TextView) row.findViewById(R.id.item_text);
                     //ImageView imageViewIte = (ImageView) row.findViewById(R.id.imageView);
                     textViewTitle.setText("Facebook");
                     
                     /*if(position%2==0)
                     {
                             textViewTitle.setText("Facebook");
                             imageViewIte.setImageResource(R.drawable.facebook);
                     }
                     else
                     {
                             textViewTitle.setText("Twitter");
                             imageViewIte.setImageResource(R.drawable.twitter);
                     }*/
             }

   
     
      return row;

     }

}