aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-01 19:36:20 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-01 19:36:20 -0700
commitb50afea3fdd093a32d47f82d5b67a87f8d1e59a8 (patch)
treef1b1d1ff4a9de3407bf5ffbdbf03d32979247d76 /src
parent330e7edcb3611bf6b737cf89a6196b8ea4903927 (diff)
downloaddsub-b50afea3fdd093a32d47f82d5b67a87f8d1e59a8.tar.gz
dsub-b50afea3fdd093a32d47f82d5b67a87f8d1e59a8.tar.bz2
dsub-b50afea3fdd093a32d47f82d5b67a87f8d1e59a8.zip
Add bookmark icon so easy to tell where one exists
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index d5b7c0f2..8fb1d97b 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -48,6 +48,7 @@ public class SongView extends UpdateView implements Checkable {
private TextView durationTextView;
private TextView statusTextView;
private ImageView statusImageView;
+ private ImageView bookmarkButton;
private View bottomRowView;
private DownloadService downloadService;
@@ -62,6 +63,8 @@ public class SongView extends UpdateView implements Checkable {
private File partialFile;
private boolean partialFileExists = false;
private boolean loaded = false;
+ private boolean isBookmarked = false;
+ private boolean bookmarked = false;
public SongView(Context context) {
super(context);
@@ -75,6 +78,8 @@ public class SongView extends UpdateView implements Checkable {
statusImageView = (ImageView) findViewById(R.id.song_status_icon);
starButton = (ImageButton) findViewById(R.id.song_star);
starButton.setFocusable(false);
+ bookmarkButton = (ImageButton) findViewById(R.id.song_bookmark);
+ bookmarkButton.setFocusable(false);
moreButton = (ImageView) findViewById(R.id.artist_more);
moreButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -163,6 +168,7 @@ public class SongView extends UpdateView implements Checkable {
partialFile = downloadFile.getPartialFile();
partialFileExists = partialFile.exists();
isStarred = song.isStarred();
+ isBookmarked = song.getBookmark() != null;
// Check if needs to load metadata: check against all fields that we know are null in offline mode
if(song.getBitRate() == null && song.getDuration() == null && song.getDiscNumber() == null && isWorkDone) {
@@ -232,6 +238,18 @@ public class SongView extends UpdateView implements Checkable {
titleTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
}
}
+
+ if(isBookmarked) {
+ if(!bookmarked) {
+ bookmarkButton.setVisibility(View.VISIBLE);
+ bookmarked = true;
+ }
+ } else {
+ if(bookmarked) {
+ bookmarkButton.setVisibility(View.GONE);
+ bookmarked = false;
+ }
+ }
}
@Override