2 * Copyright (C) 2012 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.gallery3d.data;
19 import java.util.ArrayList;
21 public class FilterEmptyPromptSet extends MediaSet implements ContentListener {
22 @SuppressWarnings("unused")
23 private static final String TAG = "FilterEmptyPromptSet";
25 private ArrayList<MediaItem> mEmptyItem;
26 private MediaSet mBaseSet;
28 public FilterEmptyPromptSet(Path path, MediaSet baseSet, MediaItem emptyItem) {
29 super(path, INVALID_DATA_VERSION);
30 mEmptyItem = new ArrayList<MediaItem>(1);
31 mEmptyItem.add(emptyItem);
33 mBaseSet.addContentListener(this);
37 public int getMediaItemCount() {
38 int itemCount = mBaseSet.getMediaItemCount();
47 public ArrayList<MediaItem> getMediaItem(int start, int count) {
48 int itemCount = mBaseSet.getMediaItemCount();
50 return mBaseSet.getMediaItem(start, count);
51 } else if (start == 0 && count == 1) {
54 throw new ArrayIndexOutOfBoundsException();
59 public void onContentDirty() {
60 notifyContentChanged();
64 public boolean isLeafAlbum() {
69 public boolean isCameraRoll() {
70 return mBaseSet.isCameraRoll();
74 public long reload() {
75 return mBaseSet.reload();
79 public String getName() {
80 return mBaseSet.getName();