scrollBy

abstract fun scrollBy(length: Length, options: ReaderViewScrollByOptions = ReaderViewScrollByOptions(), onSuccess: () -> Unit = {}, onError: (ColibrioException) -> Unit = {})

Scrolls a scrolling renderer's content by the specified amount. Relative values such as PERCENTAGE will be based on the ReaderView's height.

Parameters

length

The length to scroll.

options
  • Additional options configuring how the scrollBy() should behave.

onSuccess

Called when the scrolling animation has finished, or immediately if animations are disabled.

onError

Called with errorType set to "ABORTED" if any other view operation or user scroll cancels the animation, or with errorType set to "INVALID_RENDERER" if the active renderer is not a scrolling renderer.


abstract suspend fun scrollBy(length: Length, options: ReaderViewScrollByOptions = ReaderViewScrollByOptions()): ColibrioResult<Unit>

Scrolls a scrolling renderer's content by the specified amount. Relative values such as PERCENTAGE will be based on the ReaderView's height.

Return

Either ColibrioResult.Success when the scrolling animation has finished, or immediately if animations are disabled, or ColibrioResult.Error with errorType set to "ABORTED" if any other view operation or user scroll cancels the animation, or with errorType set to "INVALID_RENDERER" if the active renderer is not a scrolling renderer.

Parameters

length

The length to scroll.

options
  • Additional options configuring how the scrollBy() should behave.