@@ -32,6 +32,7 @@ public class AppRater {
32
32
private static boolean hideNoButton ;
33
33
private static boolean isVersionNameCheckEnabled ;
34
34
private static boolean isVersionCodeCheckEnabled ;
35
+ private static boolean isCancelable = true ;
35
36
36
37
private static Market market = new GoogleMarket ();
37
38
@@ -83,6 +84,15 @@ public static void setDontRemindButtonVisible(boolean isNoButtonVisible) {
83
84
AppRater .hideNoButton = isNoButtonVisible ;
84
85
}
85
86
87
+ /**
88
+ * sets whether the rating dialog is cancelable or not, default is true.
89
+ *
90
+ * @param cancelable
91
+ */
92
+ public static void setCancelable (boolean cancelable ) {
93
+ isCancelable = cancelable ;
94
+ }
95
+
86
96
/**
87
97
* Call this method at the end of your OnCreate method to determine whether
88
98
* to show the rate prompt using the specified or default day, launch count
@@ -242,6 +252,8 @@ private static void showRateAlertDialog(final Context context, final SharedPrefe
242
252
243
253
builder .setMessage (context .getString (R .string .rate_message ));
244
254
255
+ builder .setCancelable (isCancelable );
256
+
245
257
builder .setPositiveButton (context .getString (R .string .rate ),
246
258
new DialogInterface .OnClickListener () {
247
259
public void onClick (DialogInterface dialog , int id ) {
@@ -306,4 +318,4 @@ public static void resetData(Context context) {
306
318
editor .putLong (PREF_FIRST_LAUNCHED , date_firstLaunch );
307
319
commitOrApply (editor );
308
320
}
309
- }
321
+ }
0 commit comments