use of com.cyl.musiclake.ui.music.local.presenter.PlaylistDetailPresenter in project MusicLake by caiyonglong.
the class PlaylistDetailFragment method initViews.
@Override
public void initViews() {
mPlaylist = (Playlist) getArguments().getSerializable(Extras.PLAYLIST);
mToolbar.setTitle(mPlaylist != null ? mPlaylist.getName() : "");
setHasOptionsMenu(true);
if (getActivity() != null) {
AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
appCompatActivity.setSupportActionBar(mToolbar);
appCompatActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (getArguments().getBoolean(Extras.TRANSITION)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
album_art.setTransitionName(getArguments().getString("transition_name"));
}
}
mPresenter = new PlaylistDetailPresenter(getContext());
mPresenter.attachView(this);
mAdapter = new SongAdapter(musicList);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
mRecyclerView.setAdapter(mAdapter);
mAdapter.bindToRecyclerView(mRecyclerView);
}
Aggregations