Search in sources :

Example 1 with SongAdapter

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

Example 2 with SongAdapter

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

the class SongsFragment method initViews.

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

Example 3 with SongAdapter

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

the class LoveFragment method initViews.

@Override
public void initViews() {
    mToolbar.setTitle("收藏");
    setHasOptionsMenu(true);
    if (getActivity() != null) {
        AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
        appCompatActivity.setSupportActionBar(mToolbar);
        appCompatActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    mAdapter = new SongAdapter(musicInfos);
    mAdapter.openLoadAnimation(BaseQuickAdapter.SLIDEIN_LEFT);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
    mPresenter = new LovePresenter(getContext());
    mPresenter.attachView(this);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LovePresenter(com.cyl.musiclake.ui.music.local.presenter.LovePresenter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 4 with SongAdapter

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

the class RecentlyFragment method initViews.

@Override
public void initViews() {
    mToolbar.setTitle("播放历史");
    setHasOptionsMenu(true);
    if (getActivity() != null) {
        AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
        appCompatActivity.setSupportActionBar(mToolbar);
        appCompatActivity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    mAdapter = new SongAdapter(musicInfos);
    mAdapter.openLoadAnimation(BaseQuickAdapter.SLIDEIN_LEFT);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.bindToRecyclerView(mRecyclerView);
    mPresenter = new RecentlyPresenter(getContext());
    mPresenter.attachView(this);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecentlyPresenter(com.cyl.musiclake.ui.music.local.presenter.RecentlyPresenter)

Example 5 with SongAdapter

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

the class AlbumDetailFragment method initViews.

@Override
public void initViews() {
    albumID = getArguments().getLong(Extras.ALBUM_ID);
    transitionName = getArguments().getString(Extras.TRANSITIONNAME);
    title = getArguments().getString(Extras.PLAYLIST_NAME);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        if (transitionName != null) {
            album_art.setTransitionName(transitionName);
            album_art.setHasTransientState(true);
        }
    }
    if (title != null)
        collapsing_toolbar.setTitle(title);
    mPresenter = new AlbumDetailPresenter(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 : AlbumDetailPresenter(com.cyl.musiclake.ui.music.local.presenter.AlbumDetailPresenter) AppCompatActivity(android.support.v7.app.AppCompatActivity) SongAdapter(com.cyl.musiclake.ui.music.local.adapter.SongAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

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