Search in sources :

Example 1 with ArtistSongAdapter

use of com.naman14.timber.adapters.ArtistSongAdapter in project Timber by naman14.

the class ArtistMusicFragment method setUpSongs.

private void setUpSongs() {
    songsRecyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));
    ArrayList<Song> songList;
    songList = ArtistSongLoader.getSongsForArtist(getActivity(), artistID);
    // adding one dummy song to top of arraylist
    //there will be albums header at this position in recyclerview
    songList.add(0, new Song(-1, -1, -1, "dummy", "dummy", "dummy", -1, -1));
    mSongAdapter = new ArtistSongAdapter(getActivity(), songList, artistID);
    songsRecyclerview.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
    songsRecyclerview.setAdapter(mSongAdapter);
}
Also used : Song(com.naman14.timber.models.Song) ArtistSongAdapter(com.naman14.timber.adapters.ArtistSongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.naman14.timber.widgets.DividerItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 ArtistSongAdapter (com.naman14.timber.adapters.ArtistSongAdapter)1 Song (com.naman14.timber.models.Song)1 DividerItemDecoration (com.naman14.timber.widgets.DividerItemDecoration)1