// Path: dexter/src/main/java/com/karumi/dexter/listener/OnDialogButtonClickListener.java
// public interface OnDialogButtonClickListener {
// 
//     void onClick();
// }
// 
// Path: dexter/src/main/java/com/karumi/dexter/listener/PermissionDeniedResponse.java
// public final class PermissionDeniedResponse {
// 
//   private final PermissionRequest requestedPermission;
//   private final boolean permanentlyDenied;
// 
//   public PermissionDeniedResponse(@NonNull PermissionRequest requestedPermission,
//       boolean permanentlyDenied) {
//     this.requestedPermission = requestedPermission;
//     this.permanentlyDenied = permanentlyDenied;
//   }
// 
//   /**
//    * Builds a new instance of PermissionDeniedResponse from a given permission string
//    * and a permanently-denied boolean flag
//    */
//   public static PermissionDeniedResponse from(@NonNull String permission,
//       boolean permanentlyDenied) {
//     return new PermissionDeniedResponse(new PermissionRequest(permission), permanentlyDenied);
//   }
// 
//   public PermissionRequest getRequestedPermission() {
//     return requestedPermission;
//   }
// 
//   public String getPermissionName() {
//     return requestedPermission.getName();
//   }
// 
//   public boolean isPermanentlyDenied() {
//     return permanentlyDenied;
//   }
// 
//   @Override
//   public boolean equals(Object o) {
//     if (this == o) {
//       return true;
//     }
//     if (o == null || getClass() != o.getClass()) {
//       return false;
//     }
//     PermissionDeniedResponse that = (PermissionDeniedResponse) o;
//     return requestedPermission.getName().equals(that.requestedPermission.getName());
//   }
// 
//   @Override
//   public int hashCode() {
//     return requestedPermission.getName().hashCode();
//   }
// }


import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import com.karumi.dexter.listener.OnDialogButtonClickListener;
import com.karumi.dexter.listener.PermissionDeniedResponse;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
    this.icon = icon;
    this.onDialogButtonClickListener = onDialogButtonClickListener;
  }

  @Override public void onPermissionDenied(PermissionDeniedResponse response) {
    super.onPermissionDenied(response);

    new AlertDialog.Builder(context)
        .setTitle(title)
        .setMessage(message)
        .setPositiveButton(positiveButtonText, new DialogInterface.OnClickListener() {
          @Override public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
            onDialogButtonClickListener.onClick();
          }
        })
        .setIcon(icon)
        .show();
  }

  /**
   * Builder class to configure the displayed dialog.
   * Non set fields will be initialized to an empty string.
   */
  public static class Builder {
    private final Context context;
    private String title;
    private String message;
    private String buttonText;
    private Drawable icon;
// Path: dexter/src/main/java/com/karumi/dexter/listener/OnDialogButtonClickListener.java
// public interface OnDialogButtonClickListener {
// 
//     void onClick();
// }
// 
// Path: dexter/src/main/java/com/karumi/dexter/listener/PermissionDeniedResponse.java
// public final class PermissionDeniedResponse {
// 
//   private final PermissionRequest requestedPermission;
//   private final boolean permanentlyDenied;
// 
//   public PermissionDeniedResponse(@NonNull PermissionRequest requestedPermission,
//       boolean permanentlyDenied) {
//     this.requestedPermission = requestedPermission;
//     this.permanentlyDenied = permanentlyDenied;
//   }
// 
//   /**
//    * Builds a new instance of PermissionDeniedResponse from a given permission string
//    * and a permanently-denied boolean flag
//    */
//   public static PermissionDeniedResponse from(@NonNull String permission,
//       boolean permanentlyDenied) {
//     return new PermissionDeniedResponse(new PermissionRequest(permission), permanentlyDenied);
//   }
// 
//   public PermissionRequest getRequestedPermission() {
//     return requestedPermission;
//   }
// 
//   public String getPermissionName() {
//     return requestedPermission.getName();
//   }
// 
//   public boolean isPermanentlyDenied() {
//     return permanentlyDenied;
//   }
// 
//   @Override
//   public boolean equals(Object o) {
//     if (this == o) {
//       return true;
//     }
//     if (o == null || getClass() != o.getClass()) {
//       return false;
//     }
//     PermissionDeniedResponse that = (PermissionDeniedResponse) o;
//     return requestedPermission.getName().equals(that.requestedPermission.getName());
//   }
// 
//   @Override
//   public int hashCode() {
//     return requestedPermission.getName().hashCode();
//   }
// }


// Path: dexter/src/main/java/com/karumi/dexter/listener/single/DialogOnDeniedPermissionListener.java
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import com.karumi.dexter.listener.OnDialogButtonClickListener;
import com.karumi.dexter.listener.PermissionDeniedResponse;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;

    this.icon = icon;
    this.onDialogButtonClickListener = onDialogButtonClickListener;
  }

  @Override public void onPermissionDenied(PermissionDeniedResponse response) {
    super.onPermissionDenied(response);

    new AlertDialog.Builder(context)
        .setTitle(title)
        .setMessage(message)
        .setPositiveButton(positiveButtonText, new DialogInterface.OnClickListener() {
          @Override public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
            onDialogButtonClickListener.onClick();
          }
        })
        .setIcon(icon)
        .show();
  }

  /**
   * Builder class to configure the displayed dialog.
   * Non set fields will be initialized to an empty string.
   */
  public static class Builder {
    private final Context context;
    private String title;
    private String message;
    private String buttonText;
    private Drawable icon;
    private OnDialogButtonClickListener onDialogButtonClickListener;