-
Notifications
You must be signed in to change notification settings - Fork 183
Customization of Composite Items
Vitaly Vivchar edited this page Oct 19, 2017
·
17 revisions
- To set your LayoutManager override the
createLayoutManager()
method:
public class RecyclerViewRenderer extends CompositeViewRenderer<RecyclerViewModel, RecyclerViewHolder> {
...
@Override
protected RecyclerView.LayoutManager createLayoutManager() {
return new AnyLayoutManager();
}
}
- To set your RecyclerViewAdapter override the
createAdapter()
method:
public class RecyclerViewRenderer extends CompositeViewRenderer<RecyclerViewModel, RecyclerViewHolder> {
...
@Override
protected RendererRecyclerViewAdapter createAdapter() {
return new AnyExtendedAdapter();
}
}
- To add any ItemDecoration override the
createItemDecorations()
method:
public class RecyclerViewRenderer extends CompositeViewRenderer<RecyclerViewModel, RecyclerViewHolder> {
...
@Override
protected List<? extends RecyclerView.ItemDecoration> createItemDecorations() {
return Collections.singletonList(new AnyItemDecoration());
}
}