thailanrg
12/30/2024, 2:40 AMandroid:windowSoftInputMode="adjustResize"
in my manifest, set DecorFitsSystemWindows(window, false)
in my activity's onCreate
, and finally assigned windowInsets = WindowInsets.ime
in my modal. Despite this configuration, my keyboard still overlaps my input.
I need help. Can someone assist me?
<activity
android:name=".MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustNothing"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setDecorFitsSystemWindows(window, false)
ModalBottomSheet(
sheetState = sheetState,
windowInsets = WindowInsets.ime
)
nuhkoca
12/30/2024, 10:38 AMthailanrg
12/30/2024, 11:45 AMverticalScroll
in my box.
ModalBottomSheet(
onDismissRequest = { onEvent(OnMainIntent.OnCreateListBottomSheetStateChange) },
sheetState = sheetState,
windowInsets = WindowInsets.ime
) {
Box(
modifier = Modifier
.fillMaxSize()
.verticalScroll(state = rememberScrollState())
.padding(
bottom = 40.dp,
end = 16.dp,
start = 16.dp
)
) {
IconButton(modifier = Modifier
.align(Alignment.TopEnd)
.offset(x = (-10).dp, y = (-46).dp),
onClick = {
scope.launch { sheetState.hide() }.invokeOnCompletion {
if (!sheetState.isVisible) {
onEvent(OnCreateListBottomSheetStateChange)
}
}
}) {
Icon(Icons.Filled.Clear, "Floating action button.")
}
Column(
verticalArrangement = Arrangement.spacedBy(14.dp),
) {
Form(
formsName = "Titulo",
label = "ex: Aniversario",
maxLine = 1,
value = uiState.title,
onValueChange = {
onEvent(OnTitleChange(it))
},
)
Form(
formsName = stringResource(R.string.description_create_list_modal_sheet),
label = "ex: Teremos cerca de 120 convidados, entre adultos e criancas",
maxLine = 1,
value = uiState.description,
onValueChange = {
onEvent(OnDescriptionChange(it))
},
)
Button(
modifier = Modifier.fillMaxWidth(),
onClick = {
onEvent(
OnCreateList(
MyListDto(
title = uiState.title,
description = uiState.description
)
)
)
onEvent(OnInitUi)
onEvent(OnCreateListBottomSheetStateChange)
}
) {
Text("Criar lista")
}
}
}
}
nuhkoca
12/30/2024, 11:50 AMBox
with a verticalScroll
enabled would ever work. Try replacing Box
to Column
or wrap your content in a Column
with verticalScroll
enabled insteadthailanrg
12/30/2024, 6:57 PM