From: tobiasKaminsky Date: Sat, 31 Oct 2015 07:10:34 +0000 (+0100) Subject: Merge remote-tracking branch 'remotes/upstream/resizedImages' into beta X-Git-Tag: beta-20151122~69 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/e6eb26a13057cdb4b5c3c67a624ebb1267111f4b?hp=742200a70d75c539031442fa7b071a42c649f1ee Merge remote-tracking branch 'remotes/upstream/resizedImages' into beta --- diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index c45f76cf..dc96b9f2 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -71,6 +71,7 @@ public class PreviewImageFragment extends FileFragment { private static final String ARG_FILE = "FILE"; private static final String ARG_IGNORE_FIRST = "IGNORE_FIRST"; + private static final String ARG_SHOW_RESIZED_IMAGE = "SHOW_RESIZED_IMAGE"; private TouchImageViewCustom mImageView; private TextView mMessageView; @@ -108,6 +109,7 @@ public class PreviewImageFragment extends FileFragment { Bundle args = new Bundle(); args.putParcelable(ARG_FILE, imageFile); args.putBoolean(ARG_IGNORE_FIRST, ignoreFirstSavedState); + args.putBoolean(ARG_SHOW_RESIZED_IMAGE, showResizedImage); frag.setArguments(args); return frag; } @@ -140,6 +142,7 @@ public class PreviewImageFragment extends FileFragment { // not right now mIgnoreFirstSavedState = args.getBoolean(ARG_IGNORE_FIRST); + mShowResizedImage = args.getBoolean(ARG_SHOW_RESIZED_IMAGE); setHasOptionsMenu(true); } @@ -215,8 +218,9 @@ public class PreviewImageFragment extends FileFragment { mImageView.setVisibility(View.VISIBLE); mBitmap = thumbnail; } else { - // generate new Thumbnail - if (ThumbnailsCacheManager.cancelPotentialWork(getFile(), mImageView)) { + // generate new Thumbnail + if (ThumbnailsCacheManager.cancelPotentialWork(getFile(), mImageView) && + mContainerActivity.getStorageManager() != null) { final ThumbnailsCacheManager.ThumbnailGenerationTask task = new ThumbnailsCacheManager.ThumbnailGenerationTask( mImageView, mContainerActivity.getStorageManager(),