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

Make a widget for all Notes #15

Closed
enoch85 opened this issue Oct 6, 2015 · 41 comments
Closed

Make a widget for all Notes #15

enoch85 opened this issue Oct 6, 2015 · 41 comments

Comments

@enoch85
Copy link
Member

enoch85 commented Oct 6, 2015

Hey @stefan-niedermann, cool app.

Would be awesome if you could enhance this app with a widget. Then I would start using it as my new standard app for Notes. :)

@stefan-niedermann
Copy link
Member

Thank you :) What do you expect from a widget?
@jancborchardt suggested a widget that displays exactly one selected note (#5). Would this be enough for you or do you mean something more powerful?

@enoch85
Copy link
Member Author

enoch85 commented Oct 6, 2015

I'm currently using this app (https://play.google.com/store/apps/details?id=org.dmfs.tasks) as a Notes widget that syncs with the Tasks app through CalDav/CARDav. It's nice, but too much information inside the app beacuse it's a tasks app, and Notes isn't Tasks.

So what I'm looking for is very simple, and maybe a combination of @jancborchardt suggestion and the tasks widget I'm using right now.

Something like this:

image

Swipe right to delete (or show a trashcan icon)
Swipe left to edit
Plus sign to add

@stefan-niedermann stefan-niedermann changed the title Make a widget Make a widget for all Notes Oct 7, 2015
@stefan-niedermann stefan-niedermann added this to the 0.3.0 milestone Oct 7, 2015
@jancborchardt
Copy link
Member

I would say both widgets have their place, although I think widgets which just replicate apps are rarely useful. I’d definitely say the single note widget to be able to very quickly note down stuff inline (without needing to jump into the app!) is essential. Try and install JOT as I mentioned in #5.

@stefan-niedermann stefan-niedermann modified the milestones: 0.4.0, 0.3.0 Oct 21, 2015
@stefan-niedermann stefan-niedermann removed this from the 0.4.0 milestone Oct 25, 2015
@repsorp
Copy link

repsorp commented May 21, 2017

If you could make it as simple and efficient as the Twidere "Write" widget it would be perfect...
https://github.com/TwidereProject/Twidere-Android

No need for attached file, location etc.
widg

@stefan-niedermann
Copy link
Member

sounds good, but this would be a third widget:

  1. display one note
  2. display all notes
  3. create new note

@jancborchardt
Copy link
Member

Displaying a list of all notes and creating a new note could be the same widget. The list would just have a first list item which says "+ Create new note" :)

@repsorp
Copy link

repsorp commented May 22, 2017

3 widgets would be perfect !

  1. display one note
  2. display all notes
  3. create new note

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 13, 2017

3 widgets would be perfect !

display one note
display all notes
create new note

I have hacked together a widget for number 3 and I'm currently working on number 2. Shall I make a pull request for the create note widget?

@jancborchardt
Copy link
Member

@dan0xii awesome! Yes please submit pull requests for all the widgets. :) "Create new note" could actually be part of the all notes widget, in the header as + button.

A widget for a single note would still be most awesome.

@stefan-niedermann
Copy link
Member

I have hacked together a widget for number 3 and I'm currently working on number 2. Shall I make a pull request for the create note widget?

Yes, a Pull Request would be awesome! :) Thanks a lot!

dan0xii added a commit to dan0xii/nextcloud-notes that referenced this issue Aug 14, 2017
Addition of "Create Note" widget as referenced in nextcloud#15.
stefan-niedermann pushed a commit that referenced this issue Aug 16, 2017
Addition of "Create Note" widget as referenced in #15.
@dan0xii
Copy link
Collaborator

dan0xii commented Aug 16, 2017

I'm working on the single note widget and I'm after a bit of advice. I can't get the RxMarkdown view to display within a widget and I think it's because you can't use custom views as per: https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout

I thought it would work as RxMarkdown extends TextView. Does anyone have any experience before I move on to a standard widget with TextView(s)?

@stefan-niedermann
Copy link
Member

Well, in general it should work as you described. but it would ne a nice first step to display the markdown (without actual manipulating the font size etc.)

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 22, 2017

I've made a PR for the work I've done so far on the single note widget. It's worked well on my phone over the past couple of days but could do with some thorough testing. It still has some TODOs:

  1. Markdown support
  2. Allow tapping on the widget to open an Edit activity
  3. Theme the "select single note" activity to keep it in-line with the rest of the app but be sufficiently different from the standard notes list view so as not to confuse the user.

@stefan-niedermann
Copy link
Member

