Android Open Source - AndroidGridImageSearch Image Result Array Adapter






From Project

Back to project page AndroidGridImageSearch.

License

The source code is released under:

MIT License

If you think the Android project AndroidGridImageSearch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.julienlecomte.gridimagesearch;
//from ww  w.j a  v a  2 s.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.loopj.android.image.SmartImageView;

public class ImageResultArrayAdapter extends ArrayAdapter<ImageResult> {

  public ImageResultArrayAdapter(Context context, List<ImageResult> images) {
    super(context, R.layout.item_image_result, images);
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    ImageResult image = this.getItem(position);

    SmartImageView sivImage;

    if (convertView == null) {
      LayoutInflater inflator = LayoutInflater.from(getContext());
      sivImage = (SmartImageView) inflator.inflate(R.layout.item_image_result, parent, false);
    } else {
      sivImage = (SmartImageView) convertView;
      sivImage.setImageResource(android.R.color.transparent);
    }

    sivImage.setImageUrl(image.getThumbUrl());

    return sivImage;
  }
}




Java Source Code List

net.julienlecomte.gridimagesearch.EndlessScrollListener.java
net.julienlecomte.gridimagesearch.ImageDisplayActivity.java
net.julienlecomte.gridimagesearch.ImageResultArrayAdapter.java
net.julienlecomte.gridimagesearch.ImageResult.java
net.julienlecomte.gridimagesearch.SearchActivity.java
net.julienlecomte.gridimagesearch.SearchSettings.java
net.julienlecomte.gridimagesearch.SettingsActivity.java