1 /***
2 * Ambient - A music player for the Android platform
3 Copyright (C) 2007 Martin Vysny
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 package sk.baka.ambient.activity.main;
19
20 import java.util.Arrays;
21 import java.util.List;
22
23 import sk.baka.ambient.ActionsEnum;
24 import sk.baka.ambient.R;
25 import sk.baka.ambient.activity.main.cb.AbstractCollectionController;
26 import sk.baka.ambient.collection.local.MediaStoreCollection;
27 import sk.baka.ambient.views.gesturelist.GesturesListView;
28
29 /***
30 * Controls the collection view.
31 *
32 * @author Martin Vysny
33 */
34 public final class CollectionController extends AbstractCollectionController {
35
36 /***
37 * Creates new controller instance.
38 *
39 * @param parent
40 * the parent activity
41 * @param playlistView
42 * the playlist view.
43 */
44 public CollectionController(final MainActivity parent,
45 final GesturesListView playlistView) {
46 super(R.id.collectionWindow, R.id.collectionView, parent, playlistView,
47 new MediaStoreCollection(parent.getContentResolver()),
48 R.id.collectionPath);
49 initButtonBar(R.id.collectionButtons, actions);
50 updateData();
51 }
52
53 private final List<ActionsEnum> actions = Arrays.asList(ActionsEnum.Back,
54 ActionsEnum.ShowStatistics, ActionsEnum.CollectionYear);
55
56 @Override
57 protected void performZoom(boolean zoom) {
58 super.performZoom(zoom);
59 initButtonBar(R.id.collectionButtons, actions);
60 }
61 }