ratingbar

How to reduce the space around rating bar in android

痞子三分冷 提交于 2019-11-28 11:52:15
问题 I have included a rating bar in android, and now I need to place a text view to immediate right if the rating bar.But I failed to do the same since, there is a lot of unwanted space (rectangular blue box) around the rating bar, which prevents me from placing the textview to its immediate right side. Is there any way to reduce this space around the rating bar , so that both the textview and the rating bar comes in same line and textview is placed next to the rating bar without a gap.Please

Android: Change color of ratingbar to golden

牧云@^-^@ 提交于 2019-11-28 04:40:15
I want to change color of rating bar to golden. I dont want to customize the stars, i just want to change the color for API 16 or above I have tried following solutions but none of them worked out for me 1. RatingBar ratingBar = (RatingBar) findViewById(R.id.ratingBar); LayerDrawable stars = (LayerDrawable) ratingBar.getProgressDrawable(); stars.getDrawable(2).setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP); 2. android:progressDrawable="@color/golden" in XML theblitz This option is now included in the AppCompat library. The AppCompat version of the RatingBar is used automatically. http:

How can I set the color of android rating bar's stroke? (Not the color of the stars but the BORDER)

浪子不回头ぞ 提交于 2019-11-27 13:32:45
问题 I am an android beginner and I want to make my custom ratingBar. Disclaimer: it's not a duplicate. because all the posts I have read asks about how to change colors of the star and how to remove the stroke. That is NOT what I want. I want to have the stroke and to be able to change the color of the border. With a transparent and yellow stroke while empty, and yellow background and stroke for half and filled. I do NOT want to use pngs. I have my own already but they are too small. I just dont

How to change the star images of the RatingBar?

北慕城南 提交于 2019-11-27 11:41:37
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. 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 example (or inheriting and extending the original RatingBar style). Source is available wtih git at developer

rating bar becomes to large and is cut-off when adding custom images in android

久未见 提交于 2019-11-27 08:50:24
问题 I followed an answer on stack overflow to adding a custom rating bar to an android project, here it is: https://stackoverflow.com/a/32828726/5909396 Just in case I am posting my code. First I created ratingBar.xml in drawable folder: <?xml version="1.0" encoding="UTF-8" ?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/ratingbar_empty" /> <item android:id="@android:id/secondaryProgress" android

Android: Change color of ratingbar to golden

假如想象 提交于 2019-11-27 05:21:28
问题 I want to change color of rating bar to golden. I dont want to customize the stars, i just want to change the color for API 16 or above I have tried following solutions but none of them worked out for me 1. RatingBar ratingBar = (RatingBar) findViewById(R.id.ratingBar); LayerDrawable stars = (LayerDrawable) ratingBar.getProgressDrawable(); stars.getDrawable(2).setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP); 2. android:progressDrawable="@color/golden" in XML 回答1: This option is now

Constructing a RatingBar using images loaded from the web

荒凉一梦 提交于 2019-11-27 02:17:24
问题 I have a form which I'm dynamically generating from data I receive from a web service. This web service provides images which need to be used in the creation of input elements. I'm having difficuly in setting the progressDrawable of a RatingBar . Though XML I'm able to apply a custom image using the following as the progressDrawable : <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+android:id/background" android:drawable="@drawable/custom_star" />