GithubHelp home page GithubHelp logo

Comments (12)

Rosemoe avatar Rosemoe commented on May 24, 2024 1

It did not scroll automatically because the sample application's manifest did not add a flag to re-layout when the input method is shown.
So when the input method is in screen, editor's size is not changed and when you can not see the characters, they actually are still in the editor's considered visible area.
Add
android:windowSoftInputMode="adjustResize"
to the editor's activity will solve the problem.

And the issue about long text's visibility is really a bug, I'll fix it soon.
Thanks for your feedback.

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024 1

@TimScriptov

In Aide bad Code editor.

In MT Manager cool Code editor

Yes, I agree with you.
MT Manager's editor is quite smooth.

from sora-editor.

MrIkso avatar MrIkso commented on May 24, 2024

@Rosemoe

android:windowSoftInputMode="adjustResize"

Work, but edittext layout blinking, when keyboard shows and hides. Maybe you take a look this idea?
https://github.com/MrIkso/CodeEditor/blob/master/codeeditor/src/main/java/com/mrikso/codeeditor/view/FreeScrollingTextField.java#L1289

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

I do not really understand what is 'blinking'.
This attribute works well on my device.
Could you please give a little description or gif to help me know it better?

I'll view the code in your link.

from sora-editor.

MrIkso avatar MrIkso commented on May 24, 2024

Video
https://drive.google.com/file/d/1Dp8Hpy8L7cw6LBf-z5jUD7--mZ5NeiWo/view?usp=drivesdk
this will be clearly visible with a dark theme in the editor.

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

It seems to be caused by the system policy.
When the input method is still in animation, the layout of activity has already been resized.
I can not solve this in editor.
You may apply a dark theme to the activity and editor to cover this.

from sora-editor.

MrIkso avatar MrIkso commented on May 24, 2024

I can not solve this in editor.

@Rosemoe that's why I propose to do everything by auto-scrolling in the code, as in the example above

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

There is a similar method in my editor as well.
And when the 'drop' in your editor is not shown, they have the same ability. And it is called each time the text/selection changes to make the right selection visible.
Padding is not supported in my editor now, so it is safe to use getHeight/getWidth directly.
That's why I can not find where the problem is.
https://github.com/Rosemoe/CodeEditor/blob/c0c9e1e62f80bbd4ca9ad169618ad50319e6618d/editor/src/main/java/io/github/rosemoe/editor/widget/CodeEditor.java#L1750

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

I have observed some other editors such as AIDE's and MT Manager's.
They are getting the same problem as mine.
If I open the switch to make animations 4x longer, it is very obvious.
At the beginning of a input method's entrace or exit, the layout is resized.
I do not know what is the situation in your editor because I can not get my computer to compile a project with androidx.
And mobile QQ's policy is interesting, it has a delay until the layout resize. But this can not solve the problem from the source and it is not very easy to do the delay because usually we have to use onSizeChanged() to know whether the keyboard is shown. If adjustPan is applied to the window, the size will not be changed and onSizeChanged() will not be called. If adjustResize is applied to the window, we will have to recover the size of layout on the first time onSizeChanged() has a smaller height than before. But that will cause onSizeChanged() to be called again and we do not whether it is caused by the keyboard.
It also has the problem that this can not adaptes to various input method applications and if a user choose to disable the animation, the delay can be annoying.

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

Now I have viewed another editor modified from text warrior. It also has the problem.

from sora-editor.

TimScriptov avatar TimScriptov commented on May 24, 2024

@Rosemoe
In Aide bad Code editor.

In MT Manager cool Code editor

from sora-editor.

Rosemoe avatar Rosemoe commented on May 24, 2024

The layout flash problem will not be fixed in editor's code. Users may solve it by themselves.

from sora-editor.

Related Issues (20)

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.