AndRatingBar
A RatingBar library for android, you can customize size ,color ,spacing and image easily!Support right to left。效果可以参看:https://juejin.im/post/6844904143220391949
Install / Use
/learn @wdsqjq/AndRatingBarREADME
AndRatingBar
A RatingBar library for android, you can customize size, spacing, color and image easily, and support right to left.
安卓RatingBar终极方案,继承自原生RatingBar,具有原生的滑动选择等特性,并且可以自定义大小,间距,颜色,图标,支持从右到左
Customize Size

Customize Spacing

Customize Color & Image

Right to Left Support

In RecyclerView

Implementation
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.wdsqjq:AndRatingBar:1.0.6'
}
Usage
In your layout file:
<per.wsj.library.AndRatingBar
android:layout_width="wrap_content"
android:layout_height="48dp"
app:starDrawable="@drawable/star_blue"
app:bgDrawable="@drawable/star_gray"
android:rating="2.5"/>
Event Listener:
ratingBar.setOnRatingChangeListener { ratingBar, rating, fromUser ->
Log.e("ratingBar", "rating:$rating -- fromUser: $fromUser")
}
Configuration
AndRatingBar Inherit from Android RatingBar,so all the configuration of RatingBar can be
configured to AndRatingBar,for example:
android:rating="1"set the rating of RatingBarandroid:numStars="8"set the number of starandroid:layout_height="36dp"set the size of starandroid:stepSize="0.5"set the step size of RatingBarandroid:isIndicator="true"set if as indicator
AndRatingBar has it's own configuration as follows:
app:starDrawable=""set the drawable of starapp:bgDrawable=""set the background drawable of starapp:starColor=""set the color of starapp:subStarColor=""set the subColor of starapp:bgColor=""set the background color of starapp:keepOriginColor=""set if keep the origin color of star drawableapp:starSpacing="4dp"set the spacing of the starapp:scaleFactor="1.2"the sacle factor of the ratingbar which can change the spacing of the star- app:right2Left="true" right to left support
License
AndRatingBar is released under the Apache License version 2.0.
Related Skills
openhue
351.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
351.4kElevenLabs text-to-speech with mac-style say UX.
weather
351.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.6kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
