Skip to content

Customization of Composite Items

Vitaly Vivchar edited this page Jan 28, 2018 · 17 revisions

To change LayoutManager extend CompositeViewBinder and override the createLayoutManager()` method:

public class YourCompositeViewBinder extends CompositeViewBinder<YourCompositeModel> {
    //...
    @Override
    protected RecyclerView.LayoutManager createLayoutManager() {
        return new AnyLayoutManager();
    }
}

To set custom RendererRecyclerViewAdapter extend CompositeViewBinder and override createAdapter method:

public class YourCompositeViewBinder extends CompositeViewBinder<YourCompositeModel> {
    //...
    @Override
    protected RendererRecyclerViewAdapter createAdapter() {
        return new AnyExtendedAdapter();
    }
}

To add any ItemDecoration extend CompositeViewBinder and override createItemDecorations() method:

public class YourCompositeViewBinder extends CompositeViewBinder<YourCompositeModel> {
    //...
    @Override
    protected List<? extends RecyclerView.ItemDecoration> createItemDecorations() {
        return Collections.singletonList(new AnyItemDecoration());
    }
}