onBeforeTextSelectionChange

abstract fun onBeforeTextSelectionChange(@Nullable newTextSelection: TextSelection, @Nullable currentTextSelection: TextSelection): Boolean

Called every time the text selection is about to be changed. It is called before the current text selection is changed, given the listener the possibility to prevent selection, deselection or alteration of selection.

Return

true if the selection should be applied or false if the current selection state should be left untouched.

Parameters

newTextSelection

TextSelection that is going to be selected or null if the active selection is going to be cleared.

currentTextSelection

The active TextSelection or null if there is no active selection right now.