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);
}
}
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();
}
Aggregations