can someone help me understand what I might be doi...
# compose
a
can someone help me understand what I might be doing wrong. I am using insets v0.13 (haven't upgraded to compose 1.0 yet). Whenever I tap the TextField, the first time the padding from the inserts work perfectly however, on subsequent runs the padding seems like it's doubled somehow. (Code in thread)
this is how I've structured my layout and this composable is hosted inside a modal bottom sheet composable
Copy code
BoxWithConstraints {
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .height(maxHeight - 20.dp)
            .background(ScoutTheme.colors.secondaryBackground)
            .verticalScroll(state = scrollState)
    ) {
        Column(modifier = Modifier.navigationBarsWithImePadding()) {
            Header(game = game)
            SelectPlatform(game = game, isPlatformSelected = { platformSelections.contains(it) }) { platform ->
                if (platformSelections.contains(platform)) {
                    platformSelections.remove(platform)
                } else {
                    platformSelections.add(platform)
                }
            }
            GameStatus(isGameStatusSelected = { gameStatusSelection == it }) { gameStatus ->
                gameStatusSelection = gameStatus
            }
            if (gameStatusSelection != null && (gameStatusSelection == GameStatus.COMPLETED || gameStatusSelection == GameStatus.ABANDONED)) {
                RatingAndNotes(currentRating = ratingSelection, updateRating = { ratingSelection = it }, notes = notes) {
                    notes = it
                }
            }
            Spacer(modifier = Modifier.height(20.dp))
        }
    }
}
d
Maybe better approach is to use
RelocationRequester.bringIntoView
?
t
I've found the bottom sheet implementations seem to have a lot of caveats at the moment. I am still trying to work out whether I am doing things wrong myself or whether the Experimental tags are really very serious. My issues also surround interaction with the ime.
a
RelocationRequester doesn't work properly
t
From what I can tell, the relocation requester appears to work in bringing the widget into view, where in view means it is wholly inside the window boundary. When I've used
Column(Modifier.imePadding())
I've had success in bring a view above the soft keyboard, but only when using a coroutine that polls the ime every frame for the completion of its animation and only then calling RelocationRequester. However, the scroll state gets reset by Column when it gets resized. I am currently looking into another approach, whereby I call
ScollState.scrollBy(dy)
with dy = distance the view is below the top edge of the ime inset.
b
any updates?