1)
<RatingBar
android:id="@+id/ratingBarComment"
Style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="@dimen/val_15"
android:layout_gravity="left|center"
android:layout_marginLeft="@dimen/val_10"
android:isIndicator="true"
android:progressDrawable="@drawable/custom_rating_bar" />
<RatingBar
android:id="@+id/ratingBarComment"
Style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="@dimen/val_15"
android:layout_gravity="left|center"
android:layout_marginLeft="@dimen/val_10"
android:isIndicator="true"
android:progressDrawable="@drawable/custom_rating_bar" />
2)
private RatingBar rating, ratingBarComment;
rating.setRating(Float.parseFloat(alstDealsDetail.get(0).getRate()));
ratingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
@Override
public void onRatingChanged(RatingBar ratingBar, float rating, boolean b) {
int intRating = Math.round(rating);
strRating = String.valueOf(intRating);
// Toast.makeText(getApplicationContext(),"Ratings : " + String.valueOf(rating),Toast.LENGTH_LONG).show();
}
});
3)
if (rating > 0.0) {
ratingBar.setRating(rating);
ratingLLTitle.setVisibility(View.VISIBLE);
onRatingLlClicked();
}
} else {
ratingBar.setRating(0);
}
if (rating > 0.0) {
ratingBar.setRating(rating);
ratingLLTitle.setVisibility(View.VISIBLE);
onRatingLlClicked();
}
} else {
ratingBar.setRating(0);
}
No comments:
Post a Comment