Closed tised closed 4 years ago
Once there was one but it turned out to be way too inperformant, so I removed it.
Depending on what you are aiming to do:
If you just want to know if the entered text changed, e.g. to enable or disable a save button, you can add a DidHtmlChangeListener by calling addDidHtmlChangeListener() on RichTextEditor instance.
If you really need the current HTML, you could call richTextEditor.getJavaScriptExecutor().addCommandStatesChangedListener() and then on each listener invocation call richTextEditor.getCurrentHtmlAsync(). But I guess the performance will be quite bad.
But actually you're right, I should re-add the htmlChangedListener and tell the user, that it's performance will most likely be quite bad. But if he/she wants to use it, the he/she should be able to.
Added it in version 2.0.14.
Please have a look at it and tell me if it works for you.
Usage:
editor.addHtmlChangedListener(new HtmlChangedListener() {
@Override
public void htmlChangedAsync(@NotNull String html) {
// htmlChangedAsync() gets called on a background thread, so if you want to use it on UI thread you have to call runOnUiThread()
}
});
Seems ok!
Is there are any possibility to get in real-time typed text?