use of xdroid.viewholder.ViewHolder in project xdroid by shamanland.
the class ExampleBinder method onNewData.
@Override
public void onNewData(int position, View view, ExampleData data) {
ViewHolder holder = ViewHolder.obtain(view);
TextView text1 = holder.get(android.R.id.text1);
if (text1 != null) {
text1.setText(data.getTitle());
}
TextView text2 = holder.get(android.R.id.text2);
if (text2 != null) {
text2.setText(data.getSubTitle());
}
CompoundButton added = holder.get(R.id.added);
if (added != null) {
added.setChecked(data.isAdded());
}
RatingBar progress = holder.get(android.R.id.progress);
if (progress != null) {
progress.setRating((Math.abs(data.hashCode()) % 5) + 1);
}
}
Aggregations