In this PR I've added a support for task list. This option is available in the list menu.
Changing the checkbox state was tricky. In the end the checkboxes are drawn within the new parent list span (not on the items themselves). I was considering another option. Drawing the checkbox as part of the listItem instead. This solution has a couple of disadvantages, the biggest one is that all the other bullets are drawn within the list container so switching the lists would've been hacky.
The disadvantage of the current solution is that the whole list needs to be redrawn on checking a list item. If this solution is not good enough, we might want to try the other way.
The tasklist is hidden by default. It needs to be enabled on the toolbar.
Test
Change the MainActivity to call toolbar.enableTaskList()
Run the app
Notice the lists menu now contains a new option - task list
Try:
Add a new task list
Check a few items
Check the toolbar icon state is task list
Change the task list type to ordered or unordered list
Fix
https://github.com/wordpress-mobile/AztecEditor-Android/issues/959
In this PR I've added a support for task list. This option is available in the list menu. Changing the
checkbox
state was tricky. In the end the checkboxes are drawn within the new parent list span (not on the items themselves). I was considering another option. Drawing the checkbox as part of thelistItem
instead. This solution has a couple of disadvantages, the biggest one is that all the other bullets are drawn within thelist
container so switching the lists would've been hacky. The disadvantage of the current solution is that the whole list needs to be redrawn on checking a list item. If this solution is not good enough, we might want to try the other way. Thetasklist
is hidden by default. It needs to be enabled on the toolbar.Test
MainActivity
to calltoolbar.enableTaskList()
lists
menu now contains a new option - task listtask list
https://user-images.githubusercontent.com/1079756/155494268-7f308edc-fa9f-4371-8a14-b6d812836fa0.mp4
Make sure strings will be translated:
strings.xml
as a part of the integration PR.