com.github.droidfu.adapters
Class WebGalleryAdapter

java.lang.Object
  extended by android.widget.BaseAdapter
      extended by com.github.droidfu.adapters.WebGalleryAdapter
All Implemented Interfaces:
android.widget.Adapter, android.widget.ListAdapter, android.widget.SpinnerAdapter

public class WebGalleryAdapter
extends android.widget.BaseAdapter

Can be used as an adapter for an Android Gallery view. This adapter loads the images to be shown from the web.

Author:
Matthias Kaeppler

Field Summary
static int NO_DRAWABLE
           
 
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
 
Constructor Summary
WebGalleryAdapter(android.content.Context context)
           
WebGalleryAdapter(android.content.Context context, List<String> imageUrls)
           
WebGalleryAdapter(android.content.Context context, List<String> imageUrls, int progressDrawableResId)
           
WebGalleryAdapter(android.content.Context context, List<String> imageUrls, int progressDrawableResId, int errorDrawableId)
           
 
Method Summary
 int getCount()
           
 List<String> getImageUrls()
           
 Object getItem(int position)
           
 long getItemId(int position)
           
 android.graphics.drawable.Drawable getProgressDrawable()
           
 android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent)
           
protected  void onGetView(int position, android.view.View convertView, android.view.ViewGroup parent)
           
 void setImageUrls(List<String> imageUrls)
           
 void setProgressDrawable(android.graphics.drawable.Drawable progressDrawable)
           
 
Methods inherited from class android.widget.BaseAdapter
areAllItemsEnabled, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, unregisterDataSetObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_DRAWABLE

public static final int NO_DRAWABLE
See Also:
Constant Field Values
Constructor Detail

WebGalleryAdapter

public WebGalleryAdapter(android.content.Context context)

WebGalleryAdapter

public WebGalleryAdapter(android.content.Context context,
                         List<String> imageUrls)
Parameters:
context - the current context
imageUrls - the set of image URLs which are to be loaded and displayed

WebGalleryAdapter

public WebGalleryAdapter(android.content.Context context,
                         List<String> imageUrls,
                         int progressDrawableResId)
Parameters:
context - the current context
imageUrls - the set of image URLs which are to be loaded and displayed
progressDrawableResId - the resource ID of the drawable that will be used for rendering progress

WebGalleryAdapter

public WebGalleryAdapter(android.content.Context context,
                         List<String> imageUrls,
                         int progressDrawableResId,
                         int errorDrawableId)
Parameters:
context - the current context
imageUrls - the set of image URLs which are to be loaded and displayed
progressDrawableResId - the resource ID of the drawable that will be used for rendering progress
errorDrawableId - the resource ID of the drawable that will be used if a download error occurs
Method Detail

getCount

public int getCount()

getItem

public Object getItem(int position)

getItemId

public long getItemId(int position)

setImageUrls

public void setImageUrls(List<String> imageUrls)

getImageUrls

public List<String> getImageUrls()

setProgressDrawable

public void setProgressDrawable(android.graphics.drawable.Drawable progressDrawable)

getProgressDrawable

public android.graphics.drawable.Drawable getProgressDrawable()

getView

public android.view.View getView(int position,
                                 android.view.View convertView,
                                 android.view.ViewGroup parent)

onGetView

protected void onGetView(int position,
                         android.view.View convertView,
                         android.view.ViewGroup parent)


Copyright © 2011. All Rights Reserved.