Search in sources :

Example 1 with DividerItemDecoration

use of com.naman14.timber.widgets.DividerItemDecoration in project Timber by naman14.

the class PlaylistFragment method setItemDecoration.

private void setItemDecoration() {
    if (isGrid) {
        int spacingInPixels = getActivity().getResources().getDimensionPixelSize(R.dimen.spacing_card_album_grid);
        itemDecoration = new SpacesItemDecoration(spacingInPixels);
    } else {
        itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
    }
    recyclerView.addItemDecoration(itemDecoration);
}
Also used : DividerItemDecoration(com.naman14.timber.widgets.DividerItemDecoration)

Example 2 with DividerItemDecoration

use of com.naman14.timber.widgets.DividerItemDecoration in project Timber by naman14.

the class AlbumFragment method setItemDecoration.

private void setItemDecoration() {
    if (isGrid) {
        int spacingInPixels = getActivity().getResources().getDimensionPixelSize(R.dimen.spacing_card_album_grid);
        itemDecoration = new SpacesItemDecoration(spacingInPixels);
    } else {
        itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
    }
    recyclerView.addItemDecoration(itemDecoration);
}
Also used : DividerItemDecoration(com.naman14.timber.widgets.DividerItemDecoration)

Example 3 with DividerItemDecoration

use of com.naman14.timber.widgets.DividerItemDecoration in project Timber by naman14.

the class ArtistFragment method setItemDecoration.

private void setItemDecoration() {
    if (isGrid) {
        int spacingInPixels = getActivity().getResources().getDimensionPixelSize(R.dimen.spacing_card_album_grid);
        itemDecoration = new SpacesItemDecoration(spacingInPixels);
    } else {
        itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST);
    }
    recyclerView.addItemDecoration(itemDecoration);
}
Also used : DividerItemDecoration(com.naman14.timber.widgets.DividerItemDecoration)

Example 4 with DividerItemDecoration

use of com.naman14.timber.widgets.DividerItemDecoration 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)

Example 5 with DividerItemDecoration

use of com.naman14.timber.widgets.DividerItemDecoration in project Timber by naman14.

the class AlbumDetailFragment method setUpAlbumSongs.

private void setUpAlbumSongs() {
    List<Song> songList = AlbumSongLoader.getSongsForAlbum(getActivity(), albumID);
    mAdapter = new AlbumSongsAdapter(getActivity(), songList, albumID);
    recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
    recyclerView.setAdapter(mAdapter);
}
Also used : Song(com.naman14.timber.models.Song) AlbumSongsAdapter(com.naman14.timber.adapters.AlbumSongsAdapter) DividerItemDecoration(com.naman14.timber.widgets.DividerItemDecoration)

Aggregations

DividerItemDecoration (com.naman14.timber.widgets.DividerItemDecoration)6 Song (com.naman14.timber.models.Song)2 Handler (android.os.Handler)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 AlbumSongsAdapter (com.naman14.timber.adapters.AlbumSongsAdapter)1 ArtistSongAdapter (com.naman14.timber.adapters.ArtistSongAdapter)1