aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-10-13 18:04:45 -0700
committerScott Jackson <daneren2005@gmail.com>2015-10-13 18:04:45 -0700
commitb2645d6de60eec05c4435681655b6647c639d13a (patch)
tree677d8e457563184f39505ba78936268fa241959d /app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
parentc9df036805f9d4c02cc706bd8a29f4dc7de19834 (diff)
downloaddsub-b2645d6de60eec05c4435681655b6647c639d13a.tar.gz
dsub-b2645d6de60eec05c4435681655b6647c639d13a.tar.bz2
dsub-b2645d6de60eec05c4435681655b6647c639d13a.zip
Apply fix to timer not resetting from https://github.com/popeen/Popeens-DSub/commit/992ebba143119b00447687cf3d3e13ae2ac6783f
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java12
1 files changed, 10 insertions, 2 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 a6517bf6..5db79e99 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -428,7 +428,11 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
if(downloadService != null && downloadService.getSleepTimer()) {
int timeRemaining = downloadService.getSleepTimeRemaining();
timerMenu = menu.findItem(R.id.menu_toggle_timer);
- timerMenu.setTitle(context.getResources().getString(R.string.download_stop_time_remaining, Util.formatDuration(timeRemaining)));
+ if(timeRemaining > 1){
+ timerMenu.setTitle(context.getResources().getString(R.string.download_stop_time_remaining, Util.formatDuration(timeRemaining)));
+ } else {
+ timerMenu.setTitle(R.string.menu_set_timer);
+ }
}
if(downloadService != null && downloadService.getKeepScreenOn()) {
menu.findItem(R.id.menu_screen_on_off).setChecked(true);
@@ -1232,7 +1236,11 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
DownloadService downloadService = getDownloadService();
if(downloadService.getSleepTimer() && timerMenu != null) {
int timeRemaining = downloadService.getSleepTimeRemaining();
- timerMenu.setTitle(context.getResources().getString(R.string.download_stop_time_remaining, Util.formatDuration(timeRemaining)));
+ if(timeRemaining > 1){
+ timerMenu.setTitle(context.getResources().getString(R.string.download_stop_time_remaining, Util.formatDuration(timeRemaining)));
+ } else {
+ timerMenu.setTitle(R.string.menu_set_timer);
+ }
}
}