Back to project page android-grid-image-search.
The source code is released under:
MIT License
If you think the Android project android-grid-image-search listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.gemmakbarlow.gridimagesearch; /*w w w. j a va 2s . co m*/ import java.util.List; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import com.gemmakbarlow.gridimagesearch.model.ImageResult; import com.loopj.android.image.SmartImageView; public class ImageResultArrayAdapter extends ArrayAdapter<ImageResult> { public ImageResultArrayAdapter(Context context, List<ImageResult> objects) { super(context, R.layout.item_image_result, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { ImageResult imageInfo = this.getItem(position); SmartImageView ivImage = null; if(convertView == null) { LayoutInflater inflater = LayoutInflater.from(getContext()); ivImage = (SmartImageView)inflater.inflate(R.layout.item_image_result, parent, false); } else { ivImage = (SmartImageView)convertView; ivImage.setImageResource(android.R.color.transparent); } ivImage.setImageUrl(imageInfo.getThumbUrl()); return ivImage; } }