https://kotlinlang.org logo
#compose
Title
# compose
v

vide

03/24/2023, 4:10 PM
Any pointers on how to use BringIntoViewRequester properly with padding around boundaries? I have used an approach of using a custom rect with
.bringIntoView()
before but this seems to break after
1.4.0-alpha03
. 🧵
This is how it used to work
This is how the same code "works" on
1.4.0
The idea is to scroll so that there's always a little bit of the next big square showing.
This is the bigger square container:
Copy code
.border(2.dp, Color.Black)
.bringIntoViewRequester(bringIntoViewRequester)
.focusProperties { canFocus = false }
.onFocusChanged {
    if (it.isFocused) {
        scope.launch {
            bringIntoViewRequester.bringIntoView(
                Rect(-200F, -200F, 200F, 200F)
            )
        }
    }
}
.focusTarget()
I am not sure if this is a bug or if it has never been the correct approach to this 😅
15 Views