Android Open Source - image-rover Image Result Array Adapter






From Project

Back to project page image-rover.

License

The source code is released under:

MIT License

If you think the Android project image-rover 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.codepath.wangela.apps.image;
/* w w w  .j  a v  a 2s. com*/
import java.util.List;

import com.loopj.android.image.SmartImageView;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

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 imageInfo = this.getItem(position);
    SmartImageView ivImage;
    //ViewHolder viewHolder; // view lookup cache stored in tag
    // Check if an existing view is being reused; otherwise, inflate the view
    if (convertView == null) {
      //viewHolder = new ViewHolder();
      LayoutInflater inflater = LayoutInflater.from(getContext());
      ivImage = (SmartImageView) inflater.inflate(R.layout.item_image_result, parent, false);
      //ivImage.setTag(viewHolder);
    } else {
      //viewHolder = (ViewHolder) ivImage.getTag();
      ivImage = (SmartImageView) convertView;
      ivImage.setImageResource(android.R.color.transparent);
    }
    ivImage.setImageUrl(imageInfo.getThumbUrl());
    return ivImage;
  }
  
  // View lookup cache
  //public static class ViewHolder {
  //  SmartImageView ivImage;
  //}
  
}




Java Source Code List

com.codepath.wangela.apps.image.EndlessScrollListener.java
com.codepath.wangela.apps.image.FilterSettings.java
com.codepath.wangela.apps.image.ImageDisplayActivity.java
com.codepath.wangela.apps.image.ImageResultArrayAdapter.java
com.codepath.wangela.apps.image.ImageResult.java
com.codepath.wangela.apps.image.SearchActivity.java