Package-level declarations
The spell-checking editor: SpellCheckingTextEditor, the SpellCheckState holder and its rememberSpellCheckState factory, and the SpellCheckMode (word vs. sentence) selector.
Types
Link copied to clipboard
Represents a spell check item that can be either a word-level misspelling or a sentence-level correction.
Link copied to clipboard
Determines which spell checking mode is active.
Link copied to clipboard
class SpellCheckState(val textState: TextEditorState, var spellChecker: EditorSpellChecker?, enableSpellChecking: Boolean = true, var spellCheckMode: SpellCheckMode = SpellCheckMode.Word, scanContext: CoroutineContext = Dispatchers.Default)
Link copied to clipboard
data class SpellCheckStrings(val loading: String, val noSuggestions: String, val ignore: String, val addToDictionary: String)
Localizable strings for the spell check context menu. Provide a custom implementation to localize the menu.
Functions
Link copied to clipboard
fun rememberSpellCheckState(spellChecker: EditorSpellChecker?, initialText: AnnotatedString? = null, enableSpellChecking: Boolean = true, spellCheckMode: SpellCheckMode = SpellCheckMode.Word): SpellCheckState
Remembers a SpellCheckState for the editor.
Link copied to clipboard
fun SpellCheckingTextEditor(spellChecker: EditorSpellChecker? = null, state: SpellCheckState = rememberSpellCheckState(spellChecker), modifier: Modifier = Modifier, contentPadding: PaddingValues = DefaultContentPadding, enabled: Boolean = true, autoFocus: Boolean = false, style: TextEditorStyle = rememberTextEditorStyle(), contextMenuStrings: ContextMenuStrings = ContextMenuStrings.Default, spellCheckStrings: SpellCheckStrings = SpellCheckStrings.Default, onAddToDictionary: (String) -> Unit? = null, spellCheckMenuItems: (SpellCheckItem) -> List<ContextMenuItem> = { emptyList() }, diagnostics: TextDiagnosticsState? = null, onRichSpanClick: RichSpanClickListener? = null, onRichSpanClickEvent: RichSpanClickEventListener? = null, onLinkClick: (url: String) -> Unit? = null, keyBindings: KeyBindings = LocalKeyBindings.current, contentDescription: String? = null, readOnly: Boolean = false, lineLimits: EditorLineLimits = EditorLineLimits.Fill, softWrap: Boolean = true)
A drop-in text editor composable with integrated spell checking.