Prashant Priyadarshi
01/03/2021, 3:49 AMColton Idle
01/03/2021, 4:28 AMPrashant Priyadarshi
01/03/2021, 5:31 AMPrashant Priyadarshi
01/03/2021, 5:32 AMzoha131
01/03/2021, 6:36 AMPrashant Priyadarshi
01/03/2021, 7:55 AMzoha131
01/03/2021, 4:07 PMPrashant Priyadarshi
01/04/2021, 3:26 AM<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.LearnCompose.NoActionBar">
below is the sample code and I have also attached the screen shot
@Composable
fun scaffoldWithTwoInputs(){
val topText = remember { mutableStateOf("") }
val bottomText = remember { mutableStateOf("") }
val modifier = Modifier.fillMaxWidth()
Scaffold(modifier = Modifier.fillMaxSize(),
topBar = {
OutlinedTextField(value = topText.value,
onValueChange = {s-> topText.value = s }, modifier = modifier)
},
bodyContent = {
Column(modifier = modifier.padding(50.dp), verticalArrangement = Arrangement.Center) {
Text(text = topText.value, style = typography.h6, color = Color.Black)
Text(text = bottomText.value, style = typography.h6, color = Color.Black)
}
},
bottomBar = {
OutlinedTextField(value = bottomText.value, onValueChange = {s-> bottomText.value = s },
modifier = modifier)
}
)
}
Prashant Priyadarshi
01/04/2021, 3:27 AMzoha131
01/04/2021, 8:05 AMbottomBar
. But from you first message I thought You want to hide the bottom nav when keyboard is visible in the screen. Can you please clear what do want to achieve?
You can use this library to detect if keyboard is visible or not.