Search in sources :

Example 1 with PlaylistDetailPresenter

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);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) PlaylistDetailPresenter(com.cyl.musiclake.ui.music.local.presenter.PlaylistDetailPresenter)

Aggregations

AppCompatActivity (android.support.v7.app.AppCompatActivity)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 SongAdapter (com.cyl.musiclake.ui.music.local.adapter.SongAdapter)1 PlaylistDetailPresenter (com.cyl.musiclake.ui.music.local.presenter.PlaylistDetailPresenter)1