GithubHelp home page GithubHelp logo

Comments (5)

IntuzMayurS avatar IntuzMayurS commented on July 28, 2024 1

@niendo1 Thank you for the support. I also resolved issue using the below method override into the RichEditor class.

I just give the focus again to editor.
@OverRide
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
if (hasWindowFocus) {
requestFocus();
post(() -> {
InputMethodManager imm = getContext().getSystemService(InputMethodManager.class);
imm.showSoftInput(this, 0);
});
}
}

I think this is the correct way to get again focus get into the editor.

from richeditor-android.

niendo1 avatar niendo1 commented on July 28, 2024

I can confirm that...

from richeditor-android.

niendo1 avatar niendo1 commented on July 28, 2024

can you try webView.requestFocusFromTouch() before setTextColor(). Sometimes it brings back the keyboard, but not always..

from richeditor-android.

niendo1 avatar niendo1 commented on July 28, 2024

if you use the latest commit:
implementation 'com.github.niendo1:richeditor-android:a82b781ac1'

something like this helps:

    @Override
    public boolean onResult(@NonNull String dialogTag, int which, @NonNull Bundle extras) {
        if (which == BUTTON_POSITIVE) {
            switch (dialogTag) {
                case DLG_HTML_TXT_COLOR:
                    lastTxtColor = extras.getInt(SimpleColorDialog.COLOR);
                    editText.requestFocusFromTouch();
                    editText.setOnJSDataListener(value -> {
                        editText.requestFocusFromTouch();
                        editText.setTextColor(lastTxtColor);
                    });
                    editText.getSelectedHtml(); // just a dirty Hack!
                    return true;

It seems, when the dialog is calling onResult, the dialog still prevents the focus to the editor.
But with this hack its working on ImapNotes.

New version will be released in the next days/week.

from richeditor-android.

niendo1 avatar niendo1 commented on July 28, 2024

@IntuzMayurS

Cool!
I added the fix in commit a32bc31. And it works so much better!

from richeditor-android.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.