Android RatingBar - a complete mess

前端 未结 1 1409
日久生厌
日久生厌 2021-01-01 01:41

I know this is going to sound ranty, but it just feels like Android\'s UI components and behaviours are off the wall sometimes.

Consider the following XML:



        
相关标签:
1条回答
  • 2021-01-01 02:02

    I felt the same way as you when using the stock RatingBar, so I made my own: SimpleRatingBar.

    It features:

    • Fully working android:layout_width: it can be set to wrap_content, match_parent or abritary dp.
    • Arbitrary number of stars.
    • Arbitrary step size.
    • Size of stars can be controlled exactly or by setting a maximum size.
    • Customizable colors (border, fill and background of stars).
    • Customizable size separation between stars.
    • Customizable border width of stars.
    • Allows to set OnRatingBarChangeListener
    • Stars fill can be set to start from left to right or from right to left (RTL language support).
    • AnimationBuilder integrated in the view to set rating programatically with animation.

    Here is a preview of it.

    You can find it either in jcenter or in Maven Central. So in your build.gradle file just add to your dependencies:

    compile 'com.iarcuschin:simpleratingbar:0.1.+'

    I hope it's useful.

    0 讨论(0)
提交回复
热议问题