本文整理汇总了Java中android.widget.RatingBar.setIsIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java RatingBar.setIsIndicator方法的具体用法?Java RatingBar.setIsIndicator怎么用?Java RatingBar.setIsIndicator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RatingBar
的用法示例。
在下文中一共展示了RatingBar.setIsIndicator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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"));
}
示例2: collectLocationsAndPutOnMap
import android.widget.RatingBar; //导入方法依赖的package包/类
private void collectLocationsAndPutOnMap(Map<String, Object> servings, View v) {
ratingBar = (RatingBar) v.findViewById(R.id.indicatorRatingBar);
//iterate through each user, ignoring their UID
for (Map.Entry<String, Object> entry : servings.entrySet()) {
//Get user map
singleUser = (Map) entry.getValue();
//Get phone field and append to list
numbers.add((String) singleUser.get("rating"));
}
for( int i= 0; i < numbers.size(); i++ ) {
number = Float.parseFloat(numbers.get(i));
num = num + number;
}
num= num/numbers.size();
ratingBar.setRating(num);
ratingBar.invalidate();
ratingBar.setIsIndicator(true);
num = 0f;
}