public abstract class ImageGalleryBaseAdapter
extends android.widget.BaseAdapter
Modifier and Type | Class and Description |
---|---|
static interface |
ImageGalleryBaseAdapter.ThumbnailCreator<T> |
protected static class |
ImageGalleryBaseAdapter.ViewHolder<T> |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class<?>,HierarchyListFilter> |
filters |
protected ImageGalleryReceiver |
receiver |
protected LimitingThread |
refreshThread |
Modifier | Constructor and Description |
---|---|
protected |
ImageGalleryBaseAdapter(MapView mapView,
android.view.View progressBar,
boolean showDetails) |
Modifier and Type | Method and Description |
---|---|
void |
addFilter(HierarchyListFilter filter)
Add filter to the list of filters to be run when refreshing
Only one filter per class is allowed
|
abstract void |
customizeGalleryView(android.view.View gallery)
Customizes image gallery view elements (e.g., visibility, click handlers)
as needed by the adapter.
|
abstract void |
customizeToolbarView(android.view.View toolbar)
Customizes image gallery toolbar view elements (e.g., visibility, click
handlers) as needed by the adapter.
|
protected abstract void |
displayFile(GalleryItem item)
Display the supplied item, which was clicked in the gallery and has been
determined not to represent an image or video.
|
protected void |
displayImage(GalleryItem item)
Display the supplied item, which was clicked in the gallery and has been
determined to represent an image.
|
protected abstract void |
displayVideo(GalleryItem item)
Display the supplied item, which was clicked in the gallery and has been
determined to represent a video.
|
void |
dispose() |
protected static <ItemT extends GalleryItem> |
getCacheFile(ItemT item,
java.lang.String destExt)
Returns a File representing the possible cache location of the supplied
item with the supplied filename extension.
|
protected boolean |
getDisplayDetails() |
abstract DropDown.OnStateListener |
getDropDownStateListener() |
protected FileCache |
getFileCache() |
android.widget.AdapterView.OnItemClickListener |
getGridViewClickListener() |
protected abstract java.lang.String[] |
getImageURIs()
Returns an array of the URIs of GalleryItems that are of an image MIME
type.
|
protected java.util.concurrent.Executor |
getLoadExecutor() |
protected MapView |
getMapView() |
protected java.util.concurrent.Executor |
getSaveExecutor() |
protected java.lang.String |
getTitle(GalleryItem item) |
protected java.lang.String[] |
getTitles()
Returns an array of titles, Either null, or 1-1 with getImageURIs()
|
protected void |
hideProgressBar() |
void |
refresh()
Refresh this adapter after making changes to its contents
|
protected abstract void |
refreshImpl()
Refresh called on non-UI thread
|
void |
removeFilter(java.lang.Class<?> filterClass)
Remove a filter type from the list
|
void |
removeFilter(HierarchyListFilter filter)
Remove a filter from the list
|
static android.graphics.Bitmap |
rotateBitmap(android.graphics.Bitmap bmp,
int orientation)
Rotates the supplied bitmap to the orientation specified by the supplied
Exif orientation tag value.
|
void |
setDisplayDetails(boolean showDetails) |
protected <ItemT extends GalleryItem> |
setItemThumbnail(ImageGalleryBaseAdapter.ViewHolder<ItemT> holder,
ImageGalleryBaseAdapter.ThumbnailCreator<ItemT> thumbCreator) |
void |
setReceiver(ImageGalleryReceiver receiver) |
protected void |
showProgressBar() |
protected static void |
updateLastModified(java.io.File f) |
areAllItemsEnabled, getAutofillOptions, getDropDownView, getItemViewType, getViewTypeCount, hasStableIds, isEmpty, isEnabled, notifyDataSetChanged, notifyDataSetInvalidated, registerDataSetObserver, setAutofillOptions, unregisterDataSetObserver
protected ImageGalleryReceiver receiver
protected final java.util.Map<java.lang.Class<?>,HierarchyListFilter> filters
protected final LimitingThread refreshThread
protected ImageGalleryBaseAdapter(MapView mapView, android.view.View progressBar, boolean showDetails)
public abstract void customizeGalleryView(android.view.View gallery)
gallery
- The image gallery view.public abstract void customizeToolbarView(android.view.View toolbar)
toolbar
- The image gallery's toolbar view.public void dispose()
public abstract DropDown.OnStateListener getDropDownStateListener()
public android.widget.AdapterView.OnItemClickListener getGridViewClickListener()
public static android.graphics.Bitmap rotateBitmap(android.graphics.Bitmap bmp, int orientation)
bmp
- Bitmap to be rotated (and recycled).orientation
- Exif orientation tag value as defined by
android.media.ExifInterfacepublic void setDisplayDetails(boolean showDetails)
public void addFilter(HierarchyListFilter filter)
filter
- Filter objectpublic void removeFilter(HierarchyListFilter filter)
filter
- Filter objectpublic void removeFilter(java.lang.Class<?> filterClass)
filterClass
- Filter classprotected abstract void displayFile(GalleryItem item)
item
- The GalleryItem to be displayed as a file.protected void displayImage(GalleryItem item)
item
- The GalleryItem to be displayed as an image.protected abstract void displayVideo(GalleryItem item)
item
- The GalleryItem to be displayed as a video.public void setReceiver(ImageGalleryReceiver receiver)
public void refresh()
protected abstract void refreshImpl()
protected static <ItemT extends GalleryItem> java.io.File getCacheFile(ItemT item, java.lang.String destExt)
item
- The GalleryItem to be found/placed in the cache.destExt
- The filename extension for the cached file.protected boolean getDisplayDetails()
protected FileCache getFileCache()
protected abstract java.lang.String[] getImageURIs()
protected java.lang.String[] getTitles()
protected java.lang.String getTitle(GalleryItem item)
protected MapView getMapView()
protected java.util.concurrent.Executor getLoadExecutor()
protected java.util.concurrent.Executor getSaveExecutor()
protected void hideProgressBar()
protected <ItemT extends GalleryItem> void setItemThumbnail(ImageGalleryBaseAdapter.ViewHolder<ItemT> holder, ImageGalleryBaseAdapter.ThumbnailCreator<ItemT> thumbCreator)
protected void showProgressBar()
protected static void updateLastModified(java.io.File f) throws java.io.IOException
java.io.IOException