Created
June 21, 2021 16:30
-
-
Save sergenes/e77a10f72caf6e9996d63fb7d57b201c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var deleteMode by remember { mutableStateOf(false) } | |
| if (editMode && !deleteMode) { | |
| Button( | |
| onClick = { | |
| deleteMode = !deleteMode | |
| }, modifier = Modifier | |
| .width(deleteButtonWidth) | |
| .fillMaxHeight(), | |
| shape = RoundedCornerShape(noRadius), | |
| colors = ButtonDefaults.outlinedButtonColors( | |
| contentColor = Color.Red, | |
| backgroundColor = scColors.primary | |
| ) | |
| ) { | |
| Icon( | |
| imageVector = Icons.Filled.DeleteForever, | |
| contentDescription = "delete", | |
| modifier = Modifier | |
| .align(Alignment.CenterVertically) | |
| ) | |
| } | |
| } |
Author
To use the by operator you have to import runtime.setValue
import androidx.compose.runtime.setValue
Ok, I see now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I might be doing something wrong, but on the first line I get an error:
Type TypeVariable(T) has no method getValue(Nothing?, KProperty<*>) and thus it cannot serve as a delegateChanging the by to a = solve the error, but I'm still trying to understand the code.