https://kotlinlang.org logo
Title
c

chanjungskim

04/19/2023, 3:47 PM
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

chanjungskim

04/20/2023, 12:35 AM
for desktop?
Which library should I import?
I am making android app though
e

ephemient

04/20/2023, 3:18 AM
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

chanjungskim

04/20/2023, 3:23 AM
Well... it doesn't seem so.
I need those
I hope those are the last one.
e

ephemient

04/20/2023, 3:25 AM
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

chanjungskim

04/20/2023, 3:28 AM
I have no idea..
e

ephemient

04/20/2023, 3:31 AM
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

chanjungskim

04/20/2023, 3:36 AM
Okay, I fixed that.
But it doesn't have content argument. How can I pass the content?
e

ephemient

04/20/2023, 3:39 AM
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

chanjungskim

04/20/2023, 3:42 AM
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