aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-15 16:30:59 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-15 16:30:59 -0700
commit5ff50b39b48cdcdccbd7e0cd130e65436602195b (patch)
treeb636071f92a42712da3ba359524cf83eaf3b942e /src
parent61b2b2a55e400ce46542147e777f89724796c4e7 (diff)
downloaddsub-5ff50b39b48cdcdccbd7e0cd130e65436602195b.tar.gz
dsub-5ff50b39b48cdcdccbd7e0cd130e65436602195b.tar.bz2
dsub-5ff50b39b48cdcdccbd7e0cd130e65436602195b.zip
Fix bookmark showing selected even if cancelled or error
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/NowPlayingFragment.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index 67bc245e..b9e6bffa 100644
--- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -370,7 +370,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
@Override
public void onClick(View view) {
createBookmark();
- bookmarkButton.setImageResource(R.drawable.ic_menu_bookmark_selected);
}
});
@@ -1400,6 +1399,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
final int position = downloadService.getPlayerPosition();
final Bookmark oldBookmark = currentSong.getBookmark();
currentSong.setBookmark(new Bookmark(position));
+ bookmarkButton.setImageResource(R.drawable.ic_menu_bookmark_selected);
new SilentBackgroundTask<Void>(context) {
@Override
@@ -1428,6 +1428,17 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
Log.w(TAG, "Failed to create bookmark", error);
currentSong.setBookmark(oldBookmark);
+ // If no bookmark at start, then return to no bookmark
+ if(oldBookmark == null) {
+ int bookmark;
+ if(context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
+ bookmark = R.drawable.ic_menu_bookmark_dark;
+ } else {
+ bookmark = Util.getAttribute(context, R.attr.bookmark);
+ }
+ bookmarkButton.setImageResource(bookmark);
+ }
+
String msg;
if(error instanceof OfflineException || error instanceof ServerTooOldException) {
msg = getErrorMessage(error);