You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
package example.todoapp.lite.common |
|
|
|
import androidx.compose.foundation.background |
|
import androidx.compose.foundation.layout.* |
|
import androidx.compose.material.Checkbox |
|
import androidx.compose.material.Text |
|
import androidx.compose.material.TextField |
|
import androidx.compose.runtime.Composable |
|
import androidx.compose.ui.Alignment |
|
import androidx.compose.ui.Modifier |
|
import androidx.compose.ui.graphics.Color |
|
import androidx.compose.ui.unit.dp |
|
|
|
@Composable |
|
internal fun EditDialog( |
|
item: TodoItem, |
|
onCloseClicked: () -> Unit, |
|
onTextChanged: (String) -> Unit, |
|
onDoneChanged: (Boolean) -> Unit, |
|
) { |
|
Dialog( |
|
title = "Edit todo", |
|
onCloseRequest = onCloseClicked, |
|
) { |
|
Column(horizontalAlignment = Alignment.CenterHorizontally) { |
|
TextField( |
|
value = item.text, |
|
modifier = Modifier.weight(1F).fillMaxWidth().sizeIn(minHeight = 192.dp), |
|
label = { Text("Todo text") }, |
|
onValueChange = onTextChanged, |
|
) |
|
|
|
Spacer(modifier = Modifier.height(8.dp)) |
|
|
|
Row { |
|
Text(text = "Completed", Modifier.padding(15.dp)) |
|
|
|
Checkbox( |
|
checked = item.isDone, |
|
onCheckedChange = onDoneChanged, |
|
) |
|
} |
|
} |
|
} |
|
}
|
|
|