summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/SecureAlbum.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-10-07 21:43:12 +0800
committerWu-cheng Li <wuchengli@google.com>2012-10-07 23:25:06 +0800
commit2c848b26619de242a96ba4b20c252416a39506d6 (patch)
treef64e7029a7abdde8f47564d4d048766d0cdb2355 /src/com/android/gallery3d/data/SecureAlbum.java
parent3711d3ea870acba8ad83d0c51b0d03b0082ef0f0 (diff)
downloadandroid_packages_apps_Gallery2-2c848b26619de242a96ba4b20c252416a39506d6.tar.gz
android_packages_apps_Gallery2-2c848b26619de242a96ba4b20c252416a39506d6.tar.bz2
android_packages_apps_Gallery2-2c848b26619de242a96ba4b20c252416a39506d6.zip
Show stitched panorama in secure album.
bug:7285105 Change-Id: I36801d4e5b19cceb10600d41a3a3c78244c5ee4a
Diffstat (limited to 'src/com/android/gallery3d/data/SecureAlbum.java')
-rw-r--r--src/com/android/gallery3d/data/SecureAlbum.java22
1 files changed, 21 insertions, 1 deletions
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) {
+ }
}