diff options
| author | Yuli Huang <yuli@google.com> | 2012-02-07 15:51:24 +0800 |
|---|---|---|
| committer | Yuli Huang <yuli@google.com> | 2012-02-07 15:57:58 +0800 |
| commit | a7b78e224b1808895ea2c3d42ae385526dea12aa (patch) | |
| tree | c6f7e50bf90fb3c32845176cbc3587a6100048de /src | |
| parent | e69eba096c3c88e944471499ca7bb47cf77d3e3c (diff) | |
| download | android_packages_apps_Gallery2-a7b78e224b1808895ea2c3d42ae385526dea12aa.tar.gz android_packages_apps_Gallery2-a7b78e224b1808895ea2c3d42ae385526dea12aa.tar.bz2 android_packages_apps_Gallery2-a7b78e224b1808895ea2c3d42ae385526dea12aa.zip | |
Fix b/5840847: Always show 'Loading...' for corrupt pictures.
Change-Id: I040f6e4090dad3e73b86062ddefd9bb0be581bf5
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/app/PhotoDataAdapter.java | 17 | ||||
| -rw-r--r-- | src/com/android/gallery3d/ui/PhotoView.java | 4 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index 9b1c8c4c0..0d11ee65f 100644 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -228,15 +228,14 @@ public class PhotoDataAdapter implements PhotoPage.Model { if (entry.screenNail == null) { entry.failToLoad = true; - } else { - if (mDataListener != null) { - mDataListener.onPhotoAvailable(version, false); - } - for (int i = -1; i <=1; ++i) { - if (version == getVersion(mCurrentIndex + i)) { - if (i == 0) updateTileProvider(entry); - mPhotoView.notifyImageInvalidated(i); - } + } + if (mDataListener != null) { + mDataListener.onPhotoAvailable(version, false); + } + for (int i = -1; i <= 1; ++i) { + if (version == getVersion(mCurrentIndex + i)) { + if (i == 0) updateTileProvider(entry); + mPhotoView.notifyImageInvalidated(i); } } updateImageRequests(); diff --git a/src/com/android/gallery3d/ui/PhotoView.java b/src/com/android/gallery3d/ui/PhotoView.java index 5062c0e8e..b4349c655 100644 --- a/src/com/android/gallery3d/ui/PhotoView.java +++ b/src/com/android/gallery3d/ui/PhotoView.java @@ -18,7 +18,6 @@ package com.android.gallery3d.ui; import com.android.gallery3d.R; import com.android.gallery3d.app.GalleryActivity; -import com.android.gallery3d.common.Utils; import com.android.gallery3d.data.Path; import com.android.gallery3d.ui.PositionRepository.Position; @@ -27,7 +26,6 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.RectF; import android.os.Message; -import android.os.SystemClock; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.ScaleGestureDetector; @@ -244,6 +242,8 @@ public class PhotoView extends GLView { } else if (mModel.isFailedToLoad()) { mHandler.removeMessages(MSG_SHOW_LOADING); mLoadingState = LOADING_FAIL; + // We don't want the opening animation after loading failure + mOpenedItemPath = null; } else if (mLoadingState != LOADING_INIT) { mLoadingState = LOADING_INIT; mHandler.removeMessages(MSG_SHOW_LOADING); |
