Search in sources :

Example 1 with ArtistSongsPresenter

use of com.cyl.musiclake.ui.music.local.presenter.ArtistSongsPresenter in project MusicLake by caiyonglong.

the class ArtistSongsFragment method initViews.

@Override
public void initViews() {
    artistID = getArguments().getLong(Extras.ARTIST_ID);
    transitionName = getArguments().getString(Extras.TRANSITIONNAME);
    title = getArguments().getString(Extras.PLAYLIST_NAME);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        album_art.setTransitionName(transitionName);
        if (transitionName != null)
            album_art.setTransitionName(transitionName);
    }
    if (title != null)
        collapsing_toolbar.setTitle(title);
    mPresenter = new ArtistSongsPresenter(getContext());
    mPresenter.attachView(this);
    setHasOptionsMenu(true);
    if (getActivity() != null) {
        AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
        appCompatActivity.setSupportActionBar(mToolbar);
        appCompatActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    mAdapter = new SongAdapter(musicInfos);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) ArtistSongsPresenter(com.cyl.musiclake.ui.music.local.presenter.ArtistSongsPresenter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

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 ArtistSongsPresenter (com.cyl.musiclake.ui.music.local.presenter.ArtistSongsPresenter)1