From 1907d51f048b15316158110390484c2963231e57 Mon Sep 17 00:00:00 2001 From: Andrew Jackson Date: Fri, 27 Sep 2013 08:02:37 +0100 Subject: [PATCH] Added overriden method for specifying own prompt values Added IML files Version bump for release to maven central --- .gitignore | 1 - AppRater.iml | 13 ++++ AppRater/AndroidManifest.xml | 4 +- AppRater/AppRater-AppRater.iml | 73 +++++++++++++++++++ .../src/org/codechimp/apprater/AppRater.java | 15 +++- AppRaterDemo/AndroidManifest.xml | 4 +- AppRaterDemo/AppRaterDemo.iml | 73 +++++++++++++++++++ README.md | 2 + gradle.properties | 4 +- 9 files changed, 179 insertions(+), 10 deletions(-) create mode 100644 AppRater.iml create mode 100644 AppRater/AppRater-AppRater.iml create mode 100644 AppRaterDemo/AppRaterDemo.iml diff --git a/.gitignore b/.gitignore index b74ae0f..0bdfc50 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,5 @@ signing.properties # Android Studio files out/ build/ -*.iml .idea diff --git a/AppRater.iml b/AppRater.iml new file mode 100644 index 0000000..94f1c61 --- /dev/null +++ b/AppRater.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/AppRater/AndroidManifest.xml b/AppRater/AndroidManifest.xml index e1754b2..e789d45 100644 --- a/AppRater/AndroidManifest.xml +++ b/AppRater/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="16" + android:versionName="1.0.6" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AppRater/src/org/codechimp/apprater/AppRater.java b/AppRater/src/org/codechimp/apprater/AppRater.java index 03bf76c..77aafa0 100644 --- a/AppRater/src/org/codechimp/apprater/AppRater.java +++ b/AppRater/src/org/codechimp/apprater/AppRater.java @@ -20,9 +20,18 @@ public class AppRater { /** * Call this method at the end of your OnCreate method to determine whether - * to show the rate prompt + * to show the rate prompt using the default day and launch count values */ public static void app_launched(Context context) { + app_launched(context, DAYS_UNTIL_PROMPT, LAUNCHES_UNTIL_PROMPT); + } + + + /** + * Call this method at the end of your OnCreate method to determine whether + * to show the rate prompt + */ + public static void app_launched(Context context, int daysUntilPrompt, int launchesUntilPrompt) { SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, 0); if (prefs.getBoolean(PREF_DONT_SHOW_AGAIN, false)) { return; @@ -43,9 +52,9 @@ public static void app_launched(Context context) { // Wait for at least the number of launches and the number of days used // until prompt - if (launch_count >= LAUNCHES_UNTIL_PROMPT) { + if (launch_count >= launchesUntilPrompt) { if (System.currentTimeMillis() >= date_firstLaunch - + (DAYS_UNTIL_PROMPT * 24 * 60 * 60 * 1000)) { + + (daysUntilPrompt * 24 * 60 * 60 * 1000)) { showRateAlertDialog(context, editor); } } diff --git a/AppRaterDemo/AndroidManifest.xml b/AppRaterDemo/AndroidManifest.xml index 0a574fb..e4ce546 100644 --- a/AppRaterDemo/AndroidManifest.xml +++ b/AppRaterDemo/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="16" + android:versionName="1.0.6" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 8de564c..8e1b32d 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ To use simply add the library to your app and make one call within your onCreate `AppRater.app_launched(this);` +Optionally you can use the overriden method to specify your own day and launch count parameters. + If you want to have a "Rate Now" menu option to go straight to your play store listing call `AppRater.rateNow(this);` within your menu code. Try out the demo within this repository. diff --git a/gradle.properties b/gradle.properties index ff88c9e..229dffa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.0.5 -VERSION_CODE=15 +VERSION_NAME=1.0.6 +VERSION_CODE=16 GROUP=com.github.codechimp-org.apprater POM_DESCRIPTION=AppRater Library for Android