use of com.simplecity.amp_library.ui.recyclerview.GridDividerDecoration in project Shuttle by timusus.
the class AlbumArtistFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (recyclerView == null) {
int spanCount = SettingsManager.getInstance().getArtistColumnCount(getResources());
layoutManager = new GridLayoutManager(getContext(), spanCount);
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (albumArtistAdapter.items.get(position) instanceof EmptyView) {
return spanCount;
}
return 1;
}
});
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new GridDividerDecoration(getResources(), 4, true));
recyclerView.setRecyclerListener(this);
recyclerView.setAdapter(albumArtistAdapter);
actionMode = null;
themeUIComponents();
}
return recyclerView;
}
use of com.simplecity.amp_library.ui.recyclerview.GridDividerDecoration in project Shuttle by timusus.
the class AlbumFragment method onCreateView.
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (recyclerView == null) {
int spanCount = SettingsManager.getInstance().getAlbumColumnCount(getResources());
layoutManager = new GridLayoutManager(getContext(), spanCount);
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
if (albumAdapter.items.get(position) instanceof EmptyView) {
return spanCount;
}
return 1;
}
});
recyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
recyclerView.setLayoutManager(layoutManager);
recyclerView.addItemDecoration(new GridDividerDecoration(getResources(), 4, true));
recyclerView.setRecyclerListener(this);
recyclerView.setAdapter(albumAdapter);
actionMode = null;
themeUIComponents();
}
return recyclerView;
}
use of com.simplecity.amp_library.ui.recyclerview.GridDividerDecoration in project Shuttle by timusus.
the class GenreFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (mRecyclerView == null) {
mRecyclerView = (FastScrollRecyclerView) inflater.inflate(R.layout.fragment_recycler, container, false);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mRecyclerView.addItemDecoration(new GridDividerDecoration(getResources(), 4, true));
mRecyclerView.setRecyclerListener(this);
mRecyclerView.setAdapter(genreAdapter);
themeUIComponents();
}
return mRecyclerView;
}
Aggregations