diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-11-27 10:27:35 -0500 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-11-27 10:27:35 -0500 |
commit | 4c0a6f1ef7ea8a7f10c71b313a7816ac363f1aef (patch) | |
tree | 1759f72928545d4beed6e58a4c593a9695bb0cde /core | |
parent | 69038b4ff5fad16407ef7401202539113746dcf9 (diff) | |
download | AntennaPod-4c0a6f1ef7ea8a7f10c71b313a7816ac363f1aef.zip |
allow users to optionally have hardware forward button skip
Diffstat (limited to 'core')
3 files changed, 9 insertions, 1 deletions
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 6de546d3b..591451e17 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 { public static final String PREF_PAUSE_ON_HEADSET_DISCONNECT = "prefPauseOnHeadsetDisconnect"; public static final String PREF_UNPAUSE_ON_HEADSET_RECONNECT = "prefUnpauseOnHeadsetReconnect"; public static final String PREF_UNPAUSE_ON_BLUETOOTH_RECONNECT = "prefUnpauseOnBluetoothReconnect"; + public static final String PREF_HARDWARE_FOWARD_BUTTON_SKIPS = "prefHardwareForwardButtonSkips"; public static final String PREF_FOLLOW_QUEUE = "prefFollowQueue"; public static final String PREF_SKIP_KEEPS_EPISODE = "prefSkipKeepsEpisode"; public static final String PREF_AUTO_DELETE = "prefAutoDelete"; @@ -225,6 +226,10 @@ public class UserPreferences { return prefs.getBoolean(PREF_UNPAUSE_ON_BLUETOOTH_RECONNECT, false); } + public static boolean shouldHardwareButtonSkip() { + return prefs.getBoolean(PREF_HARDWARE_FOWARD_BUTTON_SKIPS, false); + } + public static boolean isFollowQueue() { return prefs.getBoolean(PREF_FOLLOW_QUEUE, true); diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java index b136de47f..7247c6bdf 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceMediaPlayer.java @@ -1260,7 +1260,8 @@ public class PlaybackServiceMediaPlayer implements SharedPreferences.OnSharedPre return true; } case KeyEvent.KEYCODE_MEDIA_NEXT: { - if(event.getSource() == InputDevice.SOURCE_CLASS_NONE) { + if(event.getSource() == InputDevice.SOURCE_CLASS_NONE || + UserPreferences.shouldHardwareButtonSkip()) { // assume the skip command comes from a notification or the lockscreen // a >| skip button should actually skip endPlayback(true); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6cbc5579d..576bb8a5b 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -280,6 +280,8 @@ <string name="pref_pauseOnDisconnect_sum">Pause playback when headphones or bluetooth are disconnected</string> <string name="pref_unpauseOnHeadsetReconnect_sum">Resume playback when the headphones are reconnected</string> <string name="pref_unpauseOnBluetoothReconnect_sum">Resume playback when bluetooth reconnects</string> + <string name="pref_hardwareForwardButtonSkips_title">Hardware forward skips</string> + <string name="pref_hardwareForwardButtonSkips_sum">When pressing a hardware forward button skip to the next track instead of fast-forwarding</string> <string name="pref_followQueue_sum">Jump to next queue item when playback completes</string> <string name="pref_auto_delete_sum">Delete episode when playback completes</string> <string name="pref_auto_delete_title">Auto Delete</string> |