diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-11-27 10:47:18 -0500 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-11-27 10:47:18 -0500 |
commit | 4b926b44f7979f43331c33f420af1c5434cbe21c (patch) | |
tree | f66a408826a4597fb39f97c5ee64428a704fc28a /core/src/main | |
parent | a7293b4a66c374f9ed421cb29f288f1754612871 (diff) | |
parent | d2d22a82e2132d18c69aeb1b0ebdddab98dff0d4 (diff) | |
download | AntennaPod-4b926b44f7979f43331c33f420af1c5434cbe21c.zip |
Merge pull request #1424 from TomHennen/optional_hardware_skip
allow users to optionally have hardware forward button skip
Diffstat (limited to 'core/src/main')
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 428d1d7d3..abb5f1f99 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 575724427..ed818e09a 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">Forward button 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> |