Stefano Sansone
10/06/2021, 9:15 AMDialog(
onDismissRequest = onDismiss
) {
val scope = AlertActionScope(
onDismiss = onDismiss
)
Surface(
modifier = modifier,
shape = MaterialTheme.shapes.medium,
content = {
Container(
content = {
Container(
modifier = Modifier
.weight(
value = 1f,
fill = false
)
.padding(
all = when {
insetContent -> {
DialogPadding
}
else -> 0.dp
}
),
spacing = KeylineSmall,
content = {
if (title != null) {
Text(
text = title,
type = Title
)
}
if (content != null) {
CompositionLocalProvider(
LocalContentAlpha provides ContentAlpha.high,
LocalTextStyle provides MaterialTheme.typography.body2
) {
content()
}
}
}
)
if (negative != null || positive != null) {
FlowRow(
modifier = Modifier
.fillMaxWidth()
.padding(all = 8.dp),
mainAxisSpacing = 8.dp,
crossAxisSpacing = 12.dp,
mainAxisAlignment = FlowMainAxisAlignment.End
) {
negative?.invoke(scope)
positive?.invoke(scope)
}
}
}
)
}
)
}
Stefano Sansone
10/06/2021, 9:43 AMzokipirlo
10/06/2021, 10:59 AMColumn
inside text=
@Composable
fun HackySpacer(space: Dp) {
Box(
modifier = Modifier
.height(space)
.fillMaxWidth()
) {
Text(text = "")
}
}
Zoltan Demant
10/06/2021, 11:38 AMzokipirlo
10/06/2021, 11:46 AMTextField
is otherwise positioned over title. And only empty Text
"fixes" problem 🙂
I have a different problem.... it's keyboard, which isn't hidding as written here: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1633348928463500 AlertDialog is really crapy.Zoltan Demant
10/06/2021, 12:07 PMFocusManager.current.clearFocus
and LocalSoftwareKeyboardController.current?.hide()
🥲zokipirlo
10/06/2021, 12:21 PMval keyboardController = LocalSoftwareKeyboardController.current
outside AlertDialog
. Had to move it inside, and now it works 🙂 Thanks!