use of android.widget.RatingBar 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);
}
}
use of android.widget.RatingBar in project FastDev4Android by jiangqqlmj.
the class BaseAdapterHelper method setRating.
/**
* Sets the rating (the number of stars filled) of a RatingBar.
* 设置评分条的分数
* @param viewId The view id.
* @param rating The rating.
* @return The BaseAdapterHelper for chaining.
*/
public BaseAdapterHelper setRating(int viewId, float rating) {
RatingBar view = retrieveView(viewId);
view.setRating(rating);
return this;
}
use of android.widget.RatingBar in project YhLibraryForAndroid by android-coco.
the class YHRecyclerViewHolder method setRating.
public YHRecyclerViewHolder setRating(int viewId, float rating, int max) {
RatingBar view = getView(viewId);
view.setMax(max);
view.setRating(rating);
return this;
}
Aggregations