How can I know if a `ScrollableState` is scrollabl...
# compose
t
How can I know if a
ScrollableState
is scrollable aka all the content is already being shown?
m
ScrollableState
itself has nothing to do with layout, so this information is not really there and is not accessible. Other states and use ScrollableState, eg.
LazyListState
and
ScrollState
contain this information in different shapes, e.g
ScrollState::maxValue
or
LazyListState:layoutInfo
t
Sorry, I was actually talking about
ScrollState
, my bad. I’m using
maxValue
to auto scroll but I want to hide the button if all content is already fitting the screen, I couldn’t figure how can I do this using
ScrollState
m
If content fits the screen,
maxValue
would be 0, as there's no place for scrolling
t
That works! Thanks Matvei!
👍 1