本文整理匯總了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;
}