aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-04-29 07:34:14 -0700
committerScott Jackson <daneren2005@gmail.com>2014-04-29 07:34:14 -0700
commit7f43eb0bac0a22ae9f3f4a536c4968f901567170 (patch)
tree11afb366f675c497f00ce887aecc6c9bf0274402 /src/github/daneren2005
parent6533d97eec6f9c9eb7e7e3a608499c8c286f2195 (diff)
downloaddsub-7f43eb0bac0a22ae9f3f4a536c4968f901567170.tar.gz
dsub-7f43eb0bac0a22ae9f3f4a536c4968f901567170.tar.bz2
dsub-7f43eb0bac0a22ae9f3f4a536c4968f901567170.zip
Don't show artist when viewing a single artist
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java4
-rw-r--r--src/github/daneren2005/dsub/view/AlbumCell.java22
-rw-r--r--src/github/daneren2005/dsub/view/AlbumGridAdapter.java5
3 files changed, 22 insertions, 9 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 948654c4..3754409f 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -655,9 +655,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
entryList.setAdapter(new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize));
}
else if(albumListType == null || "starred".equals(albumListType)) {
- albumList.setAdapter(new AlbumGridAdapter(context, getImageLoader(), albums));
+ albumList.setAdapter(new AlbumGridAdapter(context, getImageLoader(), albums, !artist));
} else {
- albumList.setAdapter(new AlbumListAdapter(context, new AlbumGridAdapter(context, getImageLoader(), albums), albumListType, albumListExtra, albumListSize));
+ albumList.setAdapter(new AlbumListAdapter(context, new AlbumGridAdapter(context, getImageLoader(), albums, true), albumListType, albumListExtra, albumListSize));
}
entryList.setVisibility(View.VISIBLE);
context.supportInvalidateOptionsMenu();
diff --git a/src/github/daneren2005/dsub/view/AlbumCell.java b/src/github/daneren2005/dsub/view/AlbumCell.java
index 9cee0c41..7cfe33f6 100644
--- a/src/github/daneren2005/dsub/view/AlbumCell.java
+++ b/src/github/daneren2005/dsub/view/AlbumCell.java
@@ -39,6 +39,7 @@ public class AlbumCell extends UpdateView {
private View coverArtView;
private TextView titleView;
private TextView artistView;
+ private boolean showArtist = true;
public AlbumCell(Context context) {
super(context);
@@ -56,6 +57,10 @@ public class AlbumCell extends UpdateView {
});
}
+ public void setShowArtist(boolean showArtist) {
+ this.showArtist = showArtist;
+ }
+
protected void setObjectImpl(Object obj1, Object obj2) {
this.album = (MusicDirectory.Entry) obj1;
if(album.getAlbum() == null) {
@@ -63,12 +68,17 @@ public class AlbumCell extends UpdateView {
} else {
titleView.setText(album.getAlbum());
}
- String artist = album.getArtist();
- if(artist == null) {
- artist = "";
- }
- if(album.getYear() != null) {
- artist += " - " + album.getYear();
+ String artist = "";
+ if(showArtist) {
+ artist = album.getArtist();
+ if (artist == null) {
+ artist = "";
+ }
+ if (album.getYear() != null) {
+ artist += " - " + album.getYear();
+ }
+ } else if(album.getYear() != null) {
+ artist += album.getYear();
}
artistView.setText(artist);
artistView.setVisibility(album.getArtist() == null ? View.GONE : View.VISIBLE);
diff --git a/src/github/daneren2005/dsub/view/AlbumGridAdapter.java b/src/github/daneren2005/dsub/view/AlbumGridAdapter.java
index 3c81fa9a..ca7c089d 100644
--- a/src/github/daneren2005/dsub/view/AlbumGridAdapter.java
+++ b/src/github/daneren2005/dsub/view/AlbumGridAdapter.java
@@ -30,12 +30,14 @@ public class AlbumGridAdapter extends ArrayAdapter<MusicDirectory.Entry> {
private final Context activity;
private final ImageLoader imageLoader;
private List<MusicDirectory.Entry> entries;
+ private boolean showArtist;
- public AlbumGridAdapter(Context activity, ImageLoader imageLoader, List<MusicDirectory.Entry> entries) {
+ public AlbumGridAdapter(Context activity, ImageLoader imageLoader, List<MusicDirectory.Entry> entries, boolean showArtist) {
super(activity, android.R.layout.simple_list_item_1, entries);
this.entries = entries;
this.activity = activity;
this.imageLoader = imageLoader;
+ this.showArtist = showArtist;
}
@Override
@@ -49,6 +51,7 @@ public class AlbumGridAdapter extends ArrayAdapter<MusicDirectory.Entry> {
view = new AlbumCell(activity);
}
+ view.setShowArtist(showArtist);
view.setObject(entry, imageLoader);
return view;
}