public View getView(final int position, View convertView, ViewGroup parent) {
final Holder holder;
if (convertView == null) {
holder = new Holder();
convertView = View.inflate(act, R.layout.item_image_grid, null);
holder.iv = (ImageView) convertView.findViewById(R.id.image);
holder.selected = (ImageView) convertView
.findViewById(R.id.isselected);
holder.text = (TextView) convertView
.findViewById(R.id.item_image_grid_text);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
final ImageItem item = dataList.get(position);
holder.iv.setTag(item.imagePath);
cache.displayBmp(holder.iv, item.thumbnailPath, item.imagePath,
callback);
if (item.isSelected) {
holder.selected.setImageResource(R.drawable.icon_data_select);
holder.text.setBackgroundResource(R.drawable.bgd_relatly_line);
} else {
holder.selected.setImageResource(-1);
holder.text.setBackgroundColor(0x00000000);
} |