aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2017-06-13 11:59:45 -0700
committerScott Jackson <daneren2005@gmail.com>2017-06-13 11:59:45 -0700
commit9ff3e1a006a1071a0c5cb6d95a7383318d26a685 (patch)
treef7033bd9314568d2b89d489cb4f25e82f388398f /app
parent0666f94a98aa4bb9eb4bd46135ea69840b2e7e4f (diff)
parentd9531316f27b766c840503392c96520c1de0af8a (diff)
downloaddsub-9ff3e1a006a1071a0c5cb6d95a7383318d26a685.tar.gz
dsub-9ff3e1a006a1071a0c5cb6d95a7383318d26a685.tar.bz2
dsub-9ff3e1a006a1071a0c5cb6d95a7383318d26a685.zip
Merge branch 'KBerstene-feature/rewindjumppreferences' into edge
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java4
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadService.java6
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Constants.java4
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml/settings_playback.xml14
5 files changed, 23 insertions, 7 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index 19df9bfb..2ad6c14c 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -1175,10 +1175,10 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
downloadService.previous();
break;
case ACTION_FORWARD:
- downloadService.seekTo(downloadService.getPlayerPosition() + DownloadService.FAST_FORWARD);
+ downloadService.fastForward();
break;
case ACTION_REWIND:
- downloadService.seekTo(downloadService.getPlayerPosition() - DownloadService.REWIND);
+ downloadService.rewind();
break;
}
return null;
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
index b32a042d..fe18ede0 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java
@@ -107,8 +107,6 @@ public class DownloadService extends Service {
public static final String CMD_NEXT = "github.daneren2005.dsub.CMD_NEXT";
public static final String CANCEL_DOWNLOADS = "github.daneren2005.dsub.CANCEL_DOWNLOADS";
public static final String START_PLAY = "github.daneren2005.dsub.START_PLAYING";
- public static final int FAST_FORWARD = 30000;
- public static final int REWIND = 10000;
private static final long DEFAULT_DELAY_UPDATE_PROGRESS = 1000L;
private static final double DELETE_CUTOFF = 0.84;
private static final int REQUIRED_ALBUM_MATCHES = 4;
@@ -1174,10 +1172,10 @@ public class DownloadService extends Service {
}
}
public synchronized int rewind() {
- return seekToWrapper(-REWIND);
+ return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_REWIND_INTERVAL, "10"))*-1000);
}
public synchronized int fastForward() {
- return seekToWrapper(FAST_FORWARD);
+ return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_FASTFORWARD_INTERVAL, "30"))*1000);
}
protected int seekToWrapper(int difference) {
int msPlayed = Math.max(0, getPlayerPosition());
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
index 21adce8c..199fc56d 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
@@ -179,7 +179,9 @@ public final class Constants {
public static final String PREFERENCES_KEY_PLAYBACK_SPEED = "playbackSpeed";
public static final String PREFERENCES_KEY_SONG_PLAYBACK_SPEED = "songPlaybackSpeed";
public static final String PREFERENCES_KEY_DLNA_CASTING_ENABLED = "dlnaCastingEnabled";
-
+ public static final String PREFERENCES_KEY_REWIND_INTERVAL = "rewindInterval";
+ public static final String PREFERENCES_KEY_FASTFORWARD_INTERVAL = "fastforwardInterval";
+
public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount";
public static final String OFFLINE_SCROBBLE_ID = "scrobbleID";
public static final String OFFLINE_SCROBBLE_SEARCH = "scrobbleTitle";
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 81ee6c7a..5adf4499 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -491,6 +491,8 @@
<string name="settings.casting_cache_summary">Cache currently playing songs while casting</string>
<string name="settings.casting.dlna_casting_enabled">DLNA Enabled</string>
<string name="settings.casting.dlna_casting_enabled.summary">If you are having battery drain problems on Android 7.0 try turning this off</string>
+ <string name="settings.rewind_interval">Rewind Interval</string>
+ <string name="settings.fastforward_interval">Fast Forward Interval</string>
<string name="shuffle.title">Shuffle By</string>
<string name="shuffle.startYear">Start Year:</string>
diff --git a/app/src/main/res/xml/settings_playback.xml b/app/src/main/res/xml/settings_playback.xml
index da31d071..edaf3013 100644
--- a/app/src/main/res/xml/settings_playback.xml
+++ b/app/src/main/res/xml/settings_playback.xml
@@ -52,6 +52,20 @@
android:defaultValue="all"
android:entryValues="@array/songPressActionValues"
android:entries="@array/songPressActionNames"/>
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:title="@string/settings.rewind_interval"
+ android:key="rewindInterval"
+ android:defaultValue="10"
+ android:dialogLayout="@layout/seekbar_preference"
+ myns:max="60"/>
+
+ <github.daneren2005.dsub.view.SeekBarPreference
+ android:title="@string/settings.fastforward_interval"
+ android:key="fastforwardInterval"
+ android:defaultValue="30"
+ android:dialogLayout="@layout/seekbar_preference"
+ myns:max="60"/>
</PreferenceCategory>
<PreferenceCategory