diff options
Diffstat (limited to 'src/github')
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;
}
|