use of com.simplecity.amp_library.ui.modelviews.SubheaderView in project Shuttle by timusus.
the class BaseDetailFragment method getAlbumViewModels.
@NonNull
@Override
public List<ViewModel> getAlbumViewModels(List<Album> albums) {
if (albums.isEmpty()) {
return Collections.emptyList();
}
List<ViewModel> items = new ArrayList<>();
if (setHorizontalItemsDisposable != null) {
setHorizontalItemsDisposable.dispose();
}
setHorizontalItemsDisposable = horizontalRecyclerView.setItems(Stream.of(albums).map(album -> {
HorizontalAlbumView horizontalAlbumView = new HorizontalAlbumView(album, requestManager);
horizontalAlbumView.setClickListener(BaseDetailFragment.this);
horizontalAlbumView.showYear(true);
return horizontalAlbumView;
}).collect(Collectors.toList()));
items.add(new SubheaderView(StringUtils.makeAlbumsLabel(getContext(), albums.size())));
items.add(horizontalRecyclerView);
return items;
}
use of com.simplecity.amp_library.ui.modelviews.SubheaderView in project Shuttle by timusus.
the class BaseDetailFragment method getSongViewModels.
@NonNull
@Override
public List<ViewModel> getSongViewModels(List<Song> songs) {
List<ViewModel> items = new ArrayList<>();
items.add(new SubheaderView(StringUtils.makeSongsLabel(getContext(), songs.size())));
items.addAll(Stream.of(songs).map(song -> {
SongView songView = new SongView(song, requestManager);
songView.setClickListener(BaseDetailFragment.this);
return songView;
}).toList());
return items;
}
Aggregations