-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to newfile dialog, open links, other fixes #2277
Improvements to newfile dialog, open links, other fixes #2277
Conversation
app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java
Show resolved
Hide resolved
app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java
Show resolved
Hide resolved
app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserOptions.java
Outdated
Show resolved
Hide resolved
app/src/main/java/net/gsantner/markor/activity/DocumentEditAndViewFragment.java
Show resolved
Hide resolved
|
||
public static class Format { | ||
public final @StringRes int format, name; | ||
public final String ext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion please make ext / it's handling as regex instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are just meant to be a source of truth, not used for matching etc. i.e. this says ' The canonical extension for markdown is ".md" '
Format and FORMATS is not meant to match or detect formats - that is left to the isFileOutOfThisFormat
as before.
app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserFragment.java
Outdated
Show resolved
Hide resolved
@@ -19,7 +20,7 @@ public class TodoTxtAutoTextFormatter implements InputFilter { | |||
@Override | |||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { | |||
try { | |||
if (start < source.length() && dstart <= dest.length() && TextViewUtils.isNewLine(source, start, end)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved some functions from TextViewUtils to GsTextUtils
@@ -119,6 +121,8 @@ public static class Options { | |||
|
|||
public Collection<File> favouriteFiles, recentFiles, popularFiles = null; | |||
public GsCallback.a1<CharSequence> setTitle = null, setSubtitle = null; | |||
|
|||
public GsCallback.a0 refresh = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted back to just having collections and added a refresh callback here. The refresh callback is called in loadFolder()
and can be used to do whatever.
opts.recentFiles = appSettings.getRecentFiles(); | ||
opts.popularFiles = appSettings.getPopularFiles(); | ||
}; | ||
opts.refresh.callback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the refresh callback to update sorting, fav file lists etc etc.
Broke a few things -> #2297 |
In this PR I have added the ability to format at new file title similarly to how we format snippets.
Additionally, we now remember template and name format per file type.
This should
yyyyMMddHHmmSS
)EDIT:
I have merged in my open links in tags PR so more things have been pulled in here: