trafi/rating-seek-bar


Swipeable NPS rating input widget for Android

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.trafi:RatingSeekBar:0.4-alpha'
	}
	dependencies {
		implementation("com.github.trafi:RatingSeekBar:0.4-alpha")
	}
	<dependency>
	    <groupId>com.github.trafi</groupId>
	    <artifactId>RatingSeekBar</artifactId>
	    <version>0.4-alpha</version>
	</dependency>

                            
    libraryDependencies += "com.github.trafi" % "RatingSeekBar" % "0.4-alpha"
        
        

                            
    :dependencies [[com.github.trafi/RatingSeekBar "0.4-alpha"]]
        
        

Readme


RatingSeekBar

Sample GIF

Custom view for Net Promoter Score (NPS) or other score-based rating input on Android. Looking for iOS?

Usage

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

Installation

// top-level build.gradle
allprojects {
    repositories {
        // ..
        maven { url 'https://jitpack.io' }
    }
}

// module build.gradle
dependencies {
    // ..
    implementation 'com.trafi:rating-seek-bar:0.4-alpha'
}

Advanced usage

<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" />