Search in sources :

Example 1 with RendererAdapter

use of me.alexrs.recyclerviewrenderers.adapter.RendererAdapter in project RecyclerViewRenderers by Alexrs95.

the class RenderersActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.a_bender);
    ButterKnife.inject(this);
    recyclerView.setHasFixedSize(false);
    recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(layoutManager);
    adapter = new RendererAdapter(createItems(), new RendererBuilder(new Factory()));
    recyclerView.setAdapter(adapter);
}
Also used : RendererBuilder(me.alexrs.recyclerviewrenderers.builder.RendererBuilder) Factory(me.alexrs.recyclerviewrenderers.factory.Factory) DividerItemDecoration(me.alexrs.recyclerviewrenderers.decorator.DividerItemDecoration) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) RendererAdapter(me.alexrs.recyclerviewrenderers.adapter.RendererAdapter)

Aggregations

DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RendererAdapter (me.alexrs.recyclerviewrenderers.adapter.RendererAdapter)1 RendererBuilder (me.alexrs.recyclerviewrenderers.builder.RendererBuilder)1 DividerItemDecoration (me.alexrs.recyclerviewrenderers.decorator.DividerItemDecoration)1 Factory (me.alexrs.recyclerviewrenderers.factory.Factory)1