From 672c38e20ae5c72ab3527343eb75bbc6a61ec2f2 Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Sat, 31 Jan 2015 23:30:01 -0600 Subject: [PATCH 1/6] added preference, need to work into database --- .../antennapod/preferences/PreferenceController.java | 2 +- app/src/main/res/xml/preferences.xml | 12 ++++++++++++ .../de/danoeh/antennapod/core/storage/DBWriter.java | 8 +++++++- core/src/main/res/values/strings.xml | 2 ++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 41930a7f2..ba934b35b 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -58,9 +58,9 @@ public class PreferenceController { public static final String PREF_GPODNET_LOGOUT = "pref_gpodnet_logout"; public static final String PREF_GPODNET_HOSTNAME = "pref_gpodnet_hostname"; public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; + public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; - private final PreferenceUI ui; private CheckBoxPreference[] selectedNetworks; diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 5175acdcb..88feccc4d 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -93,6 +93,18 @@ + + + + + /> + + Persistent playback controls Keep notification and lockscreen controls when playback is paused. Android versions before 4.1 do not support expanded notifications. + Add new episodes to the front of the queue. + Enqueue at front. Enable automatic flattring From 509b2a7f58390a740088fbc7904302ee99af9a42 Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Sun, 1 Feb 2015 00:29:46 -0600 Subject: [PATCH 2/6] queue to front or back --- .../preferences/PreferenceController.java | 2 -- app/src/main/res/xml/preferences.xml | 24 +++++++++---------- .../antennapod/core/storage/DBWriter.java | 6 ++++- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index ba934b35b..edaba5df3 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -58,8 +58,6 @@ public class PreferenceController { public static final String PREF_GPODNET_LOGOUT = "pref_gpodnet_logout"; public static final String PREF_GPODNET_HOSTNAME = "pref_gpodnet_hostname"; public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; - public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; - private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; private final PreferenceUI ui; diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 88feccc4d..8675e07d7 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -22,11 +22,22 @@ android:summary="@string/pref_persistNotify_sum" android:title="@string/pref_persistNotify_title"/> + + + + /> + + - - - - /> - - Date: Sun, 8 Feb 2015 11:34:21 -0600 Subject: [PATCH 3/6] t was missing --- app/src/main/res/xml/preferences.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 8675e07d7..dd2de8faf 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -37,7 +37,7 @@ Date: Sun, 8 Feb 2015 11:48:55 -0600 Subject: [PATCH 4/6] move preferences to Player preferences --- .../antennapod/core/preferences/PlaybackPreferences.java | 3 +++ .../main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java index d88543f73..81b6be6ac 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java @@ -43,6 +43,9 @@ public class PlaybackPreferences implements /** True if last played media was a video. */ public static final String PREF_CURRENT_EPISODE_IS_VIDEO = "de.danoeh.antennapod.preferences.lastIsVideo"; + /** Value of PREF_QUEUE_ADD_TO_FRONT if no media is playing. */ + public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; + /** Value of PREF_CURRENTLY_PLAYING_MEDIA if no media is playing. */ public static final long NO_MEDIA_PLAYING = -1; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 0ece66b08..0de04d64e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -43,7 +43,6 @@ import java.util.concurrent.ThreadFactory; */ public class DBWriter { private static final String TAG = "DBWriter"; - private static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; private static final ExecutorService dbExec; @@ -380,7 +379,7 @@ public class DBWriter { if (item != null) { // add item to either front ot back of queue boolean addToFront = PreferenceManager.getDefaultSharedPreferences(context) - .getBoolean(PREF_QUEUE_ADD_TO_FRONT, false); + .getBoolean(PlaybackPreferences.PREF_QUEUE_ADD_TO_FRONT, false); if(addToFront){ queue.add(0, item); From 7c76d2c57b698df4b92921daa23871f70c394300 Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Sun, 8 Feb 2015 12:01:35 -0600 Subject: [PATCH 5/6] some files use spaces, some use tabs --- .../antennapod/core/preferences/PlaybackPreferences.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java index 81b6be6ac..5bf333b5b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java @@ -43,8 +43,8 @@ public class PlaybackPreferences implements /** True if last played media was a video. */ public static final String PREF_CURRENT_EPISODE_IS_VIDEO = "de.danoeh.antennapod.preferences.lastIsVideo"; - /** Value of PREF_QUEUE_ADD_TO_FRONT if no media is playing. */ - public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; + /** Value of PREF_QUEUE_ADD_TO_FRONT if no media is playing. */ + public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; /** Value of PREF_CURRENTLY_PLAYING_MEDIA if no media is playing. */ public static final long NO_MEDIA_PLAYING = -1; From 46252ce663903b8f4c9ff41b7ab05ad3c94df669 Mon Sep 17 00:00:00 2001 From: Ross Harrison Date: Sun, 8 Feb 2015 19:21:42 -0600 Subject: [PATCH 6/6] move to user preferences --- .../antennapod/core/preferences/PlaybackPreferences.java | 3 --- .../de/danoeh/antennapod/core/preferences/UserPreferences.java | 1 + .../main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java index 5bf333b5b..d88543f73 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/PlaybackPreferences.java @@ -43,9 +43,6 @@ public class PlaybackPreferences implements /** True if last played media was a video. */ public static final String PREF_CURRENT_EPISODE_IS_VIDEO = "de.danoeh.antennapod.preferences.lastIsVideo"; - /** Value of PREF_QUEUE_ADD_TO_FRONT if no media is playing. */ - public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; - /** Value of PREF_CURRENTLY_PLAYING_MEDIA if no media is playing. */ public static final long NO_MEDIA_PLAYING = -1; diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index a3b9f6049..7cbb69a7f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -60,6 +60,7 @@ public class UserPreferences implements private static final String PREF_SEEK_DELTA_SECS = "prefSeekDeltaSecs"; private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify"; + public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront"; // TODO: Make this value configurable private static final float PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD_DEFAULT = 0.8f; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 0de04d64e..2a00776e2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -13,6 +13,7 @@ import de.danoeh.antennapod.core.asynctask.FlattrClickWorker; import de.danoeh.antennapod.core.feed.*; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; +import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.DownloadStatus; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.QueueAccess; @@ -379,7 +380,7 @@ public class DBWriter { if (item != null) { // add item to either front ot back of queue boolean addToFront = PreferenceManager.getDefaultSharedPreferences(context) - .getBoolean(PlaybackPreferences.PREF_QUEUE_ADD_TO_FRONT, false); + .getBoolean(UserPreferences.PREF_QUEUE_ADD_TO_FRONT, false); if(addToFront){ queue.add(0, item);