This library allows to use customized Rating Dialog inside applications.
Clone or download

Android Material App Rating Build Status Android ArsenalAwesome Android

This library allows to use customized Rating Dialog inside applications.


compile 'com.stepstone.apprating:app-rating:2.3.0'

Supported features

  • custom styles for dialog's background, stars, title, description, hint
  • custom rating scope (number of stars)
  • note descriptions below rating bar, which describes each note
  • defining custom dialog's title, description and hint
  • defining text for positive, negative and neutral button
  • enter/exit window animation

Using different app themes


Getting started

Browse samples

There are few samples of rating dialog usage. Please refer to SamplesActivity in samples module. There are also two gradle flavors for sample app which can switched to see dialog in different themes, styles.

Prepare styling for dialog

Styling app rating dialog works in the same way like styling standard android's AlertDialog. Just need to define own style for your dialog.

<?xml version="1.0" encoding="utf-8"?>

    <!-- Dialog -->
    <style name="MyAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
        <item name="android:background">@color/backgroundColor</item>
        <item name="buttonBarPositiveButtonStyle">@style/MyAlertDialogButtonStyle</item>
        <item name="buttonBarNegativeButtonStyle">@style/MyAlertDialogButtonStyle</item>
        <item name="buttonBarNeutralButtonStyle">@style/MyAlertDialogButtonStyle</item>

    <style name="MyAlertDialogButtonStyle" parent="@style/Widget.AppCompat.Button.ButtonBar.AlertDialog">
        <item name="android:textColor">@color/colorAccent</item>
        <item name="android:textSize">@dimen/text_size_medium</item>

    <style name="MyDialogFadeAnimation">
        <item name="android:windowEnterAnimation">@android:anim/fade_in</item>
        <item name="android:windowExitAnimation">@android:anim/fade_out</item>


And assign this style to the theme.

<?xml version="1.0" encoding="utf-8"?>

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

        <!-- Assign dialog style here. -->
        <item name="alertDialogTheme">@style/MyAlertDialogStyle</item>
        <item name="alertDialogStyle">@style/MyAlertDialogStyle</item>

        <!-- Assign custom text styles for title, description, comment -->
        <item name="appRatingDialogTitleStyle">@style/MyDialogTitleStyle</item>
        <item name="appRatingDialogDescriptionStyle">@style/MyDialogDescriptionStyle</item>
        <item name="appRatingDialogNoteDescriptionStyle">@style/MyDialogNoteDescriptionStyle</item>
        <item name="appRatingDialogCommentStyle">@style/MyDialogCommentStyle</item>


Setup and create dialog

This code need to be invoked inside FragmentActivity. Activity MUST implement RatingDialogListener ! Otherwise an exception will be thrown.

private void showDialog() {
        new AppRatingDialog.Builder()
                .setNoteDescriptions(Arrays.asList("Very Bad", "Not good", "Quite ok", "Very Good", "Excellent !!!"))
                .setTitle("Rate this application")
                .setDescription("Please select some stars and give your feedback")
                .setDefaultComment("This app is pretty cool !")
                .setHint("Please write your comment here ...")
                .setTargetFragment(this, TAG) // only if listener is implemented by fragment

Getting results

Rating and comments can be fetched by listener implemented by activity.

class MyActivity implements RatingDialogListener {

        public void onPositiveButtonClicked(int rate, String comment) {
            // interpret results, send it to analytics etc...

        public void onNegativeButtonClicked() {

        public void onNeutralButtonClicked() {



See changelog


Copyright 2017 StepStone Services

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

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.

Maintained by