fix button selection
This commit is contained in:
parent
9cd7bd672b
commit
5f697980f7
1 changed files with 3 additions and 1 deletions
|
@ -122,6 +122,8 @@ fun HomeScreen(padding: PaddingValues, model: HomeViewModel = viewModel()) {
|
||||||
private fun DeleteRow(
|
private fun DeleteRow(
|
||||||
context: Context, model: HomeViewModel
|
context: Context, model: HomeViewModel
|
||||||
) {
|
) {
|
||||||
|
val selection by model.selected
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center
|
modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center
|
||||||
) {
|
) {
|
||||||
|
@ -136,7 +138,7 @@ private fun DeleteRow(
|
||||||
|
|
||||||
Spacer(modifier = Modifier.padding(2.dp))
|
Spacer(modifier = Modifier.padding(2.dp))
|
||||||
|
|
||||||
Button(enabled = false, /*TODO: Activer uniquement quand on a qqch de sélectionner */
|
Button(enabled = selection != null,
|
||||||
onClick = {
|
onClick = {
|
||||||
(model::doAction)(ActionHome.DELETION_SELECT)
|
(model::doAction)(ActionHome.DELETION_SELECT)
|
||||||
}) {
|
}) {
|
||||||
|
|
Reference in a new issue