Skip to content

Android Add option to change caret color in RichText in API 29+ #1787

@chipsnyder

Description

@chipsnyder

Describe the bug
The solution used as part of #1773 only supports API 27 and below in Android as reflection is not supported in API 28+.
Starting in API 29 there are the following supported methods that allow the cursor to be edited programmatically.

Link Attribute
TextView#setTextCursorDrawable cursor
TextView.html#setTextSelectHandleLeft Left selector icon
TextView.html#setTextSelectHandleRight Right selector icon
TextView.html#setTextSelectHandle Single selector icon

Once Aztec View is updated to target API 29 support for the cursor drawable should be added to wrap up support for selectionColor

To Reproduce
Steps to reproduce the behavior:

  1. In Gutenberg add selectionColor to a component that uses RichText
  2. Add that field to a page or post

Expected behavior
The cursor should match the selectionColor

Screenshots
Cursor Color API 29:

Highlight Color API 29:

Smartphone (please complete the following information):

  • Device: Pixel 3a emulator
  • OS: Android 10
  • Version 29

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions