From 1cfb88ed47a13a487c57b5adf02bf15a4456becb Mon Sep 17 00:00:00 2001 From: Kailash Sharma Date: Sun, 26 Nov 2023 00:22:47 +0530 Subject: [PATCH] Did you find the waste at the given Location --- .../com/collectwaste/CollectWasteInfo.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/waste2wealth/com/collectwaste/CollectWasteInfo.kt b/app/src/main/java/app/waste2wealth/com/collectwaste/CollectWasteInfo.kt index d5d1914..7f90668 100644 --- a/app/src/main/java/app/waste2wealth/com/collectwaste/CollectWasteInfo.kt +++ b/app/src/main/java/app/waste2wealth/com/collectwaste/CollectWasteInfo.kt @@ -73,6 +73,7 @@ fun CollectWasteInfo( ) { val context = LocalContext.current var isDialogVisible by remember { mutableStateOf(false) } + var isDialogMainVisible by remember { mutableStateOf(false) } val isWithin = isWithinRadius( viewModel.latitude, viewModel.longitude, @@ -187,8 +188,7 @@ fun CollectWasteInfo( if (!isWithin) { isDialogVisible = true } else { - viewModel.beforeCollectedPath.value = viewModel.wastePhoto.value - navController.navigate(Screens.CollectedWasteSuccess.route) + isDialogMainVisible = true } }, colors = ButtonDefaults.buttonColors( @@ -224,6 +224,21 @@ fun CollectWasteInfo( } ) } + + DialogBox( + isVisible = isDialogMainVisible, + title = "Did you find the waste at the given location?", + description = "", + successRequest = { + isDialogVisible = false + viewModel.beforeCollectedPath.value = viewModel.wastePhoto.value + navController.navigate(Screens.CollectedWasteSuccess.route) + }, + dismissRequest = { + isDialogMainVisible = false + } + ) + } }