Class NotificationUtils

java.lang.Object
com.example.iconic_raffleevent.NotificationUtils

public class NotificationUtils extends Object
Utility class for creating and sending notifications. Can be called from multiple activities, allowing organizers to send a custom notification to multiple users.
  • Constructor Details

    • NotificationUtils

      public NotificationUtils()
  • Method Details

    • showNotificationDialog

      public static void showNotificationDialog(android.content.Context context, ArrayList<User> users, Event event)
      Generates a dialog allowing an organizer to type and send a custom notification
      Parameters:
      context - context dialog is being opened in
      users - list of users to send the notification to
      event - event related to notification
    • validateNotification

      public static Boolean validateNotification(com.google.android.material.textfield.TextInputLayout notificationMessageLayout, com.google.android.material.textfield.TextInputEditText notificationMessage)
      Ensure notification message is not empty
      Parameters:
      notificationMessageLayout - layout for the notification message
      notificationMessage - notification message
      Returns:
      True if notification message is valid, False otherwise
    • sendNotification

      public static void sendNotification(android.content.Context context, ArrayList<User> users, Event event, String message, android.app.AlertDialog dialog)
      Sends a notification to the specified list of users
      Parameters:
      context - context dialog exists in
      users - lists of users notification is being sent too
      event - event notification is related to
      message - notification message
      dialog - notification dialog