Skip to content

Fix webview jumping + other improvements, closes #2726#2736

Merged
gsantner merged 21 commits into
gsantner:masterfrom
harshad1:fix_webview_jumping
May 25, 2026
Merged

Fix webview jumping + other improvements, closes #2726#2736
gsantner merged 21 commits into
gsantner:masterfrom
harshad1:fix_webview_jumping

Conversation

@harshad1
Copy link
Copy Markdown
Collaborator

@harshad1 harshad1 commented Feb 16, 2026

This Addresses #2726

In addition I have included a number of general fixes and improvements

  • Fix DocumentEditAndViewFragment layout so that they sit on top of the action bar properly
  • Eliminate the need for searchText and neutralButtonCallback2 - we already had mechanisms to do what was needed
  • Fix how dialogs resize when keyboard is shown. Should be much more consistent now
  • Debouncing filtering only triggered when there are over 1000 lines. Otherwise it is synchronous
  • Re-enable long-press handling in searchable/custom text dialogs.
  • Adjust selection reveal offsets so selected text scrolls into a better visible position.
  • Avoid saving “share as link” preference when the share-into link checkbox is unavailable or hidden.
  • Keep navigation bar icon contrast in sync with navigation bar color on Android O and newer.

@gsantner gsantner force-pushed the master branch 3 times, most recently from d3c16f5 to c3bd617 Compare March 6, 2026 18:41
@gsantner
Copy link
Copy Markdown
Owner

gsantner commented Mar 6, 2026

Thank you @harshad1 !
Unfortunate there were merge conflicts added by merging the bigger search PR

@gsantner
Copy link
Copy Markdown
Owner

Hence can't be merged

@harshad1
Copy link
Copy Markdown
Collaborator Author

harshad1 commented Apr 7, 2026

  • fixed the conflict
  • fixed system navigation bar contrast
  • fixed document fragment layout (no 12dp padding needed now)

This is ready for review and merge

});

// listView.setOnItemLongClickListener((parent, view, pos, id) -> directActivate.callback(pos, true));
listView.setOnItemLongClickListener((parent, view, pos, id) -> directActivate.callback(pos, true));
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@guanglinn It looks like this was disabled accidentally by an earlier PR. Re-enabling it.

I don't think this breaks anything else

Comment thread app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java
Comment thread app/src/main/res/layout/document__fragment__edit.xml
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageButton
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@guanglinn I removed the close button and made it so pressing the search icon again closes the view

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Let me know if you think this is not clean. I can revert it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need to revert it I think. The screen space of mobile devices is precious, there is nothing wrong with removing it

Comment thread app/src/main/java/net/gsantner/opoc/frontend/GsSearchOrCustomTextDialog.java Outdated
}

@Nullable
private static Editable getCurrentSearchText(final AlertDialog dialog) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@guanglinn instead of neutralButtonCallback2 we fetch the search text from the existing dialog

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, I see

@harshad1
Copy link
Copy Markdown
Collaborator Author

harshad1 commented May 9, 2026

@gsantner please let me know if you would like any changes

@guanglinn would you be able to take a look at this code and do a quick review?

I think this branch is ready to go

@harshad1 harshad1 changed the title Fix webview jumping Fix webview jumping + other improvements May 10, 2026
@gsantner
Copy link
Copy Markdown
Owner

Hello @harshad1 ,
thanks for continued working on Markor!
Sorry but this and most other PRs have a merge conflict now due merging one of guanglinn's big PRs 😄
If it fits you, can you please take a look?

_hlEditor.setSelection(lastSelection);

// Restore scroll position for edit-mode
_hlEditor.setReflowCallback(() -> {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@guanglinn This was causing issues with jumping back to cursor position

I have removed it and reverted this bit.

Will try to re-add it in a future PR once I identify a better approach

Copy link
Copy Markdown
Contributor

@guanglinn guanglinn May 24, 2026

Choose a reason for hiding this comment

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

This code can effectively restore the scroll position for EditText.
Hope it can be re-added in a better approach

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it is a good idea

Note that the jump back to cursor only happens when we have layout affecting spans

So

  • Bigger headings
  • todo.txt

I am trying to add it back but more conservative

@harshad1
Copy link
Copy Markdown
Collaborator Author

@gsantner I have fixed conflicts. Please merge

Copy link
Copy Markdown
Owner

@gsantner gsantner left a comment

Choose a reason for hiding this comment

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

Thank you again @harshad1 ,
and for repedeatley rebasing it

I tried it and didn't notice something wrong

Merging

@gsantner gsantner changed the title Fix webview jumping + other improvements Fix webview jumping + other improvements, closes #2726 May 25, 2026
@gsantner gsantner linked an issue May 25, 2026 that may be closed by this pull request
4 tasks
@gsantner gsantner added the bug label May 25, 2026
@gsantner gsantner added this to the Markor v2.17 milestone May 25, 2026
@gsantner gsantner merged commit f56e5ee into gsantner:master May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jumping to bottom and TOC jumping in view-mode are now unavailable

3 participants