use of eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager in project FlexibleAdapter by davideas.
the class FragmentExpandableSections method createNewGridLayoutManager.
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// here, you should use them and not Layout integers
switch(mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.recycler_header_item:
case R.layout.recycler_expandable_header_item:
case R.layout.recycler_expandable_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
use of eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager in project FlexibleAdapter by davideas.
the class FragmentHeadersSections method createNewGridLayoutManager.
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
//noinspection ConstantConditions
return mAdapter.getItem(position).getSpanSize(mColumnCount, position);
}
});
return gridLayoutManager;
}
use of eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager in project FlexibleAdapter by davideas.
the class FragmentOverall method createNewGridLayoutManager.
@Override
protected GridLayoutManager createNewGridLayoutManager() {
mAdapter.setAnimationEntryStep(false);
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// here, you should use them and not Layout integers
switch(mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_usecase_item:
case R.layout.recycler_scrollable_layout_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
use of eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager in project FlexibleAdapter by davideas.
the class FragmentEndlessScrolling method createNewGridLayoutManager.
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// here, you should use them and not Layout integers
switch(mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_expandable_item:
case R.layout.recycler_scrollable_header_item:
case R.layout.recycler_scrollable_footer_item:
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.progress_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
use of eu.davidea.flexibleadapter.common.SmoothScrollGridLayoutManager in project FlexibleAdapter by davideas.
the class FragmentExpandableMultiLevel method createNewGridLayoutManager.
@Override
protected GridLayoutManager createNewGridLayoutManager() {
GridLayoutManager gridLayoutManager = new SmoothScrollGridLayoutManager(getActivity(), mColumnCount);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
// here, you should use them and not Layout integers
switch(mAdapter.getItemViewType(position)) {
case R.layout.recycler_scrollable_layout_item:
case R.layout.recycler_scrollable_uls_item:
case R.layout.recycler_header_item:
case R.layout.recycler_expandable_header_item:
case R.layout.recycler_expandable_item:
return mColumnCount;
default:
return 1;
}
}
});
return gridLayoutManager;
}
Aggregations