Skip to content

Add a Feature to Disable a Particular Meal Notification #5

@theayushyadav11

Description

@theayushyadav11

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:

  1. Add a toggle switch in the Settings UI (inside SettingsActivity.kt) to allow enabling/disabling meal notifications.
  2. Modify AlarmManager logic (inside AlarmHelper.kt) to check if a meal is disabled before scheduling the notification.
  3. 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:

  1. A user goes to Settings and turns OFF notifications for Lunch.
  2. The app saves this preference so that the alarm for Lunch is never scheduled.
  3. The user still receives notifications for Breakfast, Snacks, and Dinner as usual.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions