aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-09-01 20:02:54 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-09-01 20:02:54 (GMT)
commitcd21e27153c81952b8499447875db8c73a63a536 (patch)
treea82547ec62b877eff65f076d1b5aaf2c74062ae8
parent83a0f2a89ebb8f37d71251d38e013b9f680b90ca (diff)
parentfafd2e1e2cb8f3839740ac42e657875b036806e3 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-cd21e27153c81952b8499447875db8c73a63a536.zip
android_packages_wallpapers_PhotoPhase-cd21e27153c81952b8499447875db8c73a63a536.tar.gz
android_packages_wallpapers_PhotoPhase-cd21e27153c81952b8499447875db8c73a63a536.tar.bz2
Merge "photophase: allow to choose more than one minute for transition timers" into cm-11.0
-rw-r--r--res/values/arrays.xml7
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/preferences/GeneralPreferenceFragment.java16
2 files changed, 20 insertions, 3 deletions
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index df43a31..9ab1b17 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -86,6 +86,13 @@
<item>15000</item>
<item>30000</item>
<item>60000</item>
+ <item>120000</item>
+ <item>240000</item>
+ <item>300000</item>
+ <item>600000</item>
+ <item>1800000</item>
+ <item>3600000</item>
+ <item>86400000</item>
</integer-array>
<string-array name="effects_labels" translatable="false">
diff --git a/src/org/cyanogenmod/wallpapers/photophase/preferences/GeneralPreferenceFragment.java b/src/org/cyanogenmod/wallpapers/photophase/preferences/GeneralPreferenceFragment.java
index e559ba7..71f3190 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/preferences/GeneralPreferenceFragment.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/preferences/GeneralPreferenceFragment.java
@@ -120,6 +120,8 @@ public class GeneralPreferenceFragment extends PreferenceFragment {
final String formatDisabled = getString(R.string.format_disabled);
final String formatSeconds = getString(R.string.format_seconds);
final String formatMinutes = getString(R.string.format_minutes);
+ final String formatHours = getString(R.string.format_hours);
+ final String formatDays = getString(R.string.format_days);
final String formatDim = getString(R.string.format_dim);
// Change the preference manager
@@ -174,10 +176,18 @@ public class GeneralPreferenceFragment extends PreferenceFragment {
// Seconds
mTransitionsInterval.setFormat(formatSeconds);
return String.valueOf(interval / 1000);
+ } else if (interval < 3600000) {
+ // Minutes
+ mTransitionsInterval.setFormat(formatMinutes);
+ return String.valueOf(interval / 1000 / 60);
+ } else if (interval < 86400000) {
+ // Hours
+ mTransitionsInterval.setFormat(formatHours);
+ return String.valueOf(interval / 1000 / 60 / 60);
}
- // Minutes
- mTransitionsInterval.setFormat(formatMinutes);
- return String.valueOf(interval / 1000 / 60);
+ // Days
+ mTransitionsInterval.setFormat(formatDays);
+ return String.valueOf(interval / 1000 / 60 / 60 / 24);
}
});
mTransitionsInterval.setOnPreferenceChangeListener(mOnChangeListener);