-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Android: adds "recent notes" widget (abandoned) #3458
Conversation
@@ -372,6 +373,10 @@ class NoteScreenComponent extends BaseScreenComponent { | |||
const resourceIds = await Note.linkedResourceIds(this.state.note.body); | |||
await ResourceFetcher.instance().markForDownload(resourceIds); | |||
} | |||
|
|||
if (this.state.note) { | |||
addNoteToRecentsWidget(this.state.note); |
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.
I suspect this might not work correctly if you create a new note and immediately go back without typing anything. The note will not be deleted (because it will not be saved in the first place) but looks like it will be put on this list.
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.
Good catch, you're right! I added a check to make sure the note has a title. If you have an idea on how this could be done more elegantly, let me know.
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.
I don't think it's currently possible to get the list of last opened notes, and if we add this it would be done differently, perhaps by re-using the note history logic. It seems simple to add but there's a ton of edge cases which would need to be supported by a large test suite (the history feature already does most of this).
So I feel that should be a for a different pull request. In the meantime, could you for example display the last modified notes? For this, we already have the logic in place so there will be less changes to make.
Does it mean that currently the widget is not working? Or did you use some trick to make it work anyway? |
Not sure what's the status of this pull request? Are you still interested in developing it @fstanis? |
Closing stale pull request |
Link to proposal
This PR adds a simple widget that displays up to 10 most recently opened notes:
In addition, it adds a reusable framework for sharing data using
SharedPreferences
that should help us add more widgets in the future, if needed.This PR requires deep links to be implemented: when a note in the widget is clicked, it expects an app to respond to
joplin://notes/<id>
style links.Open to suggestions on how whether the current widget logic should be made more or less generic and what (if anything) should be configurable in the app UI or settings.