diff options
author | Bobby Georgescu <georgescu@google.com> | 2012-09-27 16:36:03 -0700 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2012-09-28 00:37:11 -0700 |
commit | c7e3c76d6965f520a9651d309052c5f01726cd58 (patch) | |
tree | a02b5f79cd578ead91f5c17f47d3e4b633740521 /src/com/android/gallery3d/data/FilterSource.java | |
parent | 2e8472f304737acc3fbeb167b1b6f660f111f5c7 (diff) | |
download | android_packages_apps_Gallery2-c7e3c76d6965f520a9651d309052c5f01726cd58.tar.gz android_packages_apps_Gallery2-c7e3c76d6965f520a9651d309052c5f01726cd58.tar.bz2 android_packages_apps_Gallery2-c7e3c76d6965f520a9651d309052c5f01726cd58.zip |
Show a placeholder when the camera filmstrip is empty
Bug: 7213757
Tapping the placeholder takes the user back to the
full-screen camera capture mode.
Change-Id: I844f789b8e80f34e79f4a9c366c1c244bbf1f2a5
Diffstat (limited to 'src/com/android/gallery3d/data/FilterSource.java')
-rw-r--r-- | src/com/android/gallery3d/data/FilterSource.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/FilterSource.java b/src/com/android/gallery3d/data/FilterSource.java index e3f350f76..3244da34f 100644 --- a/src/com/android/gallery3d/data/FilterSource.java +++ b/src/com/android/gallery3d/data/FilterSource.java @@ -23,9 +23,14 @@ class FilterSource extends MediaSource { 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; + + public static final String FILTER_EMPTY_ITEM = "/filter/empty_prompt"; private GalleryApp mApplication; private PathMatcher mMatcher; + private MediaItem mEmptyItem; public FilterSource(GalleryApp application) { super("filter"); @@ -33,6 +38,11 @@ class FilterSource extends MediaSource { mMatcher = new PathMatcher(); 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); + + mEmptyItem = new EmptyAlbumImage(Path.fromString(FILTER_EMPTY_ITEM), + mApplication); } // The name we accept are: @@ -54,6 +64,14 @@ class FilterSource extends MediaSource { MediaSet[] sets = dataManager.getMediaSetsFromString(setsName); return new FilterDeleteSet(path, sets[0]); } + case FILTER_BY_EMPTY: { + String setsName = mMatcher.getVar(0); + MediaSet[] sets = dataManager.getMediaSetsFromString(setsName); + return new FilterEmptyPromptSet(path, sets[0], mEmptyItem); + } + case FILTER_BY_EMPTY_ITEM: { + return mEmptyItem; + } default: throw new RuntimeException("bad path: " + path); } |