All Projects → fernandodev → Easy Rating Dialog

fernandodev / Easy Rating Dialog

Licence: other
A plug and play ;) android library for displaying a "rate this app" dialog

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Easy Rating Dialog

Piracychecker
An Android library that prevents your app from being pirated / cracked using Google Play Licensing (LVL), APK signature protection and more. API 14+ required.
Stars: ✭ 1,359 (+1102.65%)
Mutual labels:  gradle
Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-6.19%)
Mutual labels:  gradle
Gradle Build Properties Plugin
Keep your secrets secret. External build properties support for your Gradle scripts.
Stars: ✭ 110 (-2.65%)
Mutual labels:  gradle
Kordamp Gradle Plugins
A collection of Gradle plugins
Stars: ✭ 100 (-11.5%)
Mutual labels:  gradle
Gradle Changelog Plugin
Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Stars: ✭ 102 (-9.73%)
Mutual labels:  gradle
Pyreclab
pyRecLab is a library for quickly testing and prototyping of traditional recommender system methods, such as User KNN, Item KNN and FunkSVD Collaborative Filtering. It is developed and maintained by Gabriel Sepúlveda and Vicente Domínguez, advised by Prof. Denis Parra, all of them in Computer Science Department at PUC Chile, IA Lab and SocVis Lab.
Stars: ✭ 108 (-4.42%)
Mutual labels:  rating
Wrapper Validation Action
Gradle Wrapper Validation Action
Stars: ✭ 99 (-12.39%)
Mutual labels:  gradle
Marklogic Data Hub
The MarkLogic Data Hub: documentation ==>
Stars: ✭ 113 (+0%)
Mutual labels:  gradle
Jenkins Pipeline Shared Libraries Gradle Plugin
Gradle plugin to help with build and test of Jenkins Pipeline Shared Libraries (see https://jenkins.io/doc/book/pipeline/shared-libraries/)
Stars: ✭ 103 (-8.85%)
Mutual labels:  gradle
Android Ratingreviews
Simple star rating system bars, a view similar to the ones seen on Google Playstore. ⭐🌟✨
Stars: ✭ 110 (-2.65%)
Mutual labels:  rating
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (-11.5%)
Mutual labels:  gradle
Japicmp Gradle Plugin
A Gradle plugin for JApicmp
Stars: ✭ 101 (-10.62%)
Mutual labels:  gradle
Goomph
IDE as build artifact
Stars: ✭ 108 (-4.42%)
Mutual labels:  gradle
Recommenders
Best Practices on Recommendation Systems
Stars: ✭ 11,818 (+10358.41%)
Mutual labels:  rating
Springcloud Quickstart
spring cloud demo based on gradle.
Stars: ✭ 111 (-1.77%)
Mutual labels:  gradle
Ng Boot Oauth
oauth2 demo with angularjs and springboot
Stars: ✭ 99 (-12.39%)
Mutual labels:  gradle
Webfluxtemplate
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.
Stars: ✭ 107 (-5.31%)
Mutual labels:  gradle
Godot
Keep track of how much time you spend on Gradle builds
Stars: ✭ 113 (+0%)
Mutual labels:  gradle
Iron
Fast and easy to use NoSQL data storage with RxJava support
Stars: ✭ 112 (-0.88%)
Mutual labels:  gradle
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+1189.38%)
Mutual labels:  gradle

Easy Rating Dialog Build StatusAndroid Arsenal

This lib provides a simple way to display an alert dialog for rating app.

Default conditions to show:

  1. User opened the app more than 5 times
  2. User opened the app after 7 days of first opening.
  • Please Note: The lastest version uses AppCompat. Your application Theme has to be inherited from Theme.AppCompat

Installation

It's very simple with gradle ;)

Add mavenCentral as repository source:

repositories {
  mavenCentral()
}

And finally add this line inside dependencies { } section:

compile 'com.github.fernandodev.easyratingdialog:easyratingdialog:+'
  • The + symbol indicates to gradle to get the latest version.
  • Current version: 1.1.2

ATTENTION

If you are using afollestad:material-dialogs you must esclude this module from EasyRatingDialog lib to avoid lib conflicting:

  compile('com.github.fernandodev.easyratingdialog:easyratingdialog:1.1.2') {
    exclude module: 'material-dialogs'
  }
  • See the sample if there are any doubts.

