public class MediaStoreAdapter
extends CursorAdapter
| Constructor and Description |
|---|
MediaStoreAdapter(android.content.Context context,
int id_layout) |
| Modifier and Type | Method and Description |
|---|---|
void |
bindView(android.view.View view,
android.content.Context context,
android.database.Cursor cursor) |
protected MediaStoreHelper.LoaderDrawable |
createLoaderDrawable(android.content.ContentResolver cr) |
static void |
destroy()
if you finish using this adapter class in your app,
you can call this method to free internal thumbnail cache
|
protected void |
finalize() |
android.graphics.Bitmap |
getImage(int position,
int width,
int height)
return image with specific size(only scale-down or original size are available now)
if width=0 and height=0, return image with original size.
|
android.graphics.Bitmap |
getItem(int position)
return thumbnail image at specific position.
|
MediaStoreHelper.MediaInfo |
getMediaInfo(int position)
get MediaInfo at specified position
|
MediaStoreHelper.MediaInfo |
getMediaInfo(int position,
MediaStoreHelper.MediaInfo info) |
int |
getMediaType() |
int |
getPositionFromId(long id) |
boolean |
getShowTitle() |
android.view.View |
newView(android.content.Context context,
android.database.Cursor cursor,
android.view.ViewGroup parent) |
protected void |
onContentChanged() |
void |
setMediaType(int media_type) |
void |
setShowTitle(boolean showTitle) |
void |
setThumbnailSize(int size)
set thumbnail size, if you set size to zero, the size is 96x96(MediaStore.Images.Thumbnails.MICRO_KIND)
|
void |
setThumbnailSize(int width,
int height)
set thumbnail size, if you set both width and height to zero, the size is 96x96(MediaStore.Images.Thumbnails.MICRO_KIND)
|
public MediaStoreAdapter(android.content.Context context,
int id_layout)
public android.view.View newView(android.content.Context context,
android.database.Cursor cursor,
android.view.ViewGroup parent)
protected MediaStoreHelper.LoaderDrawable createLoaderDrawable(android.content.ContentResolver cr)
public void bindView(android.view.View view,
android.content.Context context,
android.database.Cursor cursor)
protected void finalize()
throws java.lang.Throwable
java.lang.Throwableprotected void onContentChanged()
public android.graphics.Bitmap getItem(int position)
public int getPositionFromId(long id)
public android.graphics.Bitmap getImage(int position,
int width,
int height)
throws java.io.FileNotFoundException,
java.io.IOException
position - width - height - java.io.FileNotFoundExceptionjava.io.IOExceptionpublic MediaStoreHelper.MediaInfo getMediaInfo(int position)
position - public MediaStoreHelper.MediaInfo getMediaInfo(int position, MediaStoreHelper.MediaInfo info)
public void setThumbnailSize(int size)
size - public void setThumbnailSize(int width,
int height)
width - height - public void setShowTitle(boolean showTitle)
public boolean getShowTitle()
public int getMediaType()
public void setMediaType(int media_type)
public static void destroy()