EasyRatingView

A rating view which can be added spacing between stars.

Usage

<com.aids61517.easyratingview.EasyRatingView
  android:id="@+id/ratingView"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:gravity="center"
  app:emptyDrawable="@drawable/ic_review_empty_small"
  app:fullDrawable="@drawable/ic_review_full_small"
  app:numStars="5"
  app:rating="2.8"
  app:spacing="10dp"
  app:step="0.5" />

result is

61178895-10129000-a62a-11e9-813e-f85a6bf9821f

required attributes

app:emptyDrawable 
app:fullDrawable 

optional attributes

app:numStars, default value is 5
app:step, default value is 0.5 
app:maxRating, default value equals numStars 
app:rating
app:spacing
app:verticalSpacing, works when horizontal spacing is not enought
android:gravity, default value is start|top

also you can new one programmatically

EasyRatingView(context).apply {
  emptyDrawableResourceId = //your empty drawable id like R.drawable.ic_review_empty
  fullDrawableResourceId = //your full drawable id like R.drawable.ic_review_full
  rating = 3f
  maxRating = 4f
  spacing = //value in px
}

Download

Add the JitPack repository to the build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the Gradle dependency:

implementation 'com.github.aids61517:EasyRatingView:1.1.0'

GitHub