RoboBinding/RoboBinding — pull request #191 by acatinon (2014-11-12 12:59:09+00:00)
Title: Allow DataSetAdapter<?> creation

There is some cases where we need flexibility on item views creation. For exemple when using libraries that require to inherit ```android.widget.BaseAdapter``` or with the ```RecyclerView``` ```ViewHolder``` approach.

So I added ability to create a ```DataSetAdapter``` for a dataSet property of a presentation model.

Now we can easily create a generic, RoboBinding powered ```RecyclerView.Adapter``` (can be usefull for #184) :

```java
public class GenericAdapter extends RecyclerView.Adapter {

private final DataSetAdapter dataSetAdapter;

public TasksAdapter(DataSetAdapter dataSetAdapter) {
this.dataSetAdapter = dataSetAdapter;

dataSetAdapter.registerDataSetObserver(new DataSetObserver() {
@Override
public void onChanged() {
notifyDataSetChanged();
}
});
}

@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = dataSetAdapter.getView(0, null, parent);
return new ViewHolder(v);
}

@Override
public void onBindViewHolder(ViewHolder viewHolder, int position) {
dataSetAdapter.getView(position, viewHolder.itemView, null);
}

@Override
public int getItemCount() {
return dataSetAdapter.getCount();
}

public class ViewHolder extends RecyclerView.ViewHolder {

public ViewHolder(View itemView) {
super(itemView);
}
}
}
```