Skip to content

ViewMode: Fix issue where document view cannot scroll to the bottom by clicking action button - #2937

Open
guanglinn wants to merge 11 commits into
gsantner:masterfrom
guanglinn:jump-improvement
Open

guanglinn wants to merge 11 commits into
gsantner:masterfrom
guanglinn:jump-improvement

Conversation

@guanglinn

@guanglinn guanglinn commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fix the issue that clicking the bottom jump action button cannot not scroll to the bottom position correctly in view mode.

Because _webView.getContentHeight() and _webView.getScrollY() cannot return the actual page content height and scroll y. The evaluateJavascript approach is the recommended best practice, which is highly compatible, precise and stable.

Fixes #2908

Before

Cannot jump to the bottom.

SVID_20261027_130934_1.mp4

Now

Can jump to the bottom correctly and smoothly.

SVID_20261028_081220_1_compressed.mp4

@guanglinn guanglinn changed the title ViewMode: Fix the issue of scrolling jump ViewMode: Fix cannot scroll to the document bottom by clicking 'Jump' action button Oct 29, 2026
@guanglinn guanglinn changed the title ViewMode: Fix cannot scroll to the document bottom by clicking 'Jump' action button ViewMode: Fix issue where document view cannot scroll to the bottom by clicking action button Oct 29, 2026
@gsantner

Copy link
Copy Markdown
Owner

Hello, thanks for the PR.
It seems to contain way more changes then just about webview scrolling (66 changed files)?

@guanglinn

guanglinn commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

I renamed a string key, then Android Studio automatically updated the string.xml files for all other languages (about 60 files) 🥲. Is it okay?

@gsantner

gsantner commented Oct 30, 2026 via email

Copy link
Copy Markdown
Owner

if (event.isCtrlPressed()) {
if (keyCode == KeyEvent.KEYCODE_B) {
onActionClick(R.string.abid_asciidoc_bold);
return true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for maintaining the keyboard shortcuts!

harshad1
harshad1 previously approved these changes Oct 31, 2026

@harshad1 harshad1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

but please test setSelectionAndShow instead of just _hlEditor.setSelection(). IMO it usually works better

@guanglinn

Copy link
Copy Markdown
Contributor Author

I have tried, it's bad to use TextViewUtils#setSelectionAndShow, which will trigger large scrolling, and force unwanted scrolling. I have tested, setSelection works well, it triggers moderate scrolling for a wrap line.

It works well now:

SVID_20261031_205924_1_compressed.mp4

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants