Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

fstanis
Copy link
Contributor

@fstanis fstanis commented Jul 5, 2020

Link to proposal

This PR adds a simple widget that displays up to 10 most recently opened notes:

image

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.

@@ -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);
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Owner

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.

@laurent22
Copy link
Owner

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.

Does it mean that currently the widget is not working? Or did you use some trick to make it work anyway?

@laurent22
Copy link
Owner

Not sure what's the status of this pull request? Are you still interested in developing it @fstanis?

@laurent22
Copy link
Owner

Closing stale pull request

@laurent22 laurent22 closed this Sep 3, 2020
@fstanis fstanis changed the title Android: adds "recent notes" widget Android: adds "recent notes" widget (abandoned) Oct 14, 2021
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.

4 participants