Great work. I will review as soon as possible. I already had a look at your scree shot, and maybe we should remove the blue border and give the background an opacity of 0.9?

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 23, 2017

Sure, I'll upload another screenshot when I get a chance. I'm working on making it scrollable as well.

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 23, 2017

screenshot_1503508049

How's this.

@stefan-niedermann
Copy link
Member

Much better! We can increase the margin slightly, but for now its good enough to merge it. Its a good first step :)

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 23, 2017

Do I close the current PR and open a new one with the changes? I've also added tap to edit so will incorporate that.

@stefan-niedermann
Copy link
Member

Feel free to organize the PRs as you need it and ping me again when i can review the changes (and @korelstar though i know he is not much interessted in widgets)

@dan0xii
Copy link
Collaborator

dan0xii commented Aug 29, 2017

Hello @stefan-niedermann, I think PR #239 is now ready for review (cc @korelstar). I've bumped up the margin, updated the widget configuration screen theme slightly for devices running >= API 23 and tapping the widget now goes to edit the note. The problem I'm having with the last one is similar to the issue outlined in #161.

When I have a note on the home screen and I edit it in the webapp (or anywhere else) there is an interval before onUpdate() is called where I can edit an old version of the note. I tried two ways to solve it:

  1. Open the EditNote activity and request a refresh of all notes in the background. The user just edits the old version of the note and the problem isn't solved.
  2. Open the EditNote activity with the entire note disabled from input until sync has finished. It solves the problem but has a few downsides namely: it doesn't look great to the user, the user has to wait, it could get messy if the network connection is patchy or slow and it needs logic to cater for the device being offline.

Input appreciated.

