aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-09-01 00:15:56 (GMT)
committerJorge Ruesga <jorge@ruesga.com>2014-09-01 00:15:56 (GMT)
commitfafd2e1e2cb8f3839740ac42e657875b036806e3 (patch)
tree424130ba1a91d212c59cac4bf09bfd71cf700ce5
parenta523e7f3384fbab9cc398e2fd398bda8fc13663b (diff)
downloadandroid_packages_wallpapers_PhotoPhase-fafd2e1e2cb8f3839740ac42e657875b036806e3.zip
android_packages_wallpapers_PhotoPhase-fafd2e1e2cb8f3839740ac42e657875b036806e3.tar.gz
android_packages_wallpapers_PhotoPhase-fafd2e1e2cb8f3839740ac42e657875b036806e3.tar.bz2
photophase: allow to choose more than one minute for transition timers
JIRA: CYAN-4836 https://jira.cyanogenmod.org/browse/CYAN-4836 Signed-off-by: Jorge Ruesga <jorge@ruesga.com> Change-Id: I754e9ee71b196ce6d996542b07c238813124241b
-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);