Example #1
0
 @Override
 public View getView(int arg0, View arg1, ViewGroup arg2) {
   // TODO Auto-generated method stub
   Holder holder;
   if (arg1 == null) {
     holder = new Holder();
     arg1 = View.inflate(context, R.layout.item_image_bucket, null);
     holder.iv = (ImageView) arg1.findViewById(R.id.image);
     holder.selected = (ImageView) arg1.findViewById(R.id.isselected);
     holder.name = (TextView) arg1.findViewById(R.id.name);
     holder.count = (TextView) arg1.findViewById(R.id.count);
     arg1.setTag(holder);
   } else {
     holder = (Holder) arg1.getTag();
   }
   ImageBucket item = dataList.get(arg0);
   holder.count.setText("共" + item.count + "张");
   holder.name.setText(item.bucketName);
   holder.selected.setVisibility(View.GONE);
   if (item.imageList != null && item.imageList.size() > 0) {
     String thumbPath = item.imageList.get(0).thumbnailPath;
     String sourcePath = item.imageList.get(0).imagePath;
     holder.iv.setTag(sourcePath);
     cache.displayBmp(holder.iv, thumbPath, sourcePath, callback);
   } else {
     holder.iv.setImageBitmap(null);
     Log.e(TAG, "no images in bucket " + item.bucketName);
   }
   return arg1;
 }
Example #2
0
 @Override
 public View getView(int arg0, View convertView, ViewGroup arg2) {
   // TODO Auto-generated method stub
   Holder mHolder = null;
   if (convertView == null) {
     convertView = mInflater.inflate(R.layout.exchange_item, null);
     mHolder = new Holder();
     mHolder.name = (TextView) convertView.findViewById(R.id.name);
     mHolder.date = (TextView) convertView.findViewById(R.id.date);
     mHolder.count = (TextView) convertView.findViewById(R.id.count);
     convertView.setTag(mHolder);
   } else {
     mHolder = (Holder) convertView.getTag();
   }
   mHolder.name.setText(IndexFunc.funcs_name[arg0]);
   return convertView;
 }