I am trying to create scrollbar with vertically scrollable Column. scrollbarOffsetY does change but...
c
I am trying to create scrollbar with vertically scrollable Column. scrollbarOffsetY does change but I don't know why the y position offset doesn't work visually. Why is that? https://github.com/chanjungkim/compose/blob/develop/compose/src/main/java/com/github/chanjungkim/compose/ScrollColumn.kt
c
for desktop?
Which library should I import?
I am making android app though
e
those composables are currently provided for desktop only, but they do not depend on anything desktop-specific. you can see how they work and implement something similar, or just copy them
(they do depend on an
internal fun detectTapAndPress()
, but you can also see all the code for that, it's simple: https://github.com/androidx/androidx/blob/androidx-main/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt#L226)
c
Well... it doesn't seem so.
I need those
I hope those are the last one.
e
don't copy that file, just re-implement the one function
or use
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
to ignore
internal
and use it anyway
(as long as you're aware that doing so may break in the future)
c
I have no idea..
e
as I said: don't copy that file
either re-implement that one function with public APIs (it's not that hard), or bypass visibility to import that one function only
c
Okay, I fixed that.
But it doesn't have content argument. How can I pass the content?
e
it includes documentation on how to use it!
there is no content argument because it can be used with anything scrollable, whether it is lazy or not
c
Hmm. Okay, The bar finally is visible now. I think I should resize and change the behaviour..
How can I change the height?
just implemented without desktop scrollbar. https://www.youtube.com/shorts/HfyB6nMHheM