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