wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
699 stars 116 forks source link

Feature/add styling options to task list #1007

Closed khaykov closed 2 years ago

khaykov commented 2 years ago

This PR adds option to specify checked task list item color and if it should use strikethrough.

I tried couple of approaches, but the easiest one was to add styling to the AztecListItemSpan. This requires wiring the styling data to a lot of places, but it also opens up potential for styling list items for other purposes.

Test

You can add the task list button to the toolbar by pasting following code somewhere here:

toolbar.setToolbarItems(ToolbarItems.BasicLayout(
        ToolbarAction.TASK_LIST
))
toolbar.enableTaskList()

Image from Gyazo

  1. Confirm that task list in HTML rendered from example has a task list, it works as expected and selected items use grey strikethrough text.
  2. Confirm that task list added from toolbar works as expected and selected items use grey strikethrough text.

Make sure strings will be translated: