refresh

abstract fun refresh(force: Boolean = false)

Re-render contents if view element dimensions have changed. If the force parameter is set to true, the content is re-rendered regardless if the view element dimensions changed.

If responsiveRendererSelectionEnabled is true, this method may switch activeRenderer.

The current reading position, if any, is kept. This method should be called when the view element has been resized in order for the renderer to use the new dimensions.

Note that calls to refresh() are quite expensive. Therefore, there is a built-in delay such that multiple calls to refresh() within a short time-span will internally be merged into a single refresh() call. You can configure the length of this delay using the ReaderViewOptions.refreshDelayMs option.

This method does nothing if there is no renderer assigned to this ReaderView, renderTo() has not been called yet, or if the list of readerDocuments is empty.

Parameters

force
  • If true, re-render contents regardless if the view element dimensions changed. Defaults to false.