Skip to content

Latest commit

 

History

History
75 lines (59 loc) · 1.99 KB

README.md

File metadata and controls

75 lines (59 loc) · 1.99 KB

SmileyRatingBar

Download License Build Status

Smiley Rating Bar for Android

Download

Maven:

<dependency>
    <groupId>com.rating.smileyratingbar</groupId>
    <artifactId>smileyratingbar</artifactId>
    <version>1.0.3</version>
    <type>pom</type>
</dependency>

or Gradle:

implementation 'com.rating.smileyratingbar:smileyratingbar:1.0.3'

Usage

<com.rating.smileyratingbar.SmileyRatingBar
    android:id="@+id/smiley_rating"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:layout_gravity="center"
    android:gravity="center" />

To set Name for emoji

smiley_rating?.setNameForEmoji(SmileyRatingBar.Rating.GOOD, "good")

To set Typeface for text

smiley_rating?.setTypeface(Typeface.SERIF)

To get rating for the emoji

smiley_rating?.getRating()

To listen to rating change

smiley_rating?.setRatingSelectListener(this)

There is an example which shows the usage

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.