ratingbar

Small Style Custom rating bar (readonly custom rating bar)

时间秒杀一切 提交于 2020-01-04 12:43:24
问题 I tried to create a custom rating bar. I don't use style because I only use this once. So, I created a layer-list in the drawable folder (its name is custom_rating_bar.xml ): <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/custom_icon_empty"/> <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/custom_icon_empty"/> <item android:id="@android:id/progress" android:drawable="

Small Style Custom rating bar (readonly custom rating bar)

倾然丶 夕夏残阳落幕 提交于 2020-01-04 12:43:12
问题 I tried to create a custom rating bar. I don't use style because I only use this once. So, I created a layer-list in the drawable folder (its name is custom_rating_bar.xml ): <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/custom_icon_empty"/> <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/custom_icon_empty"/> <item android:id="@android:id/progress" android:drawable="

How to set rating bar to minimum one star?

此生再无相见时 提交于 2020-01-03 07:27:08
问题 I have a requirement to rate for a user with minimum of one star and after that ratings should increase to 0.5. But my question is that the user should not change the minimum rating of star to 0.5 or 0. 1 should be the default rating. Please help with this and awaiting for your earlier response. I also tried implementing by listeners from the link but completely struct with the logic inside My code is: ratingBar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { @Override public

How to change the star images of the RatingBar?

只谈情不闲聊 提交于 2019-12-28 03:35:06
问题 With Android SDK 1.1 r1 , is there any way to change the RatingBar widget class's star image with my own? Is this possible at all? If so, then how? Thanks. 回答1: The short answer is it looks like it's techincally possible. The easiest way would be to create your own RatingBar based on the RatingBar sourcecode (more elegant would be to extend the orignal RatingBar into your own). From there you would also need to create your own RatingBar style using the original RatingBar source xml as an

Android RatingBar onRatingChanged doesn't get called

走远了吗. 提交于 2019-12-25 08:48:32
问题 In my Android app I've got a Fragment showing a RatingBar, which has a onRatingChanged listener that is not responding to ratingbar changes. So here's my code: rating_fragment.xml <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rating_fragment" android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout

RatingBar android - custom draw runtime

瘦欲@ 提交于 2019-12-25 04:33:13
问题 I have ratingbar shown in a list. As people rate the items from 1 to 4 stars - the ratingbar should change either color of the stars or the background or overlay or something to symbolize the change (customer requirement in an organisation that's used to use colors to identify state, e.g. green = good) I was thinking that changing the color of the stars would saisfy this. However, most of the solutions to this revolve around changing the default graphic used in the raing bar, and not how to

Can't change the size of custom RatingBar

情到浓时终转凉″ 提交于 2019-12-22 18:59:06
问题 I am trying to make custom RatingBar for my android app in which i can change the default size and color of RatingBar. For this purpose i have written styles for CustomRatingBar like this: <style name="CustomRatingBar" parent="@android:style/Widget.RatingBar"> <item name="android:progressDrawable">@drawable/custom_ratingbar</item> <item name="android:minHeight">25dp</item> <item name="android:maxHeight">25dp</item> </style> But the size is not changed rather it shrinks the rating bar like

When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5

旧城冷巷雨未停 提交于 2019-12-18 14:52:21
问题 I've looked up a number of posts (e.g. Android RatingBar change star colors, Change the color of the stars in the rating bar where the rating bar is created dynamically in android, How can I set the star color of the ratingbar?) in order to change the colours of the stars in the RatingBar. I followed the posts and was able to change the stars for the custom RatingBar, but in doing this I was no longer able to set the value to be a decimal lower than a half (e.g. 0.2). It would always show up

When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5

安稳与你 提交于 2019-12-18 14:51:40
问题 I've looked up a number of posts (e.g. Android RatingBar change star colors, Change the color of the stars in the rating bar where the rating bar is created dynamically in android, How can I set the star color of the ratingbar?) in order to change the colours of the stars in the RatingBar. I followed the posts and was able to change the stars for the custom RatingBar, but in doing this I was no longer able to set the value to be a decimal lower than a half (e.g. 0.2). It would always show up

Android RatingBar doesn't accept float values

﹥>﹥吖頭↗ 提交于 2019-12-18 09:01:02
问题 I have an android rating bar in my app, and it only displays int ratings. For example: float ratingValue = 1.5f; myRatingBar.setRating(ratingValue); and the ratingbar displays 2 full stars. How can I make it display one and a half stars, or two and a half? 回答1: try to use float ratingValue = 1.5f; myRatingBar.setRating(ratingValue); // to set rating value myRatingBar.setStepSize(ratingValue);// to show to stars public void setStepSize (float stepSize) Sets the step size (granularity) of this