-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added dismissRateDialog() function. #92
base: master
Are you sure you want to change the base?
Conversation
• I've added dismissRateDialog() function. I've been need to change a very little piece of code to make this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution.
I wrote some feedbacks.
*/ | ||
public static void dismissRateDialog() { | ||
if (dialog != null) | ||
dialog.dismiss(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add dialog = null;
@@ -62,6 +45,9 @@ | |||
// Weak ref to avoid leaking the context | |||
private static WeakReference<AlertDialog> sDialogRef = null; | |||
|
|||
private static AlertDialog dialog; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @Nullable
to dialog and builder
@@ -1,20 +1,3 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep license comment
@@ -178,7 +164,8 @@ public static boolean shouldShowRateDialog() { | |||
* @param context | |||
*/ | |||
public static void showRateDialog(final Context context) { | |||
AlertDialog.Builder builder = new AlertDialog.Builder(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about builder
and dialog
are not null? (= dialog is shown)
It may be better to do nothing on the situation.
• I've added dismissRateDialog() function. I've been need to change a very little piece of code to make this works.