This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // we would be writing this reptitive code multiple times for similar dialogs | |
| MaterialAlertDialogBuilder(context) | |
| .setTitle(R.string.confirmation_dialog_title) | |
| .setMessage(R.string.confirmation_dialog_message) | |
| .setIcon(R.drawable.ic_feedback) | |
| .setPositiveButton("Okay") { _, _ -> | |
| deleteItem() | |
| } | |
| .setNegativeButton("Cancel", null) | |
| .setCancelable(false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import androidx.compose.foundation.layout.Arrangement | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.material3.Button | |
| import androidx.compose.material3.Text | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.MutableState | |
| import androidx.compose.runtime.mutableStateOf | |
| import androidx.compose.runtime.remember | |
| import androidx.compose.ui.Alignment |