Comments (12)
You can (in a kinda hacky way), but I wouldn't recommend doing so, because it is against the Material Design guidelines and I didn't intend to support other designs during implementation.
You can do so via the resource-overriding trick, by placing a resource with the same name as the one that a library uses, and it will replace the library one during the build process. To be specific, you can place mrb_star_border_icon_black_36dp.xml
and mrb_star_icon_black_36dp.xml
in your res
directory and it will replace the stars.
from materialratingbar.
@DreaminginCodeZH thanks a lot
from materialratingbar.
It would be nice to have the option to use completely filled stars when using them as indicators. Compare with Google Play where bordered stars are used where the user can interact with the rating bar and filled stars are used where the user can't.
from materialratingbar.
@Qw4z1 Maybe you can use the appcompat version in this case
from materialratingbar.
i replace the icons but it didn't work for me.
from materialratingbar.
mrb_star_border_icon_black_36dp.xml and mrb_star_icon_black_36dp.xml
Do I need to create those files for every api / screen density like in your library?
In your library files are xml and png. Which ones do I need?
Just placing 2 xml files in res/drawable doesn't work.
from materialratingbar.
yes, I added a vector and add "override = true" and it works.
from materialratingbar.
@devabir93 placed override="true" into vector tag and it doesn't work :/
from materialratingbar.
@zhanghai I added both icons in res/drawable
but it's not working.
@heiyeliuying @devabir93 can you help me with this
from materialratingbar.
@shubham696
I switched to regular RatingBar.
Just set this in RatingBar's attributes in xml:
android:progressDrawable="@drawable/rating_stars"
and put this in drawables:
<?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/star_50" />
<item
android:id="@android:id/secondaryProgress"
android:drawable="@drawable/star_50" />
<item
android:id="@android:id/progress"
android:drawable="@drawable/star_100" />
</layer-list>
star_50 means 50% opacity of a star drawable
from materialratingbar.
@shubham696
I switched to regular RatingBar.
Just set this in RatingBar's attributes in xml:
android:progressDrawable="@drawable/rating_stars"
and put this in drawables:
<?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/star_50" /> <item android:id="@android:id/secondaryProgress" android:drawable="@drawable/star_50" /> <item android:id="@android:id/progress" android:drawable="@drawable/star_100" /> </layer-list>
star_50 means 50% opacity of a star drawable
@s7aycool Thank you for the reply. But regular rating bar doesn't support the match parent attribute.
Due to this I have to use this one only
from materialratingbar.
@zhanghai I added both icons in res/drawable but it's not working. @heiyeliuying @devabir93 can you help me with this
you need to put the new icons in drawable-anydpi-v21 and it will work
from materialratingbar.
Related Issues (20)
- When isIndicator="true" no more floating values HOT 1
- stepSize=0.1 rating=0.1不显示,这属于bug嘛? HOT 2
- Fill Stars Background if isIndicator=true HOT 5
- Widget.MaterialRatingBar.RatingBar.Small doesn't make the star icon smaller HOT 2
- Crash on Android 10 & Samsung HOT 3
- Migrate to androidx HOT 1
- 1.4.0 artifact not aavilable HOT 1
- In Android 10 not working HOT 12
- Error inflating MaterialRatingBar on Android 10 HOT 1
- Is there any way I can set the stars/rating back to zero?
- Crash on Android 10 HOT 1
- Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. HOT 1
- App is Crashing on Android 10 Samsung devices HOT 2
- Couldn't fully drag to remove rating HOT 5
- Question about setOnRatingChangeListener HOT 1
- half star is not showing correctly when isIndicator is true HOT 4
- If we click between the two stars, both star will get clicked HOT 8
- MaterialRatingDrawable Crash HOT 15
- how to disable the ontouch event ? HOT 1
- Verification failed on class me.zhanghai.android.materialratingbar.ClipDrawableCompat
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialratingbar.