Search in sources :

Example 1 with BitmapScreenNail

use of com.android.gallery3d.ui.BitmapScreenNail in project android_packages_apps_Gallery2 by LineageOS.

the class PhotoDataAdapter method updateScreenNail.

private void updateScreenNail(Path path, Future<ScreenNail> future) {
    ImageEntry entry = mImageCache.get(path);
    ScreenNail screenNail = future.get();
    if (entry == null || entry.screenNailTask != future) {
        if (screenNail != null)
            screenNail.recycle();
        return;
    }
    entry.screenNailTask = null;
    // Combine the ScreenNails if we already have a BitmapScreenNail
    if (entry.screenNail instanceof TiledScreenNail) {
        TiledScreenNail original = (TiledScreenNail) entry.screenNail;
        screenNail = original.combine(screenNail);
    }
    if (screenNail == null) {
        entry.failToLoad = true;
    } else {
        entry.failToLoad = false;
        entry.screenNail = screenNail;
    }
    for (int i = -SCREEN_NAIL_MAX; i <= SCREEN_NAIL_MAX; ++i) {
        if (path == getPath(mCurrentIndex + i)) {
            if (i == 0)
                updateTileProvider(entry);
            mPhotoView.notifyImageChange(i);
            break;
        }
    }
    updateImageRequests();
    updateScreenNailUploadQueue();
}
Also used : TiledScreenNail(com.android.gallery3d.ui.TiledScreenNail) BitmapScreenNail(com.android.gallery3d.ui.BitmapScreenNail) ScreenNail(com.android.gallery3d.ui.ScreenNail) TiledScreenNail(com.android.gallery3d.ui.TiledScreenNail)

Example 2 with BitmapScreenNail

use of com.android.gallery3d.ui.BitmapScreenNail in project android_packages_apps_Gallery2 by LineageOS.

the class SinglePhotoDataAdapter method setScreenNail.

private void setScreenNail(Bitmap bitmap, int width, int height) {
    mBitmapScreenNail = new BitmapScreenNail(bitmap);
    setScreenNail(mBitmapScreenNail, width, height);
}
Also used : BitmapScreenNail(com.android.gallery3d.ui.BitmapScreenNail)

Aggregations

BitmapScreenNail (com.android.gallery3d.ui.BitmapScreenNail)2 ScreenNail (com.android.gallery3d.ui.ScreenNail)1 TiledScreenNail (com.android.gallery3d.ui.TiledScreenNail)1