OSDN Git Service

Eleven: rebrand step 2: update file contents
[android-x86/packages-apps-Eleven.git] / src / org / lineageos / eleven / Config.java
1 /*
2  * Copyright (C) 2012 Andrew Neal
3  * Copyright (C) 2014 The CyanogenMod Project
4  * Licensed under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8  * or agreed to in writing, software distributed under the License is
9  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10  * KIND, either express or implied. See the License for the specific language
11  * governing permissions and limitations under the License.
12  */
13
14 package org.lineageos.eleven;
15
16 /**
17  * App-wide constants.
18  *
19  * @author Andrew Neal (andrewdneal@gmail.com)
20  */
21 public final class Config {
22
23     /* This class is never initiated. */
24     public Config() {
25     }
26
27     /**
28      * My personal Last.fm API key, please use your own.
29      */
30     public static final String LASTFM_API_KEY = "0bec3f7ec1f914d7c960c12a916c8fb3";
31
32     /**
33      * Used to distinguish album art from artist images
34      */
35     public static final String ALBUM_ART_SUFFIX = "album";
36
37     /**
38      * The ID of an artist, album, genre, or playlist passed to the profile
39      * activity
40      */
41     public static final String ID = "id";
42
43     /**
44      * The name of an artist, album, genre, or playlist passed to the profile
45      * activity
46      */
47     public static final String NAME = "name";
48
49     /**
50      * The name of an artist passed to the profile activity
51      */
52     public static final String ARTIST_NAME = "artist_name";
53
54     /**
55      * The year an album was released passed to the profile activity
56      */
57     public static final String ALBUM_YEAR = "album_year";
58
59     /** number of songs in a album or track list */
60     public static final String SONG_COUNT = "song_count";
61
62     /**
63      * The MIME type passed to a the profile activity
64      */
65     public static final String MIME_TYPE = "mime_type";
66
67     /**
68      * Play from search intent
69      */
70     public static final String PLAY_FROM_SEARCH = "android.media.action.MEDIA_PLAY_FROM_SEARCH";
71
72     /**
73      * The smart playlist type
74      */
75     public static final String SMART_PLAYLIST_TYPE = "smart_playlist_type";
76
77     /**
78      * Number of search results to show at the top level search
79      */
80     public static final int SEARCH_NUM_RESULTS_TO_GET = 3;
81
82     public static enum SmartPlaylistType {
83         LastAdded(-1, R.string.playlist_last_added),
84         RecentlyPlayed(-2, R.string.playlist_recently_played),
85         TopTracks(-3, R.string.playlist_top_tracks);
86
87         public long mId;
88         public int mTitleId;
89
90         SmartPlaylistType(long id, int titleId) {
91             mId = id;
92             mTitleId = titleId;
93         }
94
95         public static SmartPlaylistType getTypeById(long id) {
96             for (SmartPlaylistType type : SmartPlaylistType.values()) {
97                 if (type.mId == id) {
98                     return type;
99                 }
100             }
101
102             return null;
103         }
104     }
105
106     /**
107      * This helps identify where an id has come from.  Mainly used to determine when a user
108      * clicks a song where that song came from (artist/album/playlist)
109      */
110     public static enum IdType {
111         NA(0),
112         Artist(1),
113         Album(2),
114         Playlist(3);
115
116         public final int mId;
117
118         IdType(final int id) {
119             mId = id;
120         }
121
122         public static IdType getTypeById(int id) {
123             for (IdType type : values()) {
124                 if (type.mId == id) {
125                     return type;
126                 }
127             }
128
129             throw new IllegalArgumentException("Unrecognized id: " + id);
130         }
131     }
132 }