// 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/SettingsClickListener.java
// public class SettingsClickListener implements View.OnClickListener {
//     @Override
//     public void onClick(View view) {
//         Context context = view.getContext();
//         Intent myAppSettings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
//                 Uri.parse("package:" + context.getPackageName()));
//         myAppSettings.addCategory(Intent.CATEGORY_DEFAULT);
//         myAppSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//         context.startActivity(myAppSettings);
//     }
// }
// 
// Path: dexter/src/main/java/com/karumi/dexter/listener/SnackbarUtils.java
// public class SnackbarUtils {
// 
//     public static void show(View view, String text, int duration, String buttonText,
//             View.OnClickListener onButtonClickListener,
//             BaseTransientBottomBar.BaseCallback<Snackbar> snackbarCallback) {
//         Snackbar snackbar = Snackbar.make(view, text, duration);
//         if (buttonText != null && onButtonClickListener != null) {
//             snackbar.setAction(buttonText, onButtonClickListener);
//         }
//         if (snackbarCallback != null) {
//             snackbar.addCallback(snackbarCallback);
//         }
//         snackbar.show();
//     }
// }


import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import com.karumi.dexter.listener.PermissionDeniedResponse;
import com.karumi.dexter.listener.SettingsClickListener;
import com.karumi.dexter.listener.SnackbarUtils;
import androidx.annotation.StringRes;
  /**
   * Builder class to configure the displayed snackbar
   * Non set fields will not be shown
   */
  public static class Builder {
    private final View view;
    private final String text;
    private String buttonText;
    private View.OnClickListener onClickListener;
    private Snackbar.Callback snackbarCallback;
    private int duration = Snackbar.LENGTH_LONG;

    private Builder(View view, String text) {
      this.view = view;
      this.text = text;
    }

    public static Builder with(View view, String text) {
      return new Builder(view, text);
    }

    public static Builder with(View view, @StringRes int textResourceId) {
      return Builder.with(view, view.getContext().getString(textResourceId));
    }

    /**
     * Adds a text button with the provided click listener
     */
    public Builder withButton(String buttonText, View.OnClickListener onClickListener) {
      this.buttonText = buttonText;
// 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/SettingsClickListener.java
// public class SettingsClickListener implements View.OnClickListener {
//     @Override
//     public void onClick(View view) {
//         Context context = view.getContext();
//         Intent myAppSettings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
//                 Uri.parse("package:" + context.getPackageName()));
//         myAppSettings.addCategory(Intent.CATEGORY_DEFAULT);
//         myAppSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//         context.startActivity(myAppSettings);
//     }
// }
// 
// Path: dexter/src/main/java/com/karumi/dexter/listener/SnackbarUtils.java
// public class SnackbarUtils {
// 
//     public static void show(View view, String text, int duration, String buttonText,
//             View.OnClickListener onButtonClickListener,
//             BaseTransientBottomBar.BaseCallback<Snackbar> snackbarCallback) {
//         Snackbar snackbar = Snackbar.make(view, text, duration);
//         if (buttonText != null && onButtonClickListener != null) {
//             snackbar.setAction(buttonText, onButtonClickListener);
//         }
//         if (snackbarCallback != null) {
//             snackbar.addCallback(snackbarCallback);
//         }
//         snackbar.show();
//     }
// }


// Path: dexter/src/main/java/com/karumi/dexter/listener/single/SnackbarOnPermanentlyDeniedPermissionListener.java
import android.view.View;
import com.google.android.material.snackbar.Snackbar;
import com.karumi.dexter.listener.PermissionDeniedResponse;
import com.karumi.dexter.listener.SettingsClickListener;
import com.karumi.dexter.listener.SnackbarUtils;
import androidx.annotation.StringRes;

  /**
   * Builder class to configure the displayed snackbar
   * Non set fields will not be shown
   */
  public static class Builder {
    private final View view;
    private final String text;
    private String buttonText;
    private View.OnClickListener onClickListener;
    private Snackbar.Callback snackbarCallback;
    private int duration = Snackbar.LENGTH_LONG;

    private Builder(View view, String text) {
      this.view = view;
      this.text = text;
    }

    public static Builder with(View view, String text) {
      return new Builder(view, text);
    }

    public static Builder with(View view, @StringRes int textResourceId) {
      return Builder.with(view, view.getContext().getString(textResourceId));
    }

    /**
     * Adds a text button with the provided click listener
     */
    public Builder withButton(String buttonText, View.OnClickListener onClickListener) {
      this.buttonText = buttonText;
      this.onClickListener = onClickListener;