Search in sources :

Example 6 with SongAdapter

use of com.cyl.musiclake.ui.music.local.adapter.SongAdapter 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)

Example 7 with SongAdapter

use of com.cyl.musiclake.ui.music.local.adapter.SongAdapter in project MusicLake by caiyonglong.

the class FolderSongsFragment method initViews.

@Override
public void initViews() {
    mToolbar.setTitle("文件夹");
    setHasOptionsMenu(true);
    if (getActivity() != null) {
        AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
        appCompatActivity.setSupportActionBar(mToolbar);
        appCompatActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    mPresenter = new FolderSongPresenter(getActivity());
    mPresenter.attachView(this);
    if (getArguments() != null) {
        path = getArguments().getString(Extras.FOLDER_PATH);
    }
    mAdapter = new SongAdapter(null);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
    setHasOptionsMenu(true);
}
Also used : FolderSongPresenter(com.cyl.musiclake.ui.music.local.presenter.FolderSongPresenter) AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 8 with SongAdapter

use of com.cyl.musiclake.ui.music.local.adapter.SongAdapter in project MusicLake by caiyonglong.

the class BaiduMusicListActivity method initData.

@Override
protected void initData() {
    mPresenter = new BaiduListPresenter(this);
    mPresenter.attachView(this);
    mAdapter = new SongAdapter(musicList);
    mAdapter.setEnableLoadMore(true);
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mRecyclerView.setLayoutManager(layoutManager);
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
    showHeaderInfo();
    mPresenter.loadOnlineMusicList(type, 10, mOffset);
}
Also used : SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) BaiduListPresenter(com.cyl.musiclake.ui.music.online.presenter.BaiduListPresenter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 9 with SongAdapter

use of com.cyl.musiclake.ui.music.local.adapter.SongAdapter in project MusicLake by caiyonglong.

the class DownloadedFragment method initViews.

@Override
public void initViews() {
    mAdapter = new SongAdapter(musicList);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
    mPresenter = new DownloadPresenter(getActivity());
    mPresenter.attachView(this);
}
Also used : SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DownloadPresenter(com.cyl.musiclake.ui.music.online.presenter.DownloadPresenter)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)9 SongAdapter (com.cyl.musiclake.ui.music.local.adapter.SongAdapter)9 AppCompatActivity (android.support.v7.app.AppCompatActivity)6 AlbumDetailPresenter (com.cyl.musiclake.ui.music.local.presenter.AlbumDetailPresenter)1 ArtistSongsPresenter (com.cyl.musiclake.ui.music.local.presenter.ArtistSongsPresenter)1 FolderSongPresenter (com.cyl.musiclake.ui.music.local.presenter.FolderSongPresenter)1 LovePresenter (com.cyl.musiclake.ui.music.local.presenter.LovePresenter)1 PlaylistDetailPresenter (com.cyl.musiclake.ui.music.local.presenter.PlaylistDetailPresenter)1 RecentlyPresenter (com.cyl.musiclake.ui.music.local.presenter.RecentlyPresenter)1 SongsPresenter (com.cyl.musiclake.ui.music.local.presenter.SongsPresenter)1 BaiduListPresenter (com.cyl.musiclake.ui.music.online.presenter.BaiduListPresenter)1 DownloadPresenter (com.cyl.musiclake.ui.music.online.presenter.DownloadPresenter)1