本文整理汇总了Java中android.widget.RatingBar.setRating方法的典型用法代码示例。如果您正苦于以下问题:Java RatingBar.setRating方法的具体用法?Java RatingBar.setRating怎么用?Java RatingBar.setRating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RatingBar
的用法示例。
在下文中一共展示了RatingBar.setRating方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import android.widget.RatingBar; //导入方法依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent){
Meal meal = mealList.get(position);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(MainActivity.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.meal_row, null);
TextView title = (TextView) view.findViewById(R.id.mealTitle);
TextView description = (TextView) view.findViewById(R.id.mealDescription);
TextView location = (TextView) view.findViewById(R.id.mealLocation);
RatingBar rating = (RatingBar) view.findViewById(R.id.mealRating);
ImageView image = (ImageView) view.findViewById(R.id.mealImage);
title.setText(meal.getTitle());
description.setText(meal.getDescription());
location.setText(meal.getLocation());
rating.setRating(meal.getNumStars());
image.setImageBitmap(meal.getBitmap());
return view;
}
示例2: DesignerCreateView
import android.widget.RatingBar; //导入方法依赖的package包/类
@Override
public void DesignerCreateView(PanelWrapper base, LabelWrapper lw, Map props) {
RatingBar rb = getObject();
CustomViewWrapper.replaceBaseWithView2(base, rb);
LayoutParams lp = rb.getLayoutParams();
lp.width = LayoutParams.WRAP_CONTENT;
lp.height = LayoutParams.WRAP_CONTENT;
rb.setIsIndicator((Boolean)props.Get("Indicator"));
rb.setNumStars((Integer)props.Get("NumberOfStars"));
rb.setRating((Float)props.Get("Rating"));
rb.setStepSize((Float)props.Get("StepSize"));
}
示例3: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating, int max)
{
RatingBar view = getView(viewId);
view.setMax(max);
view.setRating(rating);
return this;
}
示例4: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating)
{
RatingBar view = getView(viewId);
view.setRating(rating);
return this;
}
示例5: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolderHelper setRating(int viewId, float rating) {
RatingBar view = getView(viewId);
view.setRating(rating);
return this;
}
示例6: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating, int max) {
RatingBar view = getView(viewId);
view.setMax(max);
view.setRating(rating);
return this;
}
示例7: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating) {
RatingBar view = getView(viewId);
view.setRating(rating);
return this;
}
示例8: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
@Override
public MartianViewHolder setRating(int viewId, float rating) {
RatingBar view = getView(viewId);
view.setRating(rating);
return this;
}
示例9: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
/**
* Sets the rating (the number of stars filled) and max of a RatingBar.
*
* @param viewId The view id.
* @param rating The rating.
* @param max The range of the RatingBar to 0...max.
* @return The BaseViewHolder for chaining.
*/
public BaseViewHolder setRating(int viewId, float rating, int max) {
RatingBar view = getView(viewId);
view.setMax(max);
view.setRating(rating);
return this;
}
示例10: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
/**
* Sets the rating (the number of stars filled) and max of a RatingBar.
*
* @param viewId The view id.
* @param rating The rating.
* @param max The range of the RatingBar to 0...max.
* @return The void for chaining.
*/
public void setRating(int viewId, float rating, int max) {
RatingBar view = retrieveView(viewId);
view.setMax(max);
view.setRating(rating);
}
示例11: setRating
import android.widget.RatingBar; //导入方法依赖的package包/类
/**
* Sets the rating (the number of stars filled) and max of a RatingBar.
*
* @param viewId The view id.
* @param rating The rating.
* @param max The range of the RatingBar to 0...max.
* @return The BaseViewHolder for chaining.
*/
public BaseViewHolder setRating(@IdRes int viewId, float rating, int max) {
RatingBar view = getView(viewId);
view.setMax(max);
view.setRating(rating);
return this;
}