Adil
05/13/2024, 3:12 PMColumn(modifier = Modifier.fillMaxWidth()) {
Row(modifier = Modifier.fillMaxWidth()) {
TextField(
placeholder = placeholder,
label = label,
modifier = Modifier
.fillMaxWidth()
.onGloballyPositioned { coordinates ->
textFieldSize = coordinates.size.toSize()
},
value = category,
onValueChange = {
category = it
expanded = true
onValueChange(it)
},
isError = false,
supportingText = null,
trailingIcon = {
IconButton(onClick = { expanded = !expanded }) {
Icon(
modifier = Modifier.size(24.dp),
imageVector = Icons.Rounded.KeyboardArrowDown,
contentDescription = "arrow",
tint = Color.Green
)
}
}
)
}
AnimatedVisibility(visible = expanded) {
Card(
modifier = Modifier
.padding(horizontal = 5.dp)
.width(textFieldSize.width.dp),
elevation = 15.dp,
shape = RoundedCornerShape(10.dp)
) {
LazyColumn(
modifier = Modifier.heightIn(max = 150.dp),
) {
items(
monitoredSpaces.count()
) {
Items(title = monitoredSpaces[it].name) { title ->
category = title
expanded = false
}
}
}
}
}
}
}
Shane Schaefer
05/13/2024, 4:08 PMModifier.imePadding()
help?youssef hachicha
05/13/2024, 6:13 PMAdil
05/14/2024, 9:14 AM