diff options
author | Paul Westbrook <pwestbro@google.com> | 2012-10-13 20:57:56 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-13 20:57:56 -0700 |
commit | e209312c5f2784bf746c24e7708b76b9f2e69b7f (patch) | |
tree | a2972e7fb778f9aeb032ec27c41a42db9524c66a | |
parent | 777cea29262e48549295c3c028098edc1f90eeeb (diff) | |
parent | 14a4df6f91f3563ab956ed1730bdbf4e6976e5cd (diff) | |
download | android_frameworks_ex-e209312c5f2784bf746c24e7708b76b9f2e69b7f.tar.gz android_frameworks_ex-e209312c5f2784bf746c24e7708b76b9f2e69b7f.tar.bz2 android_frameworks_ex-e209312c5f2784bf746c24e7708b76b9f2e69b7f.zip |
am 14a4df6f: Load preview first
* commit '14a4df6f91f3563ab956ed1730bdbf4e6976e5cd':
Load preview first
-rw-r--r-- | photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java b/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java index 8e47737..2e99bd8 100644 --- a/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java +++ b/photoviewer/src/com/android/ex/photo/fragments/PhotoViewFragment.java @@ -209,7 +209,7 @@ public class PhotoViewFragment extends Fragment implements mCallback.addScreenListener(this); mCallback.addCursorListener(this); - getLoaderManager().initLoader(LOADER_ID_PHOTO, null, this); + getLoaderManager().initLoader(LOADER_ID_THUMBNAIL, null, this); super.onResume(); } @@ -269,10 +269,6 @@ public class PhotoViewFragment extends Fragment implements bindPhoto(data); mPhotoPreviewAndProgress.setVisibility(View.GONE); mProgressBarNeeded = false; - } else { - // Received a null result for the full size image. Instead attempt to load the - // thumbnail - getLoaderManager().initLoader(LOADER_ID_THUMBNAIL, null, this); } break; case LOADER_ID_THUMBNAIL: @@ -282,18 +278,20 @@ public class PhotoViewFragment extends Fragment implements mPhotoPreviewAndProgress.setVisibility(View.GONE); mProgressBarNeeded = false; return; - } else if (data == null) { - // no preview, show default - mPhotoPreviewImage.setVisibility(View.VISIBLE); - mPhotoPreviewImage.setImageResource(R.drawable.default_image); - mPhotoPreviewImage.setScaleType(ImageView.ScaleType.CENTER); - - mProgressBarNeeded = false; } else { + // Make the preview image view visible mPhotoPreviewImage.setVisibility(View.VISIBLE); - mPhotoPreviewImage.setImageBitmap(data); - mProgressBarNeeded = false; + if (data == null) { + // no preview, show default + mPhotoPreviewImage.setImageResource(R.drawable.default_image); + mPhotoPreviewImage.setScaleType(ImageView.ScaleType.CENTER); + } else { + // Show the preview + mPhotoPreviewImage.setImageBitmap(data); + } + // Now load the full size image + getLoaderManager().initLoader(LOADER_ID_PHOTO, null, this); } break; default: |