diff options
| author | George Mount <mount@google.com> | 2012-10-07 14:10:33 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-07 14:10:33 -0700 |
| commit | c73511f95746650e6aaadfb7a34e61083e08db56 (patch) | |
| tree | b361ff5b2bf40681b3df17bc1c2c68141bee4e08 | |
| parent | 984c37d0bb96c3f6e1aa8d3dbcdc9cd0e24b7262 (diff) | |
| parent | f5017c407c969da88017a697aae7462b552e65ee (diff) | |
| download | android_packages_apps_Gallery2-c73511f95746650e6aaadfb7a34e61083e08db56.tar.gz android_packages_apps_Gallery2-c73511f95746650e6aaadfb7a34e61083e08db56.tar.bz2 android_packages_apps_Gallery2-c73511f95746650e6aaadfb7a34e61083e08db56.zip | |
am f5017c40: Merge "Show stitched panorama in secure album." into gb-ub-photos-arches
* commit 'f5017c407c969da88017a697aae7462b552e65ee':
Show stitched panorama in secure album.
| -rw-r--r-- | src/com/android/gallery3d/app/StitchingChangeListener.java | 7 | ||||
| -rw-r--r-- | src/com/android/gallery3d/data/SecureAlbum.java | 22 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/app/StitchingChangeListener.java b/src/com/android/gallery3d/app/StitchingChangeListener.java index 901f37967..980f1450a 100644 --- a/src/com/android/gallery3d/app/StitchingChangeListener.java +++ b/src/com/android/gallery3d/app/StitchingChangeListener.java @@ -16,11 +16,12 @@ package com.android.gallery3d.app; +import android.net.Uri; public interface StitchingChangeListener { - public void onFileAdded(String filePath); + public void onStitchingQueued(String filePath); - public void onFileRemoved(String filePath); + public void onStitchingResult(String filePath, Uri uri); - public void onProgressChanged(String filePath, int progress); + public void onStitchingProgress(String filePath, int progress); } diff --git a/src/com/android/gallery3d/data/SecureAlbum.java b/src/com/android/gallery3d/data/SecureAlbum.java index b841df7e3..382de5bb2 100644 --- a/src/com/android/gallery3d/data/SecureAlbum.java +++ b/src/com/android/gallery3d/data/SecureAlbum.java @@ -24,12 +24,13 @@ import android.provider.MediaStore.Images; import android.provider.MediaStore.Video; import com.android.gallery3d.app.GalleryApp; +import com.android.gallery3d.app.StitchingChangeListener; import com.android.gallery3d.util.MediaSetUtils; import java.util.ArrayList; // This class lists all media items added by the client. -public class SecureAlbum extends MediaSet { +public class SecureAlbum extends MediaSet implements StitchingChangeListener { @SuppressWarnings("unused") private static final String TAG = "SecureAlbum"; private static final String[] PROJECTION = {MediaColumns._ID}; @@ -42,6 +43,7 @@ public class SecureAlbum extends MediaSet { // The types of items in mAllItems. True is video and false is image. private ArrayList<Boolean> mAllItemTypes = new ArrayList<Boolean>(); private ArrayList<Path> mExistingItems = new ArrayList<Path>(); + private ArrayList<String> mStitchingFilePaths = new ArrayList<String>(); private Context mContext; private DataManager mDataManager; private static final Uri[] mWatchUris = @@ -60,6 +62,7 @@ public class SecureAlbum extends MediaSet { mUnlockItem = unlock; mShowUnlockItem = (!isCameraBucketEmpty(Images.Media.EXTERNAL_CONTENT_URI) || !isCameraBucketEmpty(Video.Media.EXTERNAL_CONTENT_URI)); + application.getStitchingProgressManager().addChangeListener(this); } public void addMediaItem(boolean isVideo, int id) { @@ -178,4 +181,21 @@ public class SecureAlbum extends MediaSet { public boolean isLeafAlbum() { return true; } + + @Override + public void onStitchingQueued(String filePath) { + mStitchingFilePaths.add(filePath); + } + + @Override + public void onStitchingResult(String filePath, Uri uri) { + if (mStitchingFilePaths.remove(filePath)) { + int id = Integer.parseInt(uri.getLastPathSegment()); + addMediaItem(false, id); + } + } + + @Override + public void onStitchingProgress(String filePath, int progress) { + } } |
