com.github.ignition.core.adapters
Class RemoteImageGalleryAdapter

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

public class RemoteImageGalleryAdapter
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 using embedded RemoteImageViews.

Author:
Matthias Kaeppler

Field Summary
 
Fields inherited from interface android.widget.Adapter
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION
 
Constructor Summary
RemoteImageGalleryAdapter(android.content.Context context)
           
RemoteImageGalleryAdapter(android.content.Context context, List<String> imageUrls)
           
RemoteImageGalleryAdapter(android.content.Context context, List<String> imageUrls, android.graphics.drawable.Drawable progressDrawable, android.graphics.drawable.Drawable errorDrawable)
           
 
Method Summary
 int getCount()
           
 android.graphics.drawable.Drawable getErrorDrawable()
           
 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, RemoteImageView remoteImageView, android.view.ViewGroup remoteImageViewContainer, android.view.ViewGroup parent)
          Override this to configure the views that are rendered for each gallery element.
 void setErrorDrawable(android.graphics.drawable.Drawable errorDrawable)
           
 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
 

Constructor Detail

RemoteImageGalleryAdapter

public RemoteImageGalleryAdapter(android.content.Context context)

RemoteImageGalleryAdapter

public RemoteImageGalleryAdapter(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

RemoteImageGalleryAdapter

public RemoteImageGalleryAdapter(android.content.Context context,
                                 List<String> imageUrls,
                                 android.graphics.drawable.Drawable progressDrawable,
                                 android.graphics.drawable.Drawable errorDrawable)
Parameters:
context - the current context
imageUrls - the set of image URLs which are to be loaded and displayed
progressDrawable - the drawable that will be used for rendering progress
errorDrawable - 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()

setErrorDrawable

public void setErrorDrawable(android.graphics.drawable.Drawable errorDrawable)

getErrorDrawable

public android.graphics.drawable.Drawable getErrorDrawable()

getView

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

onGetView

protected void onGetView(int position,
                         RemoteImageView remoteImageView,
                         android.view.ViewGroup remoteImageViewContainer,
                         android.view.ViewGroup parent)
Override this to configure the views that are rendered for each gallery element. The default implementation does nothing.

Parameters:
position - the current position in the gallery
remoteImageView - the RemoteImageView that is used to render a gallery image
remoteImageViewContainer - The cell that makes up an item in the gallery. It contains remoteImageView as a child.
parent - the container's parent view


Copyright © 2012. All Rights Reserved.