Package com.example.iconic_raffleevent
Class NotificationUtils
java.lang.Object
com.example.iconic_raffleevent.NotificationUtils
Utility class for creating and sending notifications. Can be called from multiple activities,
allowing organizers to send a custom notification to multiple users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsendNotification(android.content.Context context, ArrayList<User> users, Event event, String message, android.app.AlertDialog dialog) Sends a notification to the specified list of usersstatic voidshowNotificationDialog(android.content.Context context, ArrayList<User> users, Event event) Generates a dialog allowing an organizer to type and send a custom notificationstatic BooleanvalidateNotification(com.google.android.material.textfield.TextInputLayout notificationMessageLayout, com.google.android.material.textfield.TextInputEditText notificationMessage) Ensure notification message is not empty
-
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 inusers- list of users to send the notification toevent- 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 messagenotificationMessage- 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 inusers- lists of users notification is being sent tooevent- event notification is related tomessage- notification messagedialog- notification dialog
-