EditorInfoCompat
Helper for accessing features in EditorInfo in a backwards compatible fashion.
Properties
Link copied to clipboard
Flag of imeOptions: used to request an IME that is capable of inputting ASCII characters.
Link copied to clipboard
Flag of imeOptions: used to request that the IME does not update any personalized data such as typing history and personalized language model based on what the user typed on this text editing object.
Functions
Link copied to clipboard
Gets MIME types that can be accepted by the target editor if the IME calls commitContent
Link copied to clipboard
Gets the selected text, if any.
Link copied to clipboard
open fun getInitialTextAfterCursor(@NonNull editorInfo: EditorInfo, length: Int, flags: Int): CharSequence
Get n characters of text after the current cursor position.
Link copied to clipboard
open fun getInitialTextBeforeCursor(@NonNull editorInfo: EditorInfo, length: Int, flags: Int): CharSequence
Get n characters of text before the current cursor position.
Link copied to clipboard
Returns
true
when an editor has stylus handwriting enabled.Link copied to clipboard
open fun setContentMimeTypes(@NonNull editorInfo: EditorInfo, @Nullable contentMimeTypes: Array<String>)
Sets MIME types that can be accepted by the target editor if the IME calls commitContent.
Link copied to clipboard
open fun setInitialSurroundingSubText(@NonNull editorInfo: EditorInfo, @NonNull subText: CharSequence, subTextStart: Int)
Editors may use this method to provide initial input text to IMEs.
Link copied to clipboard
open fun setInitialSurroundingText(@NonNull editorInfo: EditorInfo, @NonNull sourceText: CharSequence)
Editors may use this method to provide initial input text to IMEs.
Link copied to clipboard
Set
true
if the editor has stylus handwriting enabled.