|
@@ -1,6 +1,7 @@
|
|
|
package com.kdanmobile.kdan_others_library_for_android.dialog.rateus;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
@@ -19,6 +20,7 @@ public class RateUsDialog {
|
|
|
private Context context;
|
|
|
private Runnable onPositive;
|
|
|
private Runnable onNegative;
|
|
|
+ private Runnable onDismiss;
|
|
|
|
|
|
public RateUsDialog(Context context) {
|
|
|
this.context = context;
|
|
@@ -38,6 +40,11 @@ public class RateUsDialog {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ public RateUsDialog setOnDismiss(Runnable onDismiss){
|
|
|
+ this.onDismiss = onDismiss;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
public void show() {
|
|
|
View view = LayoutInflater.from(context).inflate(R.layout.dialog_rate_us, null);
|
|
|
TextView contentTV = (TextView) view.findViewById(R.id.tv_rateUsDialog_content);
|
|
@@ -56,7 +63,11 @@ public class RateUsDialog {
|
|
|
})
|
|
|
.onNegative((dialog, which) -> {
|
|
|
if (onNegative != null) onNegative.run();
|
|
|
- });
|
|
|
+ })
|
|
|
+ .dismissListener(dialogInterface -> {
|
|
|
+ if (onDismiss != null) onDismiss.run();
|
|
|
+ })
|
|
|
+ ;
|
|
|
if (!TextUtils.isEmpty(title)) {
|
|
|
builder.title(title);
|
|
|
space.setVisibility(View.GONE);
|