Struggling to get a chat-like interface behaving c...
# compose
p
Struggling to get a chat-like interface behaving correctly - I'm using accompanist-insets to set the padding, but about half the time it shoots the textfield nearly to the top of the screen.
Copy code
@Composable
@Preview
private fun InsetsTest() {
  val activity = LocalContext.current as Activity
  WindowCompat.setDecorFitsSystemWindows(activity.window, false)

  MaterialTheme {
    ProvideWindowInsets {

      val text = remember { mutableStateOf("") }

      Column(
        Modifier
          .fillMaxSize()
          .background(Color.White)
      ) {
        Box(
          Modifier
            .fillMaxWidth()
            .weight(1f)
            .background(Color.LightGray)
        )
        Column(
          Modifier
            .navigationBarsWithImePadding()
            .background(Color.Yellow)) {
          BasicTextField(
            text.value,
            { text.value = it },
            Modifier
              .fillMaxWidth()
              .heightIn(50.dp)
          )
          Box(Modifier.height(50.dp))
        }
      }
    }
  }
}
c
I can’t see anything obviously wrong from the code snippet FYI