Class BitmapManager
- java.lang.Object
-
- com.cloudinary.android.uploadwidget.model.BitmapManager
-
public class BitmapManager extends java.lang.ObjectAsynchronous bitmap manager that loads and saves bitmaps. The manager uses aLruCacheto cache the bitmaps for better performance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBitmapManager.LoadCallbackCallback for loading a bitmap.static interfaceBitmapManager.SaveCallbackCallback for saving a bitmap into a file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BitmapManagerget()Return a bitmap manager instance.voidload(android.content.Context context, android.net.Uri uri, int width, int height, BitmapManager.LoadCallback callback)Load the uri and downsample the bitmap, adjusting it to the specified dimensions.voidsave(android.content.Context context, android.graphics.Bitmap bitmap, BitmapManager.SaveCallback callback)Save the bitmap into a filevoidthumbnail(android.content.Context context, android.net.Uri uri, int width, int height, BitmapManager.LoadCallback callback)Get a video file's thumbnail.
-
-
-
Method Detail
-
get
public static BitmapManager get()
Return a bitmap manager instance.
-
load
public void load(android.content.Context context, android.net.Uri uri, int width, int height, BitmapManager.LoadCallback callback)Load the uri and downsample the bitmap, adjusting it to the specified dimensions.- Parameters:
context- Android contexturi- Uri of the image to be loadedwidth- Width for the output bitmap to be adjusted to (not necessarily exact fit).height- Height for the output bitmap to be adjusted to (not necessarily exact fit).callback- The callback to be called when loading the bitmap.
-
thumbnail
public void thumbnail(android.content.Context context, android.net.Uri uri, int width, int height, BitmapManager.LoadCallback callback)Get a video file's thumbnail.- Parameters:
context- Android context.uri- Uri of the video file.width- Thumbnail's width.height- Thumbnail's height.callback- The callback to be called when loading the thumbnail.
-
save
public void save(android.content.Context context, android.graphics.Bitmap bitmap, BitmapManager.SaveCallback callback)Save the bitmap into a file- Parameters:
context- Android context.bitmap- Bitmap to save.callback- the callback to be called when saving the bitmap.
-
-