dankito / RichTextEditor

Rich text WYSIWYG editor for Android and JavaFX
Apache License 2.0
95 stars 36 forks source link

TextChangedListener #31

Closed tised closed 4 years ago

tised commented 4 years ago

Is there are any possibility to get in real-time typed text?

dankito commented 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:

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.

dankito commented 4 years ago

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()
            }
        });
tised commented 4 years ago

Seems ok!