Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Taukytabview extends BaseAdapter{
- Context mcontext;
- private LayoutInflater inflater;
- ArrayList<Bitmap> images;
- public static int tuaky_size=0;
- int count=0;
- //public boolean[] thumbnailsselection;
- public static ArrayList<Bitmap> Selected_tauky;
- public static ArrayList<Integer> index_tracker;
- public static ArrayList<String> selected_audiodata;
- public Taukytabview(Context context, ArrayList<Bitmap> convertbitmap) {
- // TODO Auto-generated constructor stub
- mcontext=context;
- inflater=(LayoutInflater) mcontext.getSystemService(mcontext.LAYOUT_INFLATER_SERVICE);
- images=new ArrayList<Bitmap>();
- Selected_tauky=new ArrayList<Bitmap>();
- index_tracker=new ArrayList<Integer>();
- selected_audiodata=new ArrayList<String>();
- images=convertbitmap;
- count=images.size();
- tuaky_size=images.size();
- }
- @Override
- public int getCount() {
- // TODO Auto-generated method stub
- //this.thumbnailsselection=new boolean[this.my_images.length];
- return count;
- }
- @Override
- public Object getItem(int position) {
- // TODO Auto-generated method stub
- return position;
- }
- @Override
- public long getItemId(int position) {
- // TODO Auto-generated method stub
- return position;
- }
- @Override
- public View getView( final int position, View convertView, ViewGroup arg2) {
- // TODO Auto-generated method stub
- final ViewHolder holder;
- if(convertView==null)
- {
- holder=new ViewHolder();
- convertView=inflater.inflate(R.layout.taukytab_gridview_layout, null);
- holder.imageview=(ImageView) convertView.findViewById(R.id.taukytab_grid_image);
- holder.select_button=(ImageButton) convertView.findViewById(R.id.tuaky_select_imagebutt);
- holder.select_button.setVisibility(View.GONE);
- convertView.setTag(holder);
- convertView.setTag(R.id.tuaky_select_imagebutt, holder.select_button);
- convertView.setTag(R.id.taukytab_grid_image, holder.imageview);
- }
- else
- {
- holder=(ViewHolder) convertView.getTag();
- }
- holder.imageview.setImageBitmap(images.get(position));
- //holder.mcheckbox.setChecked(thumbnailsselection[position]);
- holder.id=position;
- holder.imageview.setId(position);
- holder.select_button.setId(position);
- holder.imageview.setTag(position);
- holder.select_button.setTag(position);
- return convertView;
- }
- // Integer[]my_images={R.drawable.images1,R.drawable.images2,
- // R.drawable.images3,R.drawable.images4,R.drawable.images5,
- // R.drawable.images6,R.drawable.images7,R.drawable.images8,
- // R.drawable.images8,R.drawable.images9,R.drawable.images8,R.drawable.images10,
- // R.drawable.images11,R.drawable.images12,R.drawable.images13,R.drawable.images14,
- // R.drawable.images15,R.drawable.images16,R.drawable.images17,R.drawable.images18};
- }
- class ViewHolder
- {
- ImageView imageview;
- ImageButton select_button;
- int id;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement