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, context: Context,
model: HomeViewModel model: HomeViewModel
) { ) {
Row(modifier = Modifier.fillMaxWidth(), Row(
horizontalArrangement = Arrangement.Center,/*, horizontalArrangement = Arrangement.SpaceEvenly*/) { modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,/*, horizontalArrangement = Arrangement.SpaceEvenly*/
) {
Button(onClick = { Button(onClick = {
(model::doAction)(ActionHome.DELETION_DB) (model::doAction)(ActionHome.DELETION_DB)
}, colors = ButtonDefaults.buttonColors(containerColor = colorResource(id = R.color.red))) { }, colors = ButtonDefaults.buttonColors(containerColor = colorResource(id = R.color.red))) {

View file

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