fix buttons

This commit is contained in:
Mylloon 2023-12-19 12:16:10 +01:00
parent dbcdb47dfe
commit dd922b0b38
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -103,7 +103,6 @@ fun HomeScreen(padding: PaddingValues, model: HomeViewModel = viewModel()) {
ActionRow(context, model) ActionRow(context, model)
Button( Button(
modifier = Modifier.fillMaxWidth(0.9f),
onClick = { Toast.makeText(context, "Start", Toast.LENGTH_SHORT).show() }) { onClick = { Toast.makeText(context, "Start", Toast.LENGTH_SHORT).show() }) {
Text(text = context.getString(R.string.main_button_start), fontSize = 30.sp) Text(text = context.getString(R.string.main_button_start), fontSize = 30.sp)
} }
@ -121,19 +120,24 @@ private fun DeleteRow(
) { ) {
Row( Row(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,/*, horizontalArrangement = Arrangement.SpaceEvenly*/ horizontalArrangement = Arrangement.Center
) { ) {
Button(onClick = { Button(
(model::doAction)(ActionHome.DELETION_DB) onClick = {
}, colors = ButtonDefaults.buttonColors(containerColor = colorResource(id = R.color.red))) { (model::doAction)(ActionHome.DELETION_DB)
},
colors = ButtonDefaults.buttonColors(containerColor = colorResource(id = R.color.red))
) {
Text(text = context.getString(R.string.main_button_deletebase)) Text(text = context.getString(R.string.main_button_deletebase))
} }
Spacer(modifier = Modifier.padding(2.dp)) Spacer(modifier = Modifier.padding(2.dp))
Button(onClick = { Button(
(model::doAction)(ActionHome.DELETION_SELECT) enabled = false, /*TODO: Activer uniquement quand on a qqch de sélectionner */
}) { onClick = {
(model::doAction)(ActionHome.DELETION_SELECT)
}) {
Text(text = context.getString(R.string.main_button_delete)) Text(text = context.getString(R.string.main_button_delete))
} }
} }
@ -296,7 +300,7 @@ fun ShowList(
) { ) {
LazyColumn( LazyColumn(
Modifier Modifier
.fillMaxHeight(0.7f) .fillMaxHeight(0.6f)
) { ) {
itemsIndexed(sets) { index, item -> itemsIndexed(sets) { index, item ->
ListItem(index, item, currentSelection, updateSelection) ListItem(index, item, currentSelection, updateSelection)