com.github.ignition.core.adapters
Class RemoteImageGalleryAdapter
java.lang.Object
android.widget.BaseAdapter
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 RemoteImageView
s.
- Author:
- Matthias Kaeppler
Fields inherited from interface android.widget.Adapter |
IGNORE_ITEM_VIEW_TYPE, NO_SELECTION |
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 |
RemoteImageGalleryAdapter
public RemoteImageGalleryAdapter(android.content.Context context)
RemoteImageGalleryAdapter
public RemoteImageGalleryAdapter(android.content.Context context,
List<String> imageUrls)
- Parameters:
context
- the current contextimageUrls
- 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 contextimageUrls
- the set of image URLs which are to be loaded and displayedprogressDrawable
- the drawable that will be used for rendering progresserrorDrawable
- the drawable that will be used if a download error occurs
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 galleryremoteImageView
- the RemoteImageView
that is used to render a gallery imageremoteImageViewContainer
- 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.