markor
markor copied to clipboard
Add support for restoring scroll position for upper level file lists
This PR mainly implemented the following features for file browser:
- Highlight recently opened files or folders;
- Can restore the scroll position for the upper level list.
The screen recording as follows:
https://github.com/gsantner/markor/assets/60415467/fba58102-3f46-448f-8da4-493389ef28ea/
We already have logic to flash a view and this is used in other places.
https://github.com/gsantner/markor/blob/60d1f434a7fe94ba93fa357754636a8016880bb1/app/src/main/java/net/gsantner/opoc/util/GsContextUtils.java#L2853
See how it is used here:
https://github.com/gsantner/markor/blob/master/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java#L550
We already have a function to show and blink a file in the folder view. Just need to call it at the appropriate time.
I have added an option to show the currently open file in the file explorer in this PR:
https://github.com/gsantner/markor/pull/2176/files#diff-a5f18ed8d9a7afd47e78969d79f34ea509f949c4f383113680d828316380943dR607-R610
An option has been added to the file menu to show the file in the file explorer. This works even if the file was launched from search or a shortcut.
This PR may not be necessary
@harshad1 , Does your PR have the feature to restore scroll position of file list? If not, I can only keep this feature in this PR.
In addition, I hope the feature in your PR can highlight recently opened folders, rather than only documents.
No. All I have is the ability to jump from an open file to it's location in the folder.
I also like how the highlighting to show the file / folder looks. There are some good changes in this PR. I will think about this more.
I'm still not sure which code should be kept in my PR. Perhaps, I think I can decide it after your PR #2176 is merged.
PR has conflicts. might be easier to take version from msater and just make the few line changes again
@gsantner . Conflicts has been resolved.
When dark theme is used, I find the white blink color bad.
I will improve it.