use of io.github.ryanhoo.music.event.PlaySongEvent in project StylishMusicPlayer by ryanhoo.
the class AllLocalMusicFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
mAdapter = new LocalMusicAdapter(getActivity(), null);
mAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(int position) {
Song song = mAdapter.getItem(position);
RxBus.getInstance().post(new PlaySongEvent(song));
}
});
recyclerView.setAdapter(mAdapter);
recyclerView.addItemDecoration(new DefaultDividerDecoration());
fastScroller.setRecyclerView(recyclerView);
new LocalMusicPresenter(AppRepository.getInstance(), this).subscribe();
}
Aggregations