use of android.widget.RatingBar in project AndroidChromium by JackyAndroid.
the class InfoBarControlLayout method addRatingBar.
/**
* Creates and adds a control that shows a review rating score.
*
* @param rating Fractional rating out of 5 stars.
*/
public View addRatingBar(float rating) {
View ratingLayout = LayoutInflater.from(getContext()).inflate(R.layout.infobar_control_rating, this, false);
addView(ratingLayout, new ControlLayoutParams());
RatingBar ratingView = (RatingBar) ratingLayout.findViewById(R.id.control_rating);
ratingView.setRating(rating);
return ratingView;
}
use of android.widget.RatingBar in project collect by opendatakit.
the class FieldListUpdateTest method setRating.
public static ViewAction setRating(final float rating) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return ViewMatchers.isAssignableFrom(RatingBar.class);
}
@Override
public String getDescription() {
return "Custom view action to set rating on RatingBar";
}
@Override
public void perform(UiController uiController, View view) {
RatingBar ratingBar = (RatingBar) view;
ratingBar.setRating(rating);
}
};
}
use of android.widget.RatingBar in project YalpStore by yeriomin.
the class Review method initUserReviewControls.
private void initUserReviewControls(final App app) {
((RatingBar) activity.findViewById(R.id.user_stars)).setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
@Override
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
if (!fromUser) {
return;
}
new UserReviewDialogBuilder(activity, Review.this, app.getPackageName()).show(getUpdatedUserReview(app.getUserReview(), (int) rating));
}
});
activity.findViewById(R.id.user_review_edit).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new UserReviewDialogBuilder(activity, Review.this, app.getPackageName()).show(app.getUserReview());
}
});
activity.findViewById(R.id.user_review_delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ReviewDeleteTask task = new ReviewDeleteTask();
task.setFragment(Review.this);
task.setContext(v.getContext());
task.execute(app.getPackageName());
}
});
}
use of android.widget.RatingBar in project cardslib by gabrielemariotti.
the class GplayCardCustomSource method setupInnerViewElements.
@Override
public void setupInnerViewElements(ViewGroup parent, View view) {
TextView title = (TextView) view.findViewById(R.id.carddemo_gplay_main_inner_title);
title.setText("FREE");
TextView subtitle = (TextView) view.findViewById(R.id.carddemo_gplay_main_inner_subtitle);
subtitle.setText("Very popular with...");
RatingBar mRatingBar = (RatingBar) parent.findViewById(R.id.carddemo_gplay_main_inner_ratingBar);
mRatingBar.setNumStars(5);
mRatingBar.setMax(5);
mRatingBar.setStepSize(0.5f);
mRatingBar.setRating(4.7f);
}
use of android.widget.RatingBar in project cardslib by gabrielemariotti.
the class GplayCard method setupInnerViewElements.
@Override
public void setupInnerViewElements(ViewGroup parent, View view) {
TextView title = (TextView) view.findViewById(R.id.carddemo_gplay_main_inner_title);
title.setText("FREE");
TextView subtitle = (TextView) view.findViewById(R.id.carddemo_gplay_main_inner_subtitle);
subtitle.setText("Very popular with...");
RatingBar mRatingBar = (RatingBar) parent.findViewById(R.id.carddemo_gplay_main_inner_ratingBar);
mRatingBar.setNumStars(5);
mRatingBar.setMax(5);
mRatingBar.setStepSize(0.5f);
mRatingBar.setRating(4.7f);
}
Aggregations