Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Android Tech Frontier | 10,390 | 2 years ago | 11 | apache-2.0 | ||||||
【停止维护】一个定期翻译国外Android优质的技术、开源库、软件架构设计、测试等文章的开源项目 | ||||||||||
Mvparms | 10,129 | 2 years ago | 41 | apache-2.0 | Java | |||||
⚔️ A common architecture for Android applications developing based on MVP, integrates many open source projects, to make your developing quicker and easier (一个整合了大量主流开源项目高度可配置化的 Android MVP 快速集成框架). | ||||||||||
Bookreader | 6,291 | 2 months ago | 38 | apache-2.0 | Java | |||||
:closed_book: "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~ | ||||||||||
Androidproject | 5,116 | 9 months ago | 1 | apache-2.0 | Java | |||||
Android 技术中台,但愿人长久,搬砖不再有 | ||||||||||
Awesome Rxjava | 4,834 | 2 years ago | 5 | |||||||
RxJava resources | ||||||||||
Android Mvp Architecture | 4,425 | 12 days ago | 40 | apache-2.0 | Java | |||||
This repository contains a detailed sample app that implements MVP architecture using Dagger2, GreenDao, RxJava2, FastAndroidNetworking and PlaceholderView | ||||||||||
Geeknews | 3,492 | 5 years ago | 50 | Java | ||||||
:books:A pure reading App based on Material Design + MVP + RxJava2 + Retrofit + Dagger2 + Realm + Glide | ||||||||||
Lqrwechat | 3,344 | 2 months ago | 25 | mit | Java | |||||
本项目仿最新版微信6.5.7(除图片选择器外),基于融云SDK,使用目前较火的 Rxjava+Retrofit+MVP+Glide 技术开发。相比上个版本,加入发送位置消息,红包消息等功能。 | ||||||||||
Kotlinmvp | 3,216 | 3 years ago | 14 | apache-2.0 | Kotlin | |||||
:fire: 「停止维护」基于Kotlin+MVP+Retrofit+RxJava+Glide 等架构实现短视频类小项目,简约风格及详细注释,欢迎 star or fork! | ||||||||||
T Mvp | 2,723 | 4 years ago | 7 | Java | ||||||
Android AOP Architecture by Apt, AspectJ, Javassisit, based on Realm+Databinding+MVP+Retrofit+Rxjava2 |
Smart rate is a library that helps you improve your app's rating and get user feedback, inspired by Smart App Rate library.
See demo app on Google Play
Add dependency to your module's (usually app/build.gradle
) build.gradle
and sync:
implementation 'com.g2pdev:smartrate:(insert latest version)'
Please note that upgrade from 1.x to 2.x will reset all library preferences.
In your Application.onCreate()
method call:
SmartRate.init(this)
For example:
class App : Application() {
override fun onCreate() {
super.onCreate()
SmartRate.init(this)
}
}
Note: calling SmartRate.init()
with context other than Application
will cause exception.
In your Activity.onCreate()
call SmartRate.show(this)
:
class MainActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
SmartRate.show(this)
}
}
See values of default config in Config section.
Call method SmartRate.show(this, config)
:
class MainActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val config = SmartRateConfig().apply {
// ...
}
SmartRate.show(this, config)
}
}
See config section below.
Configuration is represented by class SmartRateConfig
.
Field | Type | Description | Default value |
---|---|---|---|
minSessionCount |
Int |
Minimum session count before showing the dialog | 3 |
minSessionCountBetweenPrompts |
Int |
Minimum session count before showing the dialog after user clicks «Later» | 3 |
minRatingForStore |
Float |
Minimum rating to redirect user to app store. If user rates app lower, it will show the «Feedback» dialog | 4.0f |
iconDrawableResId |
Int? |
Icon drawable to override default (default is app icon retrieved automatically) | null |
titleResId |
Int |
Rate dialog title | R.string.sr_title |
rateNeverAskResId |
Int |
«Never ask» button title | R.string.sr_never_ask |
rateLaterResId |
Int |
«Maybe later» button title | R.string.sr_maybe_later |
rateTitleTextColorResId |
Int |
Rate dialog title text color | R.color.rateTitleText |
rateNeverAskButtonTextColorResId |
Int |
«Never ask» button text color | R.color.rateNeverButtonText |
rateLaterButtonTextColorResId |
Int? |
«Maybe later» button text color |
null (will use colorAccent of your app |
feedbackTitleResId |
Int |
Feedback dialog title | R.string.sr_title_feedback |
feedbackHintResId |
Int |
Feedback text field hint | R.string.sr_hint_feedback |
feedbackCancelResId |
Int |
Feedback «Cancel» button text | R.string.sr_feedback_cancel |
feedbackSubmitResId |
Int |
Feedback «Submit» button text | R.string.sr_feedback_submit |
feedbackTitleTextColorResId |
Int |
Feedback dialog title text color | R.color.feedbackTitleText |
feedbackCancelButtonTextColorResId |
Int |
Feedback «Cancel» button text color | R.color.feedbackCancelButtonText |
feedbackSubmitButtonTextColorResId |
Int |
Feedback «Submit» button text color |
null (will use colorAccent of your app |
isRateDismissible |
Boolean |
Is rate dialog dismissible by clicking «back» button or outside? | false |
store |
Store |
Store where to redirect user to rate app. Ignored if customStoreLink is set. |
Store.GOOGLE_PLAY |
customStoreLink |
String? |
Custom link where to redirect user to rate app | null |
showFeedbackDialog |
Boolean |
Show feedback dialog if rating is below then minRatingForStore ? |
true |
isFeedbackDismissible |
Boolean |
Is feedback dialog dismissible by clicking «back» button or outside? | false |
For better AppGallery compatibility the AppID can be set to the store:
store = Store.APP_GALLERY.setAppId("numeric_app_id_from_huawei")
Listeners are also located in the config:
Field | Type | Description | Default value |
---|---|---|---|
onRateDialogShowListener |
(() -> Unit)? |
Called when rate dialog is shown | null |
onRateDialogWillNotShowListener |
(() -> Unit)? |
Called when rate dialog will not be shown because of conditions failure | null |
onRateDismissListener |
(() -> Unit)? |
Called when rate dialog is dismissed (by clicking «Back» button or outside) | null |
onRateListener |
((rating: Float) -> Unit)? |
Called when user rated app | null |
onNeverAskClickListener |
(() -> Unit)? |
Called when user clicks «Never ask» button | null |
onLaterClickListener |
(() -> Unit)? |
Called when user clicks «Maybe later» button | null |
onFeedbackDismissListener |
(() -> Unit)? |
Called when feedback dialog is dismissed (by clicking «Back» button or outside) | null |
onFeedbackCancelClickListener |
(() -> Unit)? |
Called when user clicks «Cancel» button in feedback dialog | null |
onFeedbackSubmitClickListener |
((text: String) -> Unit)? |
Called when user clicks «Submit» button in feedback dialog | null |
Configuring is pretty easy — just create the default config and then modify it using, for example apply()
:
val config = SmartRateConfig()
.apply {
minSessionCount = 10
minRatingForStore = 3.5f
}
// ...
Not needed — rules are included in library.
This library uses:
I believe it's implemented following the Clean Architecture principles. This implementation probably seems over-engineered for such simple task, but, on the other hand, it's pretty testable and extensible.
All interactors, repository and some caches are covered by tests (see tests)
UI is also almost fully covered by tests with Espresso (see tests)
Code style is automatically checked by Spotless and ktlint. Check out my post about it on Medium.
Every pull request to master
is checked by Travis CI.
When pull request to master
is merged and some tag is pushed, Travis CI:
Any contributions, including translations, are highly appreciated.
Please, report any issues here.
This library is inspired by Smart App Rate.
Fallback rate icon made by Freepik.
Author: Artem Smirnov.
Copyright (C) 2020 Artem Smirnov
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.