当前位置: 首页>>代码示例>>Java>>正文


Java RatingBar.setRating方法代码示例

本文整理汇总了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;
}
 
开发者ID:xeliot,项目名称:ChewSnap,代码行数:21,代码来源:MealAdapter.java

示例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"));
}
 
开发者ID:AnywhereSoftware,项目名称:B4A_ViewsEx,代码行数:13,代码来源:RatingBarWrapper.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ViewHolder.java

示例4: setRating

import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating)
{
    RatingBar view = getView(viewId);
    view.setRating(rating);
    return this;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:ViewHolder.java

示例5: setRating

import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolderHelper setRating(int viewId, float rating) {
    RatingBar view = getView(viewId);
    view.setRating(rating);
    return this;
}
 
开发者ID:ynztlxdeai,项目名称:MVPtemplate,代码行数:6,代码来源:ViewHolderHelper.java

示例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;
}
 
开发者ID:GuoZhaoHui628,项目名称:SliderStatusBar,代码行数:7,代码来源:ViewHolder.java

示例7: setRating

import android.widget.RatingBar; //导入方法依赖的package包/类
public ViewHolder setRating(int viewId, float rating) {
    RatingBar view = getView(viewId);
    view.setRating(rating);
    return this;
}
 
开发者ID:fashare2015,项目名称:MVVM-JueJin,代码行数:6,代码来源:ViewHolder.java

示例8: setRating

import android.widget.RatingBar; //导入方法依赖的package包/类
@Override
public MartianViewHolder setRating(int viewId, float rating) {
    RatingBar view = getView(viewId);
    view.setRating(rating);
    return this;
}
 
开发者ID:vsona,项目名称:RxJava2RetrofitDemo,代码行数:7,代码来源:MartianViewHolder.java

示例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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:BaseViewHolder.java

示例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);

}
 
开发者ID:Aarthas,项目名称:android_Json2view,代码行数:15,代码来源:AdapterHelper.java

示例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;
}
 
开发者ID:alphater,项目名称:garras,代码行数:15,代码来源:BaseViewHolder.java


注:本文中的android.widget.RatingBar.setRating方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。