-
Notifications
You must be signed in to change notification settings - Fork 183
Quick start with the Renderer Adapter
Vitaly Vivchar edited this page Feb 21, 2018
·
9 revisions
To use the RendereRecyclerViewAdapter you should:
1. Initialize the RendererRecyclerViewAdapter
public class SomeActivity extends AppCompatActivity {
private RendererRecyclerViewAdapter mRecyclerViewAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter = new RendererRecyclerViewAdapter(getContext());
...
}
}
2. Create a ViewBinder or a CompositeViewBinder
public class SomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter.registerRenderer(new AnyViewBinder());
...
}
}
public class SomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter.setItems(getItems());
mRecyclerViewAdapter.notifyDataSetChanged();
...
}
}