aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2013-08-07 00:40:29 +0200
committerJorge Ruesga <jorge@ruesga.com>2013-08-07 00:40:29 +0200
commit3c46e3e43e86bfd00c503caf8a31529f8f1ce18c (patch)
treeb96b75bbcd346021e85ba5822620b4e3e795a43e /src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java
parente3e640aa2e7b1357903663705bfdce8e8f95dc43 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-3c46e3e43e86bfd00c503caf8a31529f8f1ce18c.tar.gz
android_packages_wallpapers_PhotoPhase-3c46e3e43e86bfd00c503caf8a31529f8f1ce18c.tar.bz2
android_packages_wallpapers_PhotoPhase-3c46e3e43e86bfd00c503caf8a31529f8f1ce18c.zip
Multiple transition selection (#13)
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java')
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java b/src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java
index ab18a48..78d3686 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/preferences/PreferencesProvider.java
@@ -217,10 +217,21 @@ public final class PreferencesProvider {
* Return the current user preference about the transition to apply to
* the pictures of the wallpaper.
*
- * @return int The transition to apply to the wallpaper's pictures
+ * @return TRANSITIONS[] The transition to apply to the wallpaper's pictures
*/
- public static int getTransitionTypes() {
- return Integer.valueOf(getString("ui_transition_types", String.valueOf(TRANSITIONS.RANDOM.ordinal())));
+ public static TRANSITIONS[] getTransitionTypes() {
+ Set<String> set = getStringSet("ui_transition_types", new HashSet<String>());
+ if (set.isEmpty()) {
+ // Return all the transitions if no one is selected
+ return TRANSITIONS.getValidTranstions();
+ }
+ String[] values = set.toArray(new String[set.size()]);
+ int count = values.length;
+ TRANSITIONS[] transitions = new TRANSITIONS[count];
+ for (int i = 0; i < count; i++) {
+ transitions[i] = TRANSITIONS.fromOrdinal(Integer.valueOf(values[i]));
+ }
+ return transitions;
}
/**