{"id":3659,"url":"https://github.com/fernandodev/easy-rating-dialog","last_synced_at":"2025-09-09T18:03:03.059Z","repository":{"id":19366257,"uuid":"22606332","full_name":"fernandodev/easy-rating-dialog","owner":"fernandodev","description":"A plug and play ;) android library for displaying a \"rate this app\" dialog","archived":false,"fork":false,"pushed_at":"2018-08-13T09:25:42.000Z","size":286,"stargazers_count":112,"open_issues_count":6,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-15T09:50:10.117Z","etag":null,"topics":["android","gradle","rating","rating-dialog"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fernandodev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOGS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-04T14:04:25.000Z","updated_at":"2024-10-18T14:34:45.000Z","dependencies_parsed_at":"2022-09-13T10:40:50.384Z","dependency_job_id":null,"html_url":"https://github.com/fernandodev/easy-rating-dialog","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandodev%2Feasy-rating-dialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandodev%2Feasy-rating-dialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandodev%2Feasy-rating-dialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fernandodev%2Feasy-rating-dialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fernandodev","download_url":"https://codeload.github.com/fernandodev/easy-rating-dialog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","gradle","rating","rating-dialog"],"created_at":"2024-01-05T20:16:47.775Z","updated_at":"2024-12-07T06:30:40.006Z","avatar_url":"https://github.com/fernandodev.png","language":"Java","funding_links":[],"categories":["Libraries","库"],"sub_categories":["Other","[](https://github.com/JStumpp/awesome-android/blob/master/readme.md#other)其他"],"readme":"Easy Rating Dialog [![Build Status](https://travis-ci.org/fernandodev/easy-rating-dialog.svg?branch=master)](https://travis-ci.org/fernandodev/easy-rating-dialog)[![Android Arsenal](http://img.shields.io/badge/Android%20Arsenal-easy--rating--dialog-blue.svg?style=flat)](http://android-arsenal.com/details/1/844)\n==\n\n\u003cimg src=\"https://raw.githubusercontent.com/fernandodev/easy-rating-dialog/master/screenshots/device-2017-05-07-185513.png\" width=\"320px\"\u003e\n\nThis lib provides a simple way to display an alert dialog for rating app.\n\nDefault conditions to show:\n\n1. User opened the app more than 5 times\n2. User opened the app after 7 days of first opening.\n\n* Please Note: The lastest version uses AppCompat. Your application Theme has to be inherited from *Theme.AppCompat*\n\n- [Easy Rating Dialog](#easy-rating-dialog-!build-statushttpstravis-ciorgfernandodeveasy-rating-dialogsvgbranch=masterhttpstravis-ciorgfernandodeveasy-rating-dialog)\n  - [Installation](#installation)\n  - [Using](#using)\n  - [Tips](#tips)\n    - [Condition triggers](#condition-triggers)\n    - [Useful public methods](#useful-public-methods)\n    - [Internationalization](#internationalization)\n    - [Constants](#constants)\n    - [Theme](#theme)\n  - [Dagger Issues](#dagger-issues)\n  - [Samples Usage](#samples-usage)\n  - [Testing](#testing)\n  - [Showcase](#showcase)\n  - [Change Logs](#change-logs)\n  - [License](#license)\n\n## Installation\n\nIt's very simple with gradle ;)\n\nAdd `mavenCentral` as repository source:\n\n```gradle\nrepositories {\n  mavenCentral()\n}\n```\n\nAnd finally add this line inside `dependencies { }` section:\n\n```gradle\ncompile 'com.github.fernandodev.easyratingdialog:easyratingdialog:+'\n```\n\n* The `+` symbol indicates to gradle to get the latest version.\n* Current version: `1.1.2`\n\n**ATTENTION**\n\nIf you are using [afollestad:material-dialogs](https://github.com/afollestad/material-dialogs) you must esclude this module from EasyRatingDialog lib to avoid lib conflicting:\n\n```gradle\n  compile('com.github.fernandodev.easyratingdialog:easyratingdialog:1.1.2') {\n    exclude module: 'material-dialogs'\n  }\n```\n\n* See the sample if there are any doubts.\n\n## Using\n\nThe main flow usage is:\n\nCreate dialog in your main activity or your start activity:\n\n```java\npublic void onCreate(Bundle savedInstanceState) {\n  super.onCreate(savedInstanceState);\n  easyRatingDialog = new EasyRatingDialog(this);\n}\n```\n\nafter you need to start dialog at:\n\n```java\n@Override\nprotected void onStart() {\n  super.onStart();\n  easyRatingDialog.onStart();\n}\n```\n\nthis line inc. counters and initialize first app access date if necessary\n\nAnd to show when needed just call in `onResume`:\n\n```java\n@Override\nprotected void onResume() {\n  super.onResume();\n  easyRatingDialog.showIfNeeded();\n}\n```\n\n* all **exceptions** are catched when dialog tries to show because I assume the app running is more important than to show the dialog.\n\n## Tips\n\n### Condition triggers\n\nIf you want to change the default lib behavior you can create a custom Condition Trigger:\n\n```java\nEasyRatingDialog.ConditionTrigger conditionTrigger = new EasyRatingDialog.ConditionTrigger() {\n  @Override\n  public boolean shouldShow() {\n    //Your custom condition here\n    return false;\n  }\n};\n\neasyRatingDialog.setConditionTrigger(conditionTrigger);\n```\n\n### Useful public methods\n\nIf you need to create for user an action rate and link it with dialog conditions, don't be afraid, just create\nthe easy rating dialog instance and call rate now as below:\n\n```java\npublic void onCreate(Bundle savedInstanceState) {\n  super.onCreate(savedInstanceState);\n  easyRatingDialog = new EasyRatingDialog(this);\n}\n```\n\n```java\npublic void onClickRateNow() {\n  super.onResume();\n  easyRatingDialog.rateNow();\n}\n```\n\nYou can do it for `neverRemider()` and `remindMeLater()` actions too.\n\nTo check stored values just call `didNeverReminder()`, `didRate()`.\n\n### Internationalization\n\nDo you liked the lib but you need to change default strings in en-US, you can do it easily as section below.\n\nJust override default values in your `strings.xml`:\n\n```xml\n\u003cresources\u003e\n  \u003cstring name=\"erd_title\"\u003eRate this app\u003c/string\u003e\n  \u003cstring name=\"erd_message\"\u003eHi, take a minute to rate this app and help support to improve more new features. ;)\u003c/string\u003e\n  \u003cstring name=\"erd_no_thanks\"\u003eNo, thanks.\u003c/string\u003e\n  \u003cstring name=\"erd_remind_me_later\"\u003eRemind me later.\u003c/string\u003e\n  \u003cstring name=\"erd_rate_now\"\u003eRate now.\u003c/string\u003e\n\u003c/resources\u003e\n```\n\n### Constants\n\nDo you want to change hit times or days after condition? It's simple!\n\nYou need to override default values the lib, for that, just create in `res/values` folder, or alter, a file\nnamed `constants.xml`.\n\nAnd override the values:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cresources\u003e\n  \u003cinteger name=\"erd_launch_times\"\u003e10\u003c/integer\u003e\n  \u003cinteger name=\"erd_max_days_after\"\u003e14\u003c/integer\u003e\n\u003c/resources\u003e\n```\n\n### Theme\n\nYou can customize the alert dialog using style settings:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cresources\u003e\n    \u003cstyle name=\"AppTheme\" parent=\"Theme.AppCompat\"\u003e\n        \u003citem name=\"alertDialogTheme\"\u003e@style/AlertDialogTheme\u003c/item\u003e\n    \u003c/style\u003e\n\n    \u003c!--You can customize dialog theme as below--\u003e\n\n    \u003cstyle name=\"AlertDialogTheme\" parent=\"Theme.AppCompat.Light.Dialog.Alert\"\u003e\n        \u003citem name=\"buttonBarNegativeButtonStyle\"\u003e@style/NegativeButtonStyle\u003c/item\u003e\n        \u003citem name=\"buttonBarPositiveButtonStyle\"\u003e@style/PositiveButtonStyle\u003c/item\u003e\n    \u003c/style\u003e\n\n    \u003cstyle name=\"NegativeButtonStyle\" parent=\"Widget.AppCompat.Button.ButtonBar.AlertDialog\"\u003e\n        \u003citem name=\"android:textColor\"\u003e#f00\u003c/item\u003e\n    \u003c/style\u003e\n\n    \u003cstyle name=\"PositiveButtonStyle\" parent=\"Widget.AppCompat.Button.ButtonBar.AlertDialog\"\u003e\n        \u003citem name=\"android:textColor\"\u003e#00f\u003c/item\u003e\n    \u003c/style\u003e\n\u003c/resources\u003e\n```\n\n## Dagger Issues\n\nIf you are using dagger pay attention to some items.\n\nOne, you must provide an Activity Context to EasyRatingDialog to show the dialog. So you can do this as\nbelow:\n\n```java\n@Provides EasyRatingDialog provideRatingDialog(@ForActivity Context context) {\n  return new EasyRatingDialog(context);\n}\n```\n\nwhere `@ForActivity` is an interface that overrides other contexts provided by other modules.\n\n```java\n@Qualifier @Retention(RUNTIME)\n  public @interface ForActivity {\n}\n```\n\nOtherwise if you provide other context and try to show an execption can be occur because dialogs only can be\nattached to Activity's context.\n\nThe code below prevents you to get a BadTokenException exception\n`E/EasyRatingDialog﹕ Unable to add window -- token android.os.BinderProxy@536c3920 is not valid; is your activity running?`\n\n```java\n@Provides @ForActivity Context provideActivityContext() {\n  return activity;\n}\n```\n\nIf you use `@Singleton annotation to provide the Activity's context a BadTokenException can be occur after restoring from background.\n\nRemember, all **exceptions** are catched when dialog tries to show because\nI assume the app running is more important than to show the dialog.\n\n## Samples Usage\n\nThere are two samples, the first is just a simple acitivity that shows the dialog and the second uses dagger injection.\n\nTo run samples you can follow steps below\n\n```shell\n$ git clone git@github.com:fernandodev/easy-rating-dialog.git\n$ cd easyratingdialog\n$ ./gradlew installSampleDebug installSampleWithDaggerDebug --daemon\n```\n\n## Testing\n\nThere are a simple test for the rating dialog. If you want to contribute check the tests too.\n\n```shell\n$ git clone git@github.com:fernandodev/easy-rating-dialog.git\n$ cd easyratingdialog\n$ ./gradlew assembleSampleDebugTest connectedAndroidTestSampleDebug --daemon\n```\n\nYou must open an emulator before.\n\n## Showcase\n\nHave you used my library in your project? Tell me and I'll sponsor your app here ;)\n\n* [I Ching - The Oracle](https://play.google.com/store/apps/details?id=com.creativecode.iching)\n* [Say It! - English Learning](https://play.google.com/store/apps/details?id=com.cesarsk.say_it) : An Android App aimed to improve your English Pronunciation. [Github Page](https://github.com/cesarsk/say_it)\n* [Find my car : Last Park](https://play.google.com/store/apps/details?id=com.ages.arabamnerede) : Find My Car allows you to save the exact location of your parked car so you can later remember where it's.\n* [App permissions](https://play.google.com/store/apps/details?id=in.arjsna.permissionchecker) - App to see details of permissions required by all the installed apps [Github Page](https://github.com/Arjun-sna/android-permission-checker-app).\n* [Quick Audio Recorder](https://play.google.com/store/apps/details?id=com.rwsoftwares.waqas.quickaudiorecorder) : A simple audio recorder for Android.\n\n## Change Logs\n\nSee [Change Logs file](https://github.com/fernandodev/easy-rating-dialog/blob/master/CHANGELOGS.md).\n\n## License\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandodev%2Feasy-rating-dialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffernandodev%2Feasy-rating-dialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffernandodev%2Feasy-rating-dialog/lists"}