Mario Andhika
12/07/2023, 6:40 AMMario Andhika
12/07/2023, 6:57 AMColumn(
Modifier
.wrapContentSize()
.verticalScroll(rememberScrollState())
, horizontalAlignment = Alignment.CenterHorizontally
) {
when (state) {
SurveyDialogState.Prompt -> {
Text("Want to fill survey?")
Row(modifier = Modifier.fillMaxWidth().padding(12.dp), horizontalArrangement = Arrangement.SpaceBetween) {
Button({ showDialog = false }) {
Text("Skip")
}
Button(
{ state = SurveyDialogState.Questions }
) {
Text("Fill Survey")
}
}
}
SurveyDialogState.Questions -> {
val questions = listOf(
"",
"",
"",
"",
""
)
questions.forEach {
Text(modifier = Modifier.padding(12.dp), text = it)
OutlinedTextField(value = "", onValueChange = {}, minLines = 2)
}
Button(
{
scope.launch {
state = SurveyDialogState.Loading
delay(2000)
state = SurveyDialogState.Thanks
}
},
colors = ButtonDefaults.buttonColors(containerColor = ZealsMainBg)) {
Text("Submit")
}
}
SurveyDialogState.Loading -> {
Column(Modifier.padding(20.dp), horizontalAlignment = Alignment.CenterHorizontally) {
Text("Sending your answers...")
CircularProgressIndicator()
}
}
SurveyDialogState.Thanks -> {
Column(Modifier.padding(20.dp)) {
Text("Thanks")
Row(modifier = Modifier.fillMaxWidth().padding(12.dp), horizontalArrangement = Arrangement.End) {
Button({ showDialog = false }) {
Text("Close")
}
}
}
}
}
}
Zach Klippenstein (he/him) [MOD]
12/07/2023, 3:54 PMwrapContentHeight
sets the minimum height to zero. If you want to make the container fill the height, use fillMaxHeight
to set the minimum height to the incoming max height constraint.Mario Andhika
12/08/2023, 7:41 AMZach Klippenstein (he/him) [MOD]
12/08/2023, 7:49 PM