summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/preferences
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-07-26 13:53:03 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-07-26 13:53:03 +0200
commitdf288f8f68145e9e38a639b86859db8d484bda00 (patch)
treea2477827c6ab93ddf5abf9a85c203318e448cb91 /src/de/danoeh/antennapod/preferences
parent421786e5c81f31d86c34f6c79a3c73a53c8207c3 (diff)
downloadAntennaPod-df288f8f68145e9e38a639b86859db8d484bda00.zip
Fixed auto-flattr when playback ends
Diffstat (limited to 'src/de/danoeh/antennapod/preferences')
-rw-r--r--src/de/danoeh/antennapod/preferences/UserPreferences.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/preferences/UserPreferences.java b/src/de/danoeh/antennapod/preferences/UserPreferences.java
index e7a93daeb..2020ddfae 100644
--- a/src/de/danoeh/antennapod/preferences/UserPreferences.java
+++ b/src/de/danoeh/antennapod/preferences/UserPreferences.java
@@ -408,8 +408,17 @@ public class UserPreferences implements
instance.updateInterval = newValue;
}
+ /**
+ * Change the auto-flattr settings
+ *
+ * @param context For accessing the shared preferences
+ * @param enabled Whether automatic flattring should be enabled at all
+ * @param autoFlattrThreshold The percentage of playback time after which an episode should be
+ * flattrd. Must be a value between 0 and 1 (inclusive)
+ * */
public static void setAutoFlattrSettings(Context context, boolean enabled, float autoFlattrThreshold) {
instanceAvailable();
+ Validate.inclusiveBetween(0.0, 1.0, autoFlattrThreshold);
PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext())
.edit()
.putBoolean(PREF_AUTO_FLATTR, enabled)