IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

UI - Warning Message for Saving Meal #196

Closed BeepDroid closed 2 months ago

BeepDroid commented 2 months ago

UI - Warning Message for Saving Meal

Description:


Added an alter dialog for when users go to save their meals, informing them that the action would overrite the current meal plan they have saved.

Expected vs. Actual Behavior:


A warning message popup upon button click and a button to dismiss it.

Code Snippets:



 saveMealButton.setOnClickListener {
            val context: Context = saveMealButton.context

            val builder = android.app.AlertDialog.Builder(context)
            builder.setTitle("Warning!")
            builder.setMessage("This action will override any previously saved meals for this current plan.")
            builder.setPositiveButton("OK",null)
            for (meal in meals) {
                dbHelper.insertMeal(meal)
                println("Meals Saved!")
            }
        }

Environment Details:


Android Studio, Windows OS.

Current Status:


Finished