-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Currently, the app allows users to change the timing of meal notifications using the alarm system. However, there is no option to disable notifications for a specific meal (e.g., Breakfast, Lunch, Snacks, or Dinner). Users should have the ability to toggle notifications ON/OFF for each meal based on their preference.
Expected Behavior:
- Users should be able to disable/enable notifications for individual meals.
- If a meal notification is disabled, the corresponding alarm should not be set.
- The selection should be saved persistently so that notifications remain disabled even after restarting the app.
Proposed Implementation:
- Add a toggle switch in the Settings UI (inside
SettingsActivity.kt) to allow enabling/disabling meal notifications. - Modify AlarmManager logic (inside
AlarmHelper.kt) to check if a meal is disabled before scheduling the notification. - Store the user’s preferences using SharedPreferences (inside
Mess.kt).
Files to Modify:
SettingsActivity.kt→ Add UI for enabling/disabling notifications for specific meals.MainActivity.kt→ Modify logic to prevent setting alarms for disabled meals.Mess.kt→ Add methods to store and retrieve meal notification preferences.
Example Scenario:
- A user goes to Settings and turns OFF notifications for Lunch.
- The app saves this preference so that the alarm for Lunch is never scheduled.
- The user still receives notifications for Breakfast, Snacks, and Dinner as usual.
- If the user re-enables Lunch notifications, the alarm is scheduled again.
Benefits of This Feature:
✅ Improved user control over notifications.
✅ Reduces unwanted interruptions for meals users do not want notifications for.
✅ Enhances the customization of the app’s notification system.
Attach screenshot for the UI changes.