Skip to content

NaiimAb/smart-rating

Repository files navigation

Smart Rating Dialog

Smart Rating is a library for Android built in Java to show rating dialog in your app

Features:

  • Easy to implement
  • Changable style
  • Make the dialog appear on a defined app session
  • Opens Feedback form if the user rates below the minimum stars
  • Customizable title, positive button and negative button texts
  • Override dialog redirection to Google Play or Feedback form according to your needs
  • Different Languages

Show on Sepecific Time

Use session() To show dialog on different time user opend the app. numOfStars() is used to defined the threshold of the app. If user shows less thant that number a feedback form will show, otherwise it will redirect user to your play store defined here : playStoreUrl()

Installation

Use parameters as you wanted The whole parameters are

final SmartRating smartRating = new SmartRating.Builder(this)
                //.icon(drawable)
                .session(7)
                .numOfStars(3)
                .title("Dialog Title")
                .titleTextColor(R.color.black)
                .positiveButtonText("Later")
                .negativeButtonText("Do not show")
                .positiveButtonTextColor(R.color.white)
                .negativeButtonTextColor(R.color.black)
                .formTitle("Feedback Title")
                .formHint("Feedback Edit Text Hint")
                .formSubmitText("Submit Text")
                .formCancelText("Cancel Text")
                .ratingBarColor(R.color.yellow)
                .playStoreUrl("Your play store URL")
                .onNumOfStarsPassed(new SmartRating.Builder.RatingNumOfStarsPassedListener() {
                    @Override
                    public void onNumOfStarsPassed(SmartRating ratingDialog, float rating, boolean numOfStarsPassed) {
                        ratingDialog.dismiss();
                    }
                })
                .onNumOfStarsFailed(new SmartRating.Builder.RatingNumOfStarsFailedListener() {
                    @Override
                    public void onNumOfStarsFailed(SmartRating ratingDialog, float rating, boolean numOfStarsPassed) {
                        ratingDialog.dismiss();
                    }
                })
                .onRatingChanged(new SmartRating.Builder.RatingSelectedListener() {
                    @Override
                    public void onRatingSelected(float rating, boolean thresholdCleared) {

                    }
                })
                .onFormSubmitted(new SmartRating.Builder.RatingFeedbackFormListener() {
                    @Override
                    public void onFormSubmitted(String feedback) {

                    }
                }).build();

You can override the redrection to Play Store and override the feedback form too

Note

  • Don't use session() if you want to show the dialog on a click event.
  • Remove the threshold() from the builder if you don't want to show the feedback form to the user.
  • Use onThresholdCleared() to override the default redirection to Google Play.
  • Use onThresholdFailed() to show your custom feedback form.

Installation

Project Gradle

add to repositories

maven { url 'https://jitpack.io' }
App Gradle

Add to dependencies

implementation 'com.github.NaiimAb:smart-rating:1.0.0'

Show Dialog

smartRating.show();

Languages Available

For default text of the dialog, there is :

  • English
  • French
  • Arabic
  • German
  • Spanish

Author:

Naiim Abouhafs Let us know if there is any bug or problem

License

Copyright (C) 2016 Code My Brains Out

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.

About

An android library to show rating dialog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages