EditorInfoCompat

Helper for accessing features in EditorInfo in a backwards compatible fashion.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val IME_FLAG_FORCE_ASCII: Int = -2147483648
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
open fun getContentMimeTypes(@NonNull editorInfo: @NonNull EditorInfo): @NonNull Array<String>
Gets MIME types that can be accepted by the target editor if the IME calls commitContent
Link copied to clipboard
@Nullable
open fun getInitialSelectedText(@NonNull editorInfo: @NonNull EditorInfo, flags: Int): @Nullable CharSequence
Gets the selected text, if any.
Link copied to clipboard
@Nullable
open fun getInitialTextAfterCursor(@NonNull editorInfo: @NonNull EditorInfo, length: Int, flags: Int): @Nullable CharSequence
Get n characters of text after the current cursor position.
Link copied to clipboard
@Nullable
open fun getInitialTextBeforeCursor(@NonNull editorInfo: @NonNull EditorInfo, length: Int, flags: Int): @Nullable CharSequence
Get n characters of text before the current cursor position.
Link copied to clipboard
open fun isStylusHandwritingEnabled(@NonNull editorInfo: @NonNull EditorInfo): Boolean
Returns true when an editor has stylus handwriting enabled.
Link copied to clipboard
open fun setContentMimeTypes(@NonNull editorInfo: @NonNull EditorInfo, contentMimeTypes: @Nullable 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: @NonNull EditorInfo, @NonNull subText: @NonNull CharSequence, subTextStart: Int)
Editors may use this method to provide initial input text to IMEs.
Link copied to clipboard
open fun setInitialSurroundingText(@NonNull editorInfo: @NonNull EditorInfo, @NonNull sourceText: @NonNull CharSequence)
Editors may use this method to provide initial input text to IMEs.
Link copied to clipboard
open fun setStylusHandwritingEnabled(@NonNull editorInfo: @NonNull EditorInfo, enabled: Boolean)
Set true if the editor has stylus handwriting enabled.