@jancborchardt, I'm happy to create a dark version but will need time to update the widget configuration screen. If there is an overall consensus that a dark version would look better I'll set it by default for now. I prefer the light version of my devices. (So that's 1-1 :)).

dan0xii added a commit to dan0xii/nextcloud-notes that referenced this issue Sep 1, 2017
Addition of "Create Note" widget as referenced in nextcloud#15.
@korelstar
Copy link
Member

@dan0xii

  • The widget should be updated whenever the database is updated. Therefore, we need a respective notifier using the observer pattern. As a quick fix, I've moved your method EditNoteActivity.updateSingleNoteWidgets() to NoteSQLiteOpenHelper and call this method now from EditNoteActivity and from NoteServerSyncHelper.SyncTask.onPostExecute(). Now, the widget is updated, whenever notes are synchronized. However, the problem of Prevent editing of unsynchronized notes #161 still exists and must be solved. But this is very complex and needs some work to do.
  • SelectSingleNoteActivity should not extend NotesListViewActivity. This will be problematic when we introduce the Navigation Drawer (see Support Categories #165 and [Work in Progress] Sidebar #198) in NotesListViewActivity, since the Drawer should not be part of SelectSingleNoteActivity. Nevertheless, the code shouln't be duplicated, so we will need another solution here.
  • For which purpose do you need the INIT preference? Can't that be removed?

@dan0xii
Copy link
Collaborator

dan0xii commented Sep 3, 2017

SelectSingleNoteActivity should not extend NotesListViewActivity. This will be problematic when we introduce the Navigation Drawer (see #165 and #198) in NotesListViewActivity, since the Drawer should not be part of SelectSingleNoteActivity. Nevertheless, the code shouln't be duplicated, so we will need another solution here.

Could we not make a standard BaseNoteListView activity and extend that to SelectSingleNote and NoteListView. The latter having the addition of Navigation Drawer, swipe actions, favourites etc.

For which purpose do you need the INIT preference? Can't that be removed?

The INIT preference is there because when the widget is dropped onto the homescreen and the configuration activity is shown the appwidget onUpdate() is fired before the user has finished. I don't know why but I found the following link which describes the problem: https://issuetracker.google.com/issues/36924475#c0

@stefan-niedermann
Copy link
Member

Could we not make a standard BaseNoteListView activity and extend that to SelectSingleNote and NoteListView. The latter having the addition of Navigation Drawer, swipe actions, favourites etc.

Sounds not bad. Another option might be to seperate the list into an own fragment that could be used in NoteListView (which would then be an activity containing the fragment and a drawer) and SelectSingleNote (basically an empty actuvity containing only the fragment)?

@stefan-niedermann
Copy link
Member

TL;DR composition instead of inheritance

@korelstar
Copy link
Member

I vote for (re-)using fragments for the list (as suggested by @stefan-niedermann), too.


The INIT preference is there because when the widget is dropped onto the homescreen and the configuration activity is shown the appwidget onUpdate() is fired before the user has finished. I don't know why but I found the following link which describes the problem: https://issuetracker.google.com/issues/36924475#c0

I understand the issue. However, I still don't understand why we need the INIT preference, since at the same time, the noteId is assigned to the widgetKey preference. So why not test if this one is set (i.e. larger than 1). Currently, you test this twice: firstly noteID >= 0, secondly isInitialised. But these depend on each other: isInitialised==true <=> noteID>=0.

@dan0xii
Copy link
Collaborator

dan0xii commented Sep 10, 2017

I see what you're saying and yes, I think it's pointless. I've updated my master branch and it works fine. Do you want me to PR?

@korelstar
Copy link
Member

korelstar commented Sep 11, 2017 via email

@dan0xii
Copy link
Collaborator

dan0xii commented Sep 14, 2017

What are everyone's thoughts on this layout for an all notes/note list widget?

Imgur

It's pretty raw at the moment so I'm after feedback before I put a load of work into it. I'm intending to:

  1. Have a star displayed at the right hand side of each note title if that note is starred.
  2. Show an "add note" icon on the top right of the title bar.
  3. Create a config activity to allow the user to choose whether the widget should show all notes, starred notes or all notes of a certain category. I think this would also allow the SingleNoteWidget to be merged into it.
  4. Allow the user to select a dark or light theme in the config activity.

@jancborchardt
Copy link
Member

@dan0xii nice, sounds good! Only design enhancement I'd do is put a little notes icon left of the "Notes" heading, and then also put the favorite stars left of the note titles. (This is also where we will move it on the web interface.)

@korelstar
Copy link
Member

korelstar commented Sep 15, 2017 via email

@dan0xii
Copy link
Collaborator

dan0xii commented Sep 15, 2017

Here's a version with stars and the additions to the header bar for comparison.

Notes List

The app icon gets a bit lost against the blue background--could add a white border when displaying on this widget ?

I think the spacing in the note list is a bit too much as well.

@jancborchardt
Copy link
Member

Nice!

  • the app icon is intended on blue background, looks good. No border needed
  • the text of the notes should be left-aligned with the "Notes" header
  • unfavorited notes don't need an icon, or is it interactive?
  • what do you mean that the spacing in the note list is a bit much?

@stefan-niedermann
Copy link
Member

This widget looks great! Agree to all points of @jancborchardt here. The icon looks fine without a border. If you switch apps in android, then the preview is displaying the icon in the activity the same way :)
Imho the spacing is okay, too. I know, many people don't like much padding, bit i think the spacing is fine here. Phones are getting bigger and this will help to focus on the most recent / starred notes imho.
Let's go for it and adjust if needed later.

@dan0xii
Copy link
Collaborator

dan0xii commented Sep 16, 2017

I've incorporated the feedback and it now looks like:
Imgur

I'm not sure if the alignment is exactly spot-on or if I've been looking at it too long. :)

what do you mean that the spacing in the note list is a bit much?

I thought the vertical padding was too high but happy to leave it as it is for now.

put the favorite stars left of the note titles. (This is also where we will move it on the web interface.)

Is this not confusing to the user because some apps use that space for multi-select icons? I don't just mean in this app but in general. I'm thinking along the lines of this:
Imgur

@jancborchardt
Copy link
Member

Nice! Just 3 details again:

  • yep the align is just a tiny bit off ;) the note titles need to be moved a tiny bit left to align with the header
  • the plus icon is a bit too large
  • best increase the height of each row so the widget will show 5½ notes here - that's an important indicator of scrollability and that there are further notes

@stefan-niedermann stefan-niedermann added this to the 0.12.0 milestone Oct 4, 2017
@jancborchardt
Copy link
Member

So this is in? Awesome @dan0xii! :)

@stefan-niedermann
Copy link
Member

In the next version (will be released in the next view days)

Minor improvements can get suggested in seperate issues :)

@dan0xii
Copy link
Collaborator

dan0xii commented Oct 4, 2017

I don't think this should be closed because the "all notes" widget isn't done yet.

I'm testing it here: widget_note_list but it's still not finished.

@stefan-niedermann
Copy link
Member

whoops, thought this issue was the single note widget

@stefan-niedermann stefan-niedermann removed this from the 0.12.0 milestone Oct 4, 2017
@dan0xii
Copy link
Collaborator

dan0xii commented Oct 8, 2017

I think I have a working version of the note list widget, see PR #273. I tend to agree with korelstar having used it for the past few weeks, that it may not be worth showing the star or, at least, to align the notes that aren't starred with the left hand side of the widget. When you have a list of notes that aren't starred you just have a white gap on the left with the current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants