-
Notifications
You must be signed in to change notification settings - Fork 183
Quick start with the Renderer Adapter
Vitaly Vivchar edited this page Oct 19, 2017
·
9 revisions
To use the RendereRecyclerViewAdapter you should:
- Initialize the RendererRecyclerViewAdapter
public class SomeActivity extends AppCompatActivity {
private RendererRecyclerViewAdapter mRecyclerViewAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter = new RendererRecyclerViewAdapter();
...
}
}
-
Create a ViewRenderer or a CompositeViewRenderer
-
Register your ViewRenderer
public class SomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter.registerRenderer(new AnyViewRenderer());
...
}
}
- Set a data to the Adapter
public class SomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
...
mRecyclerViewAdapter.setItems(getItems());
mRecyclerViewAdapter.notifyDataSetChanged();
...
}
}