Java Code Examples for android.widget.RatingBar.setIsIndicator()

The following are Jave code examples for showing how to use setIsIndicator() of the android.widget.RatingBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: B4A_ViewsEx   File: RatingBarWrapper.java   View Source Code Vote up 5 votes
@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"));
}
 
Example 2
Project: foodie   File: OrderFragment.java   View Source Code Vote up 3 votes
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;




    }