Simple star rating system bars, a view similar to the ones seen on Google Playstore. ⭐🌟✨

Overview

RatingReviews


Android Arsenal

RatingReviews (Rating and Reviews) is a widget and layout that adds a "Rating & Reviews" bar to your app, similar to the ones seen on Google Play Store and Apple App Store. It provides a beautiful visual summary of the number of raters along with the ratings they gave on a specific item. Of course, it is also highly customizable to fit your app themes! ⭐ 🌟 ✨

Screenshots

| | | | | |:---:|:---:|:---:|:---:| | playstore (style1) | appstore (style2) | playstore (new rounded) | customized (style2) |

gradient (rounded) gradient playstore (old)

All of these samples can be found in app

You can also:

  • Take an existing style and customise it to be your desired style.
  • Add gradient colors to the bar and add an array of pairs to the colors parameter in your code. See the sample for more details.

Installation

Make sure your project is migrated to AndroidX.

In your root build.gradle at the end of repositories:

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

In your app build.gradle:

implementation 'com.github.Inconnu08:android-ratingreviews:1.2.0'

Usage

Using RatingReviews is simple. Here is an example:

java

        RatingReviews ratingReviews = (RatingReviews) findViewById(R.id.rating_reviews);

        int colors[] = new int[]{
                Color.parseColor("#0e9d58"),
                Color.parseColor("#bfd047"),
                Color.parseColor("#ffc105"),
                Color.parseColor("#ef7e14"),
                Color.parseColor("#d36259")};

        int raters[] = new int[]{
                new Random().nextInt(100),
                new Random().nextInt(100),
                new Random().nextInt(100),
                new Random().nextInt(100),
                new Random().nextInt(100)
        };

        ratingReviews.createRatingBars(100, BarLabels.STYPE1, colors, raters);

xml

    <com.taufiqrahman.reviewratings.RatingReviews
        xmlns:bar="http://schemas.android.com/apk/res-auto"
        android:id="@+id/rating_reviews"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="42dp"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/textView"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.499"
        bar:animation="true"
        bar:max_value="100"
        bar:show_label="true"
        bar:spaces="0dp"
        bar:text_color="#333333"
        bar:text_size="10sp"
        bar:width="15dp" />

Specification

The table below shows the parameters and the attributes for furthur customization:

Attribute Description Options (examples)
animation of the bars from left to right true, false
show_label of the bars for example: 1, 2, 3, 4, 5 STYPE1, STYPE2, STYPE3, STYPE4
max_value max value for the ratings 100 etc
text_color color of the texts for example the labels color int
text_size text size of labels 10sp, 12sp etc
width bar width 8dp, 15dp etc
spaces space between bars 1sp, 2dp etc
rounded round corners of bars true, false

Contribution

Want to contribute? Fantastic!

If you want to contribute to the project and make it better (whether it's a bug fix, feature, improvement, suggestion, documentation or any sort of help), your help is very welcomed! ❀

Todos

  • Optimization

Check issues

Motivation

There was no visual 5 star rating system when I needed it for a project. Special thanks to the chart libraries where I took some inspiration from.

License

   Copyright (C) 2019 Taufiq Rahman
   Copyright (C) 2018 Android Open Source Project

   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.
Built with ❀︎ by Taufiq Rahman and contributors
Comments
  • Set max value based on the greatest rater

    Set max value based on the greatest rater

    First of all, I just wanted to say that I have never used a library and it work so perfectly and flawlessly on my first attempt at implementing it. For that, bless you sir.

    I do have a feature request. The ratings count data that I receive always varies and can be from as low as 50 ratings to as high as a couple of thousand. It would be cool to have a way to allow the max value to be based on the greatest number among the raters instead of just setting to a specific value.

    Thank you again for hard work.

    opened by NaturallyAsh 2
  • edited README.md for clarity and grammar

    edited README.md for clarity and grammar

    Description

    Hi! I was one of the students from the class where we had to edit README files for an assignment. I went ahead and edited yours if that's okay. I found some grammatical errors and fixed those. Other than that, I changed a couple of words in sentences to make them flow nicer or to make them more clear. If I altered the original meaning of a sentence somehow, please let me know and I'll fix it!

    Please approve this PR by Friday night because that's when my assignment is due. Thanks so much!

    opened by cindyhyl 1
  • Added gradient rating and rounded gradient.

    Added gradient rating and rounded gradient.

    Description

    Added gradient rating bars for normal and for rounded rating bars.

    Fixes

    #4

    Type of change

    • [x] New feature (non-breaking change which adds functionality)
    • [x] This change requires a documentation update
    lgtm 
    opened by adriancoman 1
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    Beep boop. Your images are optimized!

    Your image file size has been reduced by 13% πŸŽ‰

    Details

    | File | Before | After | Percent reduction | |:--|:--|:--|:--| | /screenshots/0.png | 20.99kb | 17.36kb | 17.31% | | /screenshots/8.png | 31.36kb | 26.32kb | 16.08% | | /screenshots/3.png | 10.74kb | 9.02kb | 15.98% | | /screenshots/5.png | 20.69kb | 17.40kb | 15.91% | | /screenshots/2.png | 10.82kb | 9.14kb | 15.50% | | /screenshots/1.png | 10.44kb | 8.97kb | 14.04% | | /screenshots/6.png | 20.93kb | 18.67kb | 10.82% | | /screenshots/7.png | 21.69kb | 19.93kb | 8.10% | | /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | 8.91kb | 8.89kb | 0.28% | | | | | | | Total : | 156.57kb | 135.70kb | 13.33% |


    Black Lives Matter | πŸ’° donate | πŸŽ“ learn | ✍🏾 sign

    πŸ“ docs | :octocat: repo | πŸ™‹πŸΎ issues | πŸ… swag | πŸͺ marketplace

    opened by imgbot[bot] 0
  • Feature: Add rounded bars

    Feature: Add rounded bars

    rounded bar

    • Add rounded rating bars.

    • This should be an optional feature.

    In the XML there should be a boolean attribute like this: bar:rounded Or : bar:radius Where you can specify the radius in positive numbers

    enhancement Feature 
    opened by Inconnu08 0
  • No support for android API 31 or higher.

    No support for android API 31 or higher.

    As per project requirement need to upgrade the android compiled version to 32 and afterward once the sync and build process initiate facing the issue like Could not find com.github.Inconnu08:android-ratingreviews:1.2.0.

    To Reproduce Steps to reproduce the behavior:

    1. With old compiled version just upgrade to 32. Sync of the project no problem but once the project build initiate problem arise. Expected behavior Must be supporting the android compiled version 32.

    Screenshots

    Smartphone (please complete the following information):

    • Android Studio version (chipmunks)
    • Compiled version 32
    • Target version 32

    Additional context Add any other context about the problem here. image

    opened by Gkundu1 0
  • flutter-ratingreviews

    flutter-ratingreviews

    Do you have any solution in Flutter for the same ratingreviews? I can use this library for a flutter plugin but this will only work for android. Please suggest me some solution Thanks

    opened by Softkeydel 0
  • Label's attributes

    Label's attributes

    It would be nice to have control over label's TextView attributes in RatingReviews's class and xml tags like the ones below:

    android:fontFamily="@font/..."
    android:textStyle="bold|italic|normal"
    android:paddingEnd=...
    
    opened by ElyDantas 0
  • Autosizing TextViews for labels

    Autosizing TextViews for labels

    Autosizing TextViews

    With Android 8.0 (API level 26) and higher, you can instruct a TextView to let the text size expand or contract automatically to fill its layout based on the TextView's characteristics and boundaries. This setting makes it easier to optimize the text size on different screens with dynamic content.

    The Support Library 26.0 provides full support to the autosizing TextView feature on devices running Android versions prior to Android 8.0 (API level 26). The library provides support to Android 4.0 (API level 14) and higher. The android.support.v4.widget package contains the TextViewCompat class to access features in a backward-compatible fashion.

    To define the default setting in XML through the support library, use the app namespace and set the autoSizeTextType attribute to none or uniform.

    Making every TextView label align to it's rating bar's top and bottom and using AutoSizeText attributes we can make it not only backwards compatible but auto resizable, without the need to set some static value for bar:text_size:

    <TextView
        android:id="@+id/label"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignTop="@+id/bar"
        android:layout_alignBottom="@+id/bar"
        app:autoSizeTextType="uniform"
        app:autoSizeMinTextSize="1sp"
        app:autoSizeMaxTextSize="112sp"
        app:autoSizeStepGranularity="1sp" />
    

    Preventing a behaviour like this:

    ratingBar

    opened by ElyDantas 0
  • Bar background color

    Bar background color

    This is Playstore's rating bar with gray background bar and green coloured bars on top of it: playstore

    Should be nice to have the same feature to enable/disable and set background bar color as well: example

    opened by ElyDantas 0
Releases(1.2.0)
Owner
Taufiq Rahman
Often seen GOing or FLUTTERing, sometimes slithering like a PYTHON.
Taufiq Rahman
Charting library for Android applications. Automatically exported from code.google.com/p/achartengine

achartengine Charting library for Android applications. Automatically exported from code.google.com/p/achartengine AChartEngine is a charting library

Dan Dromereschi 739 Nov 18, 2022
Arc Chart View (Draw Creative Statistic Arc Charts)

ArcChartViewDemo You can use this library to draw Arc charts and show your statistics or anything you want or maybe get some ratings from user. you ca

Iman khoshabi 106 Nov 22, 2022
TChart - Simple and fast charts.

TChart - Simple and fast charts.

null 30 Sep 20, 2022
Simple Jetpack Compose Charts for multi-platform. Including Android, Web, Desktop.

compose-charts Simple Jetpack Compose Charts for multi-platform. Including Android, Web, Desktop. Graph Effects How to use? 1, show Pie Chart in Jetpa

Chen Pan 107 Nov 6, 2022
Simple Line, Circle, Bar chart for Android

SimpleChart Simple Line, Circle, Bar chart for Android LineChart <com.aghajari.simplechart.LineChart android:id="@+id/line_chart" android:layo

AmirHosseinAghajari 5 Jul 28, 2022
Jetpack-linear-chart - A simple way to draw linear chart using Jetpack Compose

jetpack-linear-chart A simple way to draw linear chart using Jetpack Compose We

Bruno Gabriel dos Santos 7 Sep 4, 2022
Simple Compose Charts for multi-platform. Including Android, Web, Desktop.

compose-charts-desktop Simple Compose Charts for multi-platform. Including Android, Web, Desktop. Compose multiplatform for Android: compose-charts. G

Chen Pan 11 Nov 4, 2022
An open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use

android-compose-charts This is an open source library used to draw charts in Android with Jetpack Compose with a simple and easy to use. Just couples

Mahmoud Ibrahim 16 Sep 23, 2022
SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.

Smiley Rating SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon. Drawn completely using android canvas Insp

Sujith Niraikulathan 1.1k Nov 22, 2022
A rating toggle for Android which switches between 3 rating levels: positive, neutral, and negative.

SimpleRatingView A rating toggle for Android which switches between 3 rating levels: positive, neutral, and negative. Usage Since, SimpleRatingView is

İhsan Işık 167 Jun 2, 2021
Aurora Store: A Google Playstore Client

Aurora Store: A Google Playstore Client Aurora Store is an unofficial, FOSS clie

null 0 Jan 31, 2022
Simple custom view that draws an n-point star for Android

StarView ?? Simple custom view that draws an n-point star for Android. Features

Paul T 8 Apr 28, 2022
An Android Toast replacement, similar to the one seen in the GMail app.

MessageBar An Android Toast replacement, similar to the one seen in the GMail app. Multiple messages can be posted in succession, and each message wil

Simon Vig Therkildsen 555 Nov 25, 2022
This app highlights similar design pattern seen in SnapChat Application.

SnapchatClone In this repo, I tried to clone SnapChat App by implementing similar design pattern seen in major destinations of the app Screenshots I w

Ibrahim 18 Sep 2, 2022
This is a practice app. An app that you can find random recipes and choose the ones you like.

A food suggestion app like Tinder This is a practice app. In this app, you can find random recipes and choose the ones you like. This is main menu. Yo

Yunus Emre OCAK 4 May 25, 2022
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Basil Miller 249 Sep 10, 2022
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Devlight 1.3k Nov 23, 2022
Present your progress bars in arc mode with information and total control.

ArcProgressStackView Present your progress bars in arc mode with information and total control. You can check the sample app here. Warn This library i

Devlight 1.3k Nov 22, 2022
Saga of Star wars - An Android sample repo showcasing Clean Arch with MVVM and Epoxy models

Star Wars Universe This is a showcase android application written in Kotlin and follows Clean Code architecture to showcase Characters from the StarWa

Adit Lal 4 Aug 30, 2022
A SeekBar suited for showing a preview of something. As seen in Google Play Movies.

PreviewSeekBar A SeekBar suited for showing a video preview. As seen in Google Play Movies Google Play Movies PreviewSeekBar's sample Build Add the fo

RΓΊben Sousa 3.3k Nov 25, 2022