-
-
Save aaronjyoder/c10c214f8c816fea28ba23fe6658b862 to your computer and use it in GitHub Desktop.
This file contains 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
@Composable | |
fun MyInterface(model: MyViewModel, modifier: Modifier) { | |
Column() { | |
Text("Heading 1") | |
TextField( | |
model.headingOne, | |
singleLine = true, | |
onValueChange = { | |
model.headingOne = it | |
} | |
) | |
Spacer(modifier = Modifier.height(5.dp)) | |
Text("Heading 2") | |
TextField( | |
model.headingTwo, | |
singleLine = true, | |
onValueChange = { | |
model.headingTwo = it | |
} | |
) | |
Spacer(modifier = Modifier.height(5.dp)) | |
// Toggle things after this point | |
if(model.isSelectingRegion() || model.isSelectingTerritory()) { | |
Divider(color = Color.LightGray, thickness = 2.dp) | |
Spacer(modifier = Modifier.height(5.dp)) | |
Text("Heading 3") | |
TextField( | |
model.headingThree, | |
singleLine = true, | |
onValueChange = { | |
model.headingThree = it | |
} | |
) | |
Spacer(modifier = Modifier.height(5.dp)) | |
Button( | |
onClick = { | |
if(model.isSelectingTerritory()) { | |
// do something | |
} else if(model.isSelectingRegion() { | |
// do something else | |
} | |
} | |
) { | |
if (model.isSelectingTerritory()) { | |
Text("Submit", fontSize = 14.sp) | |
} else if (model.isSelectingRegion()) { | |
Text("Add", fontSize = 14.sp) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment