Android Open Source - android-grid-image-search Image Result Array Adapter






From Project

Back to project page android-grid-image-search.

License

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.

Java Source Code

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;
  }

}




Java Source Code List

com.gemmakbarlow.gridimagesearch.AdvancedFilterActivity.java
com.gemmakbarlow.gridimagesearch.EndlessScrollListener.java
com.gemmakbarlow.gridimagesearch.ImageDisplayActivity.java
com.gemmakbarlow.gridimagesearch.ImageResultArrayAdapter.java
com.gemmakbarlow.gridimagesearch.SearchActivity.java
com.gemmakbarlow.gridimagesearch.model.ImageResult.java
com.gemmakbarlow.gridimagesearch.model.SearchQuery.java