Using

The main flow usage is:

Create dialog in your main activity or your start activity:

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  easyRatingDialog = new EasyRatingDialog(this);
}

after you need to start dialog at:

@Override
protected void onStart() {
  super.onStart();
  easyRatingDialog.onStart();
}

this line inc. counters and initialize first app access date if necessary

And to show when needed just call in onResume:

@Override
protected void onResume() {
  super.onResume();
  easyRatingDialog.showIfNeeded();
}
  • all exceptions are catched when dialog tries to show because I assume the app running is more important than to show the dialog.

Tips

Condition triggers

If you want to change the default lib behavior you can create a custom Condition Trigger:

EasyRatingDialog.ConditionTrigger conditionTrigger = new EasyRatingDialog.ConditionTrigger() {
  @Override
  public boolean shouldShow() {
    //Your custom condition here
    return false;
  }
};

easyRatingDialog.setConditionTrigger(conditionTrigger);

Useful public methods

If you need to create for user an action rate and link it with dialog conditions, don't be afraid, just create the easy rating dialog instance and call rate now as below:

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  easyRatingDialog = new EasyRatingDialog(this);
}
public void onClickRateNow() {
  super.onResume();
  easyRatingDialog.rateNow();
}

You can do it for neverRemider() and remindMeLater() actions too.

To check stored values just call didNeverReminder(), didRate().

Internationalization

Do you liked the lib but you need to change default strings in en-US, you can do it easily as section below.

Just override default values in your strings.xml:

<resources>
  <string name="erd_title">Rate this app</string>
  <string name="erd_message">Hi, take a minute to rate this app and help support to improve more new features. ;)</string>
  <string name="erd_no_thanks">No, thanks.</string>
  <string name="erd_remind_me_later">Remind me later.</string>
  <string name="erd_rate_now">Rate now.</string>
</resources>

Constants

Do you want to change hit times or days after condition? It's simple!

You need to override default values the lib, for that, just create in res/values folder, or alter, a file named constants.xml.

And override the values:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <integer name="erd_launch_times">10</integer>
  <integer name="erd_max_days_after">14</integer>
</resources>

Theme

You can customize the alert dialog using style settings:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="Theme.AppCompat">
        <item name="alertDialogTheme">@style/AlertDialogTheme</item>
    </style>

    <!--You can customize dialog theme as below-->

    <style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
        <item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
        <item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
    </style>

    <style name="NegativeButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
        <item name="android:textColor">#f00</item>
    </style>

    <style name="PositiveButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
        <item name="android:textColor">#00f</item>
    </style>
</resources>

Dagger Issues

If you are using dagger pay attention to some items.

One, you must provide an Activity Context to EasyRatingDialog to show the dialog. So you can do this as below:

@Provides EasyRatingDialog provideRatingDialog(@ForActivity Context context) {
  return new EasyRatingDialog(context);
}

where @ForActivity is an interface that overrides other contexts provided by other modules.

@Qualifier @Retention(RUNTIME)
  public @interface ForActivity {
}

Otherwise if you provide other context and try to show an execption can be occur because dialogs only can be attached to Activity's context.

The code below prevents you to get a BadTokenException exception E/EasyRatingDialog﹕ Unable to add window -- token [email protected] is not valid; is your activity running?

@Provides @ForActivity Context provideActivityContext() {
  return activity;
}

If you use `@Singleton annotation to provide the Activity's context a BadTokenException can be occur after restoring from background.

Remember, all exceptions are catched when dialog tries to show because I assume the app running is more important than to show the dialog.

Samples Usage

There are two samples, the first is just a simple acitivity that shows the dialog and the second uses dagger injection.

To run samples you can follow steps below

$ git clone [email protected]:fernandodev/easy-rating-dialog.git
$ cd easyratingdialog
$ ./gradlew installSampleDebug installSampleWithDaggerDebug --daemon

Testing

There are a simple test for the rating dialog. If you want to contribute check the tests too.

$ git clone [email protected]:fernandodev/easy-rating-dialog.git
$ cd easyratingdialog
$ ./gradlew assembleSampleDebugTest connectedAndroidTestSampleDebug --daemon

You must open an emulator before.

Showcase

Have you used my library in your project? Tell me and I'll sponsor your app here ;)

Change Logs

See Change Logs file.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].