use of com.kabouzeid.gramophone.adapter.song.PlayingQueueAdapter in project Phonograph by kabouzeid.
the class CardPlayerFragment method setUpRecyclerView.
private void setUpRecyclerView() {
recyclerViewDragDropManager = new RecyclerViewDragDropManager();
final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
playingQueueAdapter = new PlayingQueueAdapter(((AppCompatActivity) getActivity()), MusicPlayerRemote.getPlayingQueue(), MusicPlayerRemote.getPosition(), R.layout.item_list, false, null);
wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter);
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(wrappedAdapter);
recyclerView.setItemAnimator(animator);
recyclerViewDragDropManager.attachRecyclerView(recyclerView);
layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.getPosition() + 1, 0);
}
use of com.kabouzeid.gramophone.adapter.song.PlayingQueueAdapter in project Phonograph by kabouzeid.
the class FlatPlayerFragment method setUpRecyclerView.
private void setUpRecyclerView() {
recyclerViewDragDropManager = new RecyclerViewDragDropManager();
final GeneralItemAnimator animator = new RefactoredDefaultItemAnimator();
playingQueueAdapter = new PlayingQueueAdapter(((AppCompatActivity) getActivity()), MusicPlayerRemote.getPlayingQueue(), MusicPlayerRemote.getPosition(), R.layout.item_list, false, null);
wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter);
layoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(wrappedAdapter);
recyclerView.setItemAnimator(animator);
recyclerViewDragDropManager.attachRecyclerView(recyclerView);
layoutManager.scrollToPositionWithOffset(MusicPlayerRemote.getPosition() + 1, 0);
}
Aggregations