/BitmapAdapter

An Android class for handling bitmap loading from file or network/Internet

Primary LanguageJava

BitmapAdapter

An Android class for handling bitmap loading from file or network/Internet

Initialized with
initBitmapCache();
This is safe to be called multiple times, it will not destroy the cache if already initialized.

Bitmaps are called using a single method
getBitmap(String path, Integer type, Integer method, ImageView imageView, BitmapResponse response)
path: path to the file, filesystem path or url string
type: url or file request, TYPE_URL or TYPE_FILE
method: return the bitmap or set the bitmap to imageview, METHOD_GET or METHOD_SET
imageView: the imageview to set the bitmap to or null
response: the BitmapResponse callback or null

Set up a BitmapResponse callback like so
BitmapAdapter.BitmapResponse returnResponse = new BitmapAdapter.BitmapResponse() {
@Override
public void bitmapReturn(Bitmap bitmap) {
Log.i(TAG, "Bitmap return triggered");
}
};

bitmapAdapter.getBitmap(address, BitmapAdapter.TYPE_URL, BitmapAdapter.METHOD_GET, null, returnResponse);