https://kotlinlang.org logo
k

Kshitij Patil

02/17/2021, 1:09 PM
if
scrollState.smoothScrollBy()
(blocking) is deprecated, what are we supposed to replace it with (suspending) ? I didn’t understand the replacement from deprecated message. Who has
smoothScrollBy
method apart from Scrollable?
m

matvei

02/17/2021, 1:22 PM
Sorry about the confusion, due to name collapse it was hard to provide a meaningful Replacement in the @Deprecated.
smoothScrollBy
is not an extension function on the ScrollableState, which
ScrollState
and
LazyListState
implement. You are one import away from this since you need to import this extension function in order for it to work
k

Kshitij Patil

02/17/2021, 1:39 PM
(scrollState as Scrollable).smoothScrollBy(<value>)
worked for me. Is this right?
m

matvei

02/17/2021, 1:50 PM
This should work. In the next release the deprecated version will be removed and you won't need this trick
👍 1