https://github.com/mhashim6/rateconditionsmonitor
Android rating library that leaves the the UI customization on the developer.
https://github.com/mhashim6/rateconditionsmonitor
android app-rating kotlin-android library rate
Last synced: about 2 months ago
JSON representation
Android rating library that leaves the the UI customization on the developer.
- Host: GitHub
- URL: https://github.com/mhashim6/rateconditionsmonitor
- Owner: mhashim6
- License: mit
- Created: 2018-07-20T15:41:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-06T15:16:42.000Z (over 6 years ago)
- Last Synced: 2025-03-05T05:30:23.356Z (over 1 year ago)
- Topics: android, app-rating, kotlin-android, library, rate
- Language: Kotlin
- Size: 135 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RateConditionsMonitor
There are several libraries for rating, but all of them force using AlertDialog, and leaves no area for customization; as it doesn't expose it's internal conditions-checking-api.
This library does just that: a rating-conditions-checking-api that leaves the UI part on the developer.
[](https://jitpack.io/#mhashim6/RateConditionsMonitor)
## Usage:
initialize the library at a starting point in your app :
```kotlin
RateConditionsMonitor.init(context = this@MainActivity) {
applyConditions(launchTimes = 3, remindTimes = 7, debug = true)
//launchTimes: how many app launches it takes to ask for rating.
//remindTimes: how many app launches it takes to ask for rating after RateConditionsMonitor.later() is called.
//debug: if true: RateConditionsMonitor.isConditionsMet is also true.
}
```
then in a check point in your app, check if conditions are met:
```kotlin
rate_btn.setOnClickListener {
if (RateConditionsMonitor.isConditionsMet)
alert {
title = "test rate"
yesButton {
//perform rating action here
RateConditionsMonitor.rated() //let the monitor know. }
/* noButton {
RateConditionsMonitor.denied() //let the monitor know.
}*/
negativeButton("later") {
RateConditionsMonitor.later() //let the monitor know.
}
}.show()
}
```
Make sure to check the [sample](https://github.com/mhashim6/RateConditionsMonitor/blob/master/app/src/main/java/mhashim6/android/ratemonitorsample/MainActivity.kt).
---
## Dependency:
Add it in your root build.gradle at the end of repositories:
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
**Step 2.** Add the dependency
```css
dependencies {
implementation 'com.github.mhashim6:RateConditionsMonitor:v2.0'
}
```