diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-10-02 13:30:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-02 14:25:05 -0700 |
commit | 45f089d69141e3fb0dfaad9bc34d275b61eb2aee (patch) | |
tree | 8f2fafbdabd5391e8966d98c4829adcf470180f9 /src/com/android/gallery3d/data/FilterSource.java | |
parent | 51915a622bbd32e90f0cd43b69a7851e13825737 (diff) | |
download | android_packages_apps_Gallery2-45f089d69141e3fb0dfaad9bc34d275b61eb2aee.tar.gz android_packages_apps_Gallery2-45f089d69141e3fb0dfaad9bc34d275b61eb2aee.tar.bz2 android_packages_apps_Gallery2-45f089d69141e3fb0dfaad9bc34d275b61eb2aee.zip |
Show Camera placeholder as first filmstrip item in roll
Bug: 7272674
The camera roll filmstrip view now shows a shortcut to
launch the camera when opened from the Gallery app.
Note: the edits to SnailAlbum and SnailSource were made to
allow sharing code between SingleItemAlbum and SnailAlbum
Change-Id: I1bd2f3db99138c4b79a41c9c5baee46704cd18e0
Diffstat (limited to 'src/com/android/gallery3d/data/FilterSource.java')
-rw-r--r-- | src/com/android/gallery3d/data/FilterSource.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/data/FilterSource.java b/src/com/android/gallery3d/data/FilterSource.java index 3244da34f..d689fe336 100644 --- a/src/com/android/gallery3d/data/FilterSource.java +++ b/src/com/android/gallery3d/data/FilterSource.java @@ -18,19 +18,24 @@ package com.android.gallery3d.data; import com.android.gallery3d.app.GalleryApp; -class FilterSource extends MediaSource { +public class FilterSource extends MediaSource { @SuppressWarnings("unused") private static final String TAG = "FilterSource"; private static final int FILTER_BY_MEDIATYPE = 0; private static final int FILTER_BY_DELETE = 1; private static final int FILTER_BY_EMPTY = 2; private static final int FILTER_BY_EMPTY_ITEM = 3; + private static final int FILTER_BY_CAMERA_SHORTCUT = 4; + private static final int FILTER_BY_CAMERA_SHORTCUT_ITEM = 5; public static final String FILTER_EMPTY_ITEM = "/filter/empty_prompt"; + public static final String FILTER_CAMERA_SHORTCUT = "/filter/camera_shortcut"; + private static final String FILTER_CAMERA_SHORTCUT_ITEM = "/filter/camera_shortcut_item"; private GalleryApp mApplication; private PathMatcher mMatcher; private MediaItem mEmptyItem; + private MediaItem mCameraShortcutItem; public FilterSource(GalleryApp application) { super("filter"); @@ -39,10 +44,14 @@ class FilterSource extends MediaSource { mMatcher.add("/filter/mediatype/*/*", FILTER_BY_MEDIATYPE); mMatcher.add("/filter/delete/*", FILTER_BY_DELETE); mMatcher.add("/filter/empty/*", FILTER_BY_EMPTY); - mMatcher.add("/filter/empty_item", FILTER_BY_EMPTY_ITEM); + mMatcher.add(FILTER_EMPTY_ITEM, FILTER_BY_EMPTY_ITEM); + mMatcher.add(FILTER_CAMERA_SHORTCUT, FILTER_BY_CAMERA_SHORTCUT); + mMatcher.add(FILTER_CAMERA_SHORTCUT_ITEM, FILTER_BY_CAMERA_SHORTCUT_ITEM); mEmptyItem = new EmptyAlbumImage(Path.fromString(FILTER_EMPTY_ITEM), mApplication); + mCameraShortcutItem = new CameraShortcutImage( + Path.fromString(FILTER_CAMERA_SHORTCUT_ITEM), mApplication); } // The name we accept are: @@ -72,6 +81,12 @@ class FilterSource extends MediaSource { case FILTER_BY_EMPTY_ITEM: { return mEmptyItem; } + case FILTER_BY_CAMERA_SHORTCUT: { + return new SingleItemAlbum(path, mCameraShortcutItem); + } + case FILTER_BY_CAMERA_SHORTCUT_ITEM: { + return mCameraShortcutItem; + } default: throw new RuntimeException("bad path: " + path); } |