Android Open Source - GridImageSearch Image Result Array Adapter






From Project

Back to project page GridImageSearch.

License

The source code is released under:

Copyright (c) 2014 Keithen Hayenga Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the So...

If you think the Android project GridImageSearch 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.gridimagesearch;
//from  www  .j av a 2 s .  c  o m
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;
    if (convertView == null) {
      LayoutInflater inflator = LayoutInflater.from(getContext());
      ivImage = (SmartImageView) inflator.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.codepath.gridimagesearch.EndlessScrollListener.java
com.codepath.gridimagesearch.GridSearchPrefs.java
com.codepath.gridimagesearch.ImageDisplayActivity.java
com.codepath.gridimagesearch.ImageResultArrayAdapter.java
com.codepath.gridimagesearch.ImageResult.java
com.codepath.gridimagesearch.SearchActivity.java
com.codepath.gridimagesearch.SearchOptionsActivity.java