Custom view for Net Promoter Score (NPS) or other score-based rating input on Android. Looking for iOS?
<com.trafi.ratingseekbar.RatingSeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:rsb_max="10" />
seek_bar.setOnSeekBarChangeListener { view, rating ->
// use rating
}
Or try out the included sample.
// top-level build.gradle
allprojects {
repositories {
// ..
maven { url 'https://jitpack.io' }
}
}
// module build.gradle
dependencies {
// ..
implementation 'com.trafi:rating-seek-bar:0.4-alpha'
}
<com.trafi.ratingseekbar.RatingSeekBar
android:id="@+id/seek_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:rsb_max="10"
app:rsb_active_color="#1F757B"
app:rsb_active_text_color="#FFFFFF"
app:rsb_inactive_color="#FAF8FA"
app:rsb_inactive_text_color="#110711"
app:rsb_text_size="14sp" />