public void resetIfWrongSource(BitmapSource bitmapSource) { if (mCurrentImageSource == null || !bitmapSource .getAbsoluteFileName(Type.THM) .equals(mCurrentImageSource.getAbsoluteFileName(Type.THM))) { reset(); } }
public void startLoading(BitmapSource bitmapSource) { if (mCurrentImageSource == null || !mCurrentImageSource .getAbsoluteFileName(Type.THM) .equals(bitmapSource.getAbsoluteFileName(Type.THM))) { // Different image than the current one, need to load mCurrentImageSource = bitmapSource; mBitmapLoader.cancel(); reset(); mBitmapLoader.loadAsync(bitmapSource, Type.THM, Config.RGB_565, Volatility.DEFAULT, this); } }
public void loadOnlyIfInMemCache(BitmapSource bitmapSource, int position) { mCurrentImageSource = bitmapSource; Bitmap bitmap = BitmapCache.getInstance().getFromMemory(bitmapSource.getAbsoluteFileName(Type.THM)); if (bitmap != null && (mBitmapDrawable == null || mBitmapDrawable.getBitmap() != bitmap)) { mBitmapDrawable = new BitmapDrawable(bitmap); setImageDrawable(mBitmapDrawable); invalidate(); } }