From c11f7a45731ee13fda03d57727742908d2b07ce3 Mon Sep 17 00:00:00 2001 From: Yuna Yano Date: Mon, 15 Jan 2018 11:15:43 +0900 Subject: [PATCH 1/2] Cast "threshold" from Int type to long type --- library/src/main/java/hotchemi/android/rate/AppRate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/hotchemi/android/rate/AppRate.java b/library/src/main/java/hotchemi/android/rate/AppRate.java index b9a4907..9d8f414 100644 --- a/library/src/main/java/hotchemi/android/rate/AppRate.java +++ b/library/src/main/java/hotchemi/android/rate/AppRate.java @@ -54,7 +54,7 @@ public static boolean showRateDialogIfMeetsConditions(Activity activity) { } private static boolean isOverDate(long targetDate, int threshold) { - return new Date().getTime() - targetDate >= threshold * 24 * 60 * 60 * 1000; + return new Date().getTime() - targetDate >= (long)threshold * 24 * 60 * 60 * 1000; } public AppRate setLaunchTimes(int launchTimes) { From 2fbebcd48c1bcad60fab6600c33006b5b5f1312b Mon Sep 17 00:00:00 2001 From: Yuna Yano Date: Tue, 20 Feb 2018 12:13:10 +0900 Subject: [PATCH 2/2] Changed argument to long type. --- library/src/main/java/hotchemi/android/rate/AppRate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/hotchemi/android/rate/AppRate.java b/library/src/main/java/hotchemi/android/rate/AppRate.java index 9d8f414..e0f2237 100644 --- a/library/src/main/java/hotchemi/android/rate/AppRate.java +++ b/library/src/main/java/hotchemi/android/rate/AppRate.java @@ -53,8 +53,8 @@ public static boolean showRateDialogIfMeetsConditions(Activity activity) { return isMeetsConditions; } - private static boolean isOverDate(long targetDate, int threshold) { - return new Date().getTime() - targetDate >= (long)threshold * 24 * 60 * 60 * 1000; + private static boolean isOverDate(long targetDate, long threshold) { + return new Date().getTime() - targetDate >= threshold * 24 * 60 * 60 * 1000; } public AppRate setLaunchTimes(int launchTimes) {