diff options
author | Owen Lin <owenlin@google.com> | 2009-06-04 14:04:30 -0700 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2009-06-04 14:47:22 -0700 |
commit | 7c2eb95660f25619742bf73b51d0c75ac37fe4e9 (patch) | |
tree | 739f127d2cfafe87487412302d3f3bc5eb779322 /src/com/android/camera/ViewImage.java | |
parent | e2950602fffe90b69552b1d270673a839e560513 (diff) | |
download | LegacyCamera-7c2eb95660f25619742bf73b51d0c75ac37fe4e9.zip LegacyCamera-7c2eb95660f25619742bf73b51d0c75ac37fe4e9.tar.gz LegacyCamera-7c2eb95660f25619742bf73b51d0c75ac37fe4e9.tar.bz2 |
Fix bug 1897802 in two parts.
1. Override the getImageIndex in SingleImageList (This is a potential bug)
2. Fallback to the original code if no ImageList is pass over the intent
Diffstat (limited to 'src/com/android/camera/ViewImage.java')
-rw-r--r-- | src/com/android/camera/ViewImage.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/camera/ViewImage.java b/src/com/android/camera/ViewImage.java index c01d3f1..8416055 100644 --- a/src/com/android/camera/ViewImage.java +++ b/src/com/android/camera/ViewImage.java @@ -880,9 +880,20 @@ public class ViewImage extends Activity implements View.OnClickListener { mGetter = new ImageGetter(this); } + private IImageList buildImageListFromUri(Uri uri) { + String sortOrder = mPrefs.getString( + "pref_gallery_sort_key", "descending"); + int sort = (mCameraReviewMode || sortOrder.equals("ascending")) + ? ImageManager.SORT_ASCENDING + : ImageManager.SORT_DESCENDING; + return ImageManager.makeImageList(uri, getContentResolver(), sort); + } + private boolean init(Uri uri, IImageList imageList) { if (uri == null) return false; - mAllImages = imageList == null ? new SingleImageList(uri) : imageList; + mAllImages = (imageList == null) + ? buildImageListFromUri(uri) + : imageList; mAllImages.open(getContentResolver()); IImage image = mAllImages.getImageForUri(uri); if (image == null) return false; |