Closed planarvoid closed 1 year ago
Add undo action to removeItem operation in the placeholders.
removeItem
Before you start make sure you setup the MainActivity like this:
MainActivity
Set the EXAMPLE to:
private val EXAMPLE = """ <p>Line</p> <placeholder type="image_with_caption" src="https://file-examples.com/storage/fed220eb286401af1a43037/2017/10/file_example_JPG_100kB.jpg" caption="Caption 1" <p>Line</p> """.trimIndent()
Create a placeholderManager field:
placeholderManager
protected lateinit var placeholderManager: PlaceholderManager
and initialize it in onCreate:
onCreate
placeholderManager = PlaceholderManager(visualEditor, findViewById(R.id.container_frame_layout)) placeholderManager.registerAdapter(ImageWithCaptionAdapter())
and set it on aztec as media deleted listener and as a plugin:
aztec
aztec = Aztec.with(visualEditor, sourceEditor, toolbar, this) ... .addOnMediaDeletedListener(placeholderManager) ... .addPlugin(placeholderManager)
@khaykov
Make sure strings will be translated:
strings.xml
Fix
Add undo action to
removeItem
operation in the placeholders.Before you start make sure you setup the
MainActivity
like this:Set the EXAMPLE to:
Create a
placeholderManager
field:and initialize it in
onCreate
:and set it on
aztec
as media deleted listener and as a plugin:Test
MainActivity
Review
@khaykov
Make sure strings will be translated:
strings.xml
as a part of the integration PR.