This commit is contained in:
Mylloon 2023-12-19 11:29:22 +01:00
parent a98e9d34e3
commit 9ed25aaab4
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 25 additions and 17 deletions

View file

@ -119,8 +119,10 @@ private fun DeleteRow(
context: Context,
model: HomeViewModel
) {
Row(modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,/*, horizontalArrangement = Arrangement.SpaceEvenly*/) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,/*, horizontalArrangement = Arrangement.SpaceEvenly*/
) {
Button(onClick = {
(model::doAction)(ActionHome.DELETION_DB)
}, colors = ButtonDefaults.buttonColors(containerColor = colorResource(id = R.color.red))) {

View file

@ -68,19 +68,23 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
ActionHome.CREATION -> {
creation.value = true
}
ActionHome.IMPORTATION -> {
importation.value = true
}
ActionHome.MODIFIER -> {
if (selected.value != null) {
modification.value = true
}
}
ActionHome.DELETION_SELECT -> {
if (selected.value != null) {
deletionSelect.value = true
}
}
ActionHome.DELETION_DB -> {
deletionDB.value = true
}
@ -114,9 +118,11 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
fun dismissCreation() {
creation.value = false
}
fun dismissModification() {
modification.value = false
}
fun dismissImportation() {
importation.value = false
}