Search in sources :

Example 1 with PlaylistAdapter

use of io.hefuyi.listener.ui.adapter.PlaylistAdapter in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistFragment method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    injectDependences();
    mPresenter.attachView(this);
    mPreferences = PreferencesUtility.getInstance(getActivity());
    isGrid = mPreferences.getPlaylistView() == Constants.PLAYLIST_VIEW_GRID;
    mAdapter = new PlaylistAdapter(this, null);
    if (isGrid) {
        layoutManager = new GridLayoutManager(getActivity(), 2);
    } else {
        layoutManager = new GridLayoutManager(getActivity(), 1);
    }
}
Also used : GridLayoutManager(android.support.v7.widget.GridLayoutManager) PlaylistAdapter(io.hefuyi.listener.ui.adapter.PlaylistAdapter)

Example 2 with PlaylistAdapter

use of io.hefuyi.listener.ui.adapter.PlaylistAdapter in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistFragment method updateLayoutManager.

private void updateLayoutManager(int column) {
    recyclerView.removeItemDecoration(itemDecoration);
    mAdapter = new PlaylistAdapter(this, null);
    recyclerView.setAdapter(mAdapter);
    layoutManager.setSpanCount(column);
    layoutManager.requestLayout();
    setItemDecoration();
    mPresenter.loadPlaylist();
}
Also used : PlaylistAdapter(io.hefuyi.listener.ui.adapter.PlaylistAdapter)

Aggregations

PlaylistAdapter (io.hefuyi.listener.ui.adapter.PlaylistAdapter)2 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1