Skip to content

Commit

Permalink
feat: Expose undo/redo actions to the Android host app
Browse files Browse the repository at this point in the history
Enable navigating editor history from the host app.
  • Loading branch information
dcalhoun committed Jan 8, 2025
1 parent 007bb41 commit c799883
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,18 @@ class GutenbergView : WebView {
}
}

fun undo() {
handler.post {
this.evaluateJavascript("editor.undo();", null)
}
}

fun redo() {
handler.post {
this.evaluateJavascript("editor.redo();", null)
}
}

@JavascriptInterface
fun onEditorLoaded() {
Log.i("GutenbergView", "EditorLoaded received in native code")
Expand Down

0 comments on commit c799883

Please sign in to comment.