use of com.hotbitmapgg.bilibili.widget.sectioned.SectionedRecyclerViewAdapter in project bilibili-android-client by HotBitmapGG.
the class AdvertisingActivity method initRecyclerView.
@Override
public void initRecyclerView() {
mSectionedRecyclerViewAdapter = new SectionedRecyclerViewAdapter();
GridLayoutManager mLayoutManager = new GridLayoutManager(AdvertisingActivity.this, 2);
mLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch(mSectionedRecyclerViewAdapter.getSectionItemViewType(position)) {
case SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER:
return 2;
default:
return 1;
}
}
});
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mSectionedRecyclerViewAdapter);
setRecycleNoScroll();
}
use of com.hotbitmapgg.bilibili.widget.sectioned.SectionedRecyclerViewAdapter in project bilibili-android-client by HotBitmapGG.
the class RegionTypeRecommendFragment method initRecyclerView.
@Override
protected void initRecyclerView() {
mSectionedRecyclerViewAdapter = new SectionedRecyclerViewAdapter();
GridLayoutManager mLayoutManager = new GridLayoutManager(getActivity(), 2);
mLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
switch(mSectionedRecyclerViewAdapter.getSectionItemViewType(position)) {
case SectionedRecyclerViewAdapter.VIEW_TYPE_HEADER:
return 2;
default:
return 1;
}
}
});
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setAdapter(mSectionedRecyclerViewAdapter);
setRecycleNoScroll();
}
Aggregations