Skip to content

Fix webview jumping#2736

Open
harshad1 wants to merge 12 commits intogsantner:masterfrom
harshad1:fix_webview_jumping
Open

Fix webview jumping#2736
harshad1 wants to merge 12 commits intogsantner: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
  • Remove the close button for the new search layout. Pressing the search button again closes the search view
  • 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

searchEditText.setTextColor(dopt.textColor);
searchEditText.setHintTextColor(ColorUtils.setAlphaComponent(dopt.textColor, 0x99));
searchEditText.setHint(dopt.searchHintText);
searchEditText.setText(dopt.searchText);
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.

we do not need a separate searchText

dopt.state.searchText does exactly this already

final Window window = context.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setNavigationBarColor(color);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
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.

Maintain system navigation bar contrast correctly even if markor and device themes mismatch


<net.gsantner.markor.frontend.DraggableScrollbarScrollView
android:id="@+id/document__fragment__edit__content_editor__scrolling_parent"
<FrameLayout
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.

Improved layout eliminates need for extra padding

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

listAdapter.filter(searchEditText.getText());
setSelectAllButtonState.callback();
};
final Runnable _changeListener = dopt.data == null || dopt.data.size() < 1000 ?
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.

Only debounce when the list is very long


final View decorView = win.getDecorView();
ViewCompat.setOnApplyWindowInsetsListener(decorView, (view, insets) -> {
listView.requestLayout();
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.

Explicitly request layout when keyboard shown. Fixes resize

}

@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

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