Giter VIP home page Giter VIP logo

Comments (12)

zhanghai avatar zhanghai commented on September 3, 2024

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.

heiyeliuying avatar heiyeliuying commented on September 3, 2024

@DreaminginCodeZH thanks a lot

from materialratingbar.

Qw4z1 avatar Qw4z1 commented on September 3, 2024

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.

zhanghai avatar zhanghai commented on September 3, 2024

@Qw4z1 Maybe you can use the appcompat version in this case

from materialratingbar.

devabir93 avatar devabir93 commented on September 3, 2024

i replace the icons but it didn't work for me.

from materialratingbar.

 avatar commented on September 3, 2024

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.

devabir93 avatar devabir93 commented on September 3, 2024

yes, I added a vector and add "override = true" and it works.

from materialratingbar.

 avatar commented on September 3, 2024

@devabir93 placed override="true" into vector tag and it doesn't work :/

from materialratingbar.

shubham696 avatar shubham696 commented on September 3, 2024

@zhanghai I added both icons in res/drawable
but it's not working.
@heiyeliuying @devabir93 can you help me with this

from materialratingbar.

 avatar commented on September 3, 2024

@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 avatar shubham696 commented on September 3, 2024

@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.

devabir93 avatar devabir93 commented on September 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.