Is there a way to sort note titles?

Asked by razrj on 2010-01-24

Maybe I'm just using tomdroid wrong. I just copy my notes from my PC to my Droid. When I start tomdroid I get an unsorted list. I have a large number of notes. It's too hard to find the top of my linked hierarchy. Searched for a way to find a marker by manipulating the notes and IDs, but no luck. I finally downloaded the latest branch as of a few day ago, looked over the code, and discovered that maybe I could change the SQL ORDER BY on the list mangedQuery to get a sorted list.

It worked. My notes are sorted. Life is good.

I want to thank you guys for the great work you are doing. Now that I'm into this enough maybe I'll help a little from time to time. The next issue is that title links with special characters and numbers don't work correctly. Need to fix that.

See the one line change I made to get a sorted list of notes. Probably not the best solution, but now tomdroid is very usable!!!!!

 public static ListAdapter getListAdapter(Activity activity) {

  // get a cursor representing all notes from the NoteProvider
  Uri notes = Tomdroid.CONTENT_URI;
  //sb - changed fifth argument from null to "title ASC"
  Cursor notesCursor = activity.managedQuery(notes, LIST_PROJECTION, null, null, "title ASC");

  // set up an adapter binding the TITLE field of the cursor to the list item
  String[] from = new String[] { Note.TITLE };
  int[] to = new int[] { R.id.note_title };
  return new SimpleCursorAdapter(activity, R.layout.main_list_item, notesCursor, from, to);
 }

thanks again. i love tomboy notes, and now i can use tomdroid notes

Question information

Language:
English Edit question
Status:
Answered
For:
Tomdroid Edit question
Assignee:
No assignee Edit question
Last query:
2010-01-24
Last reply:
2010-01-25
Olivier Bilodeau (plaxx) said : #1

Sorting notes list was planned for next release. Now, I just pushed the code in the main/ branch.

However, the way I sort is by keeping the last modified notes on top. I think it makes the more sense for everyone and it mimics Tomboy.

If last modified is not good enough for you, let me know and I'll add it on top of the TODO list.

> The next issue is that title links with special characters and numbers don't work correctly. Need to fix that.

Can you provide examples and file a bug? Quite some people reported problems like that and I was never able to reproduce them. If you can upload sample notes that are not working into a bug report then it would help me a lot.

I'm really glad you like Tomdroid! Keep the feedback coming.

razrj (jlk332006) said : #2

Oliver,

I agree that sorting by latest is okay as long as there is a list of persistent sticky notes to let you access your notes hierarchy. Unlike Windows and Linux Tomboy, Tomdroid is able to scroll the whole notes list efficiently. I think this is a actually a superior feature, but it's only superior if you can find what you are looking for. My latest notes are usually deep down in my notes hierarchy. I need a pointer to the top. Sorting by title provides an easy what to find key notes in my hierarchy. Since is just a one line change, it would be easy to option the SQL ORDER BY parameter (i.e. sort by date, or sort by title).

Regarding the special characters: I frequently date code my titles. For example: Worklog-1-23-10. I have other Worklog* notes. Tomdroid only parses the link to the "-" and then stops. So Worklog-1-23-10 finds just Worklog. If I select the date portion, Android sends it to the phone application. I'll post a bug for this like you asked.

razrj (jlk332006) said : #3

Oliver,

I agree that sorting by latest is okay as long as there is a list of persistent sticky notes to let you access your notes hierarchy. Unlike Windows and Linux Tomboy, Tomdroid is able to scroll the whole notes list efficiently. I think this is a actually a superior feature, but it's only superior if you can find what you are looking for. My latest notes are usually deep down in my notes hierarchy. I need a pointer to the top. Sorting by title provides an easy what to find key notes in my hierarchy. Since is just a one line change, it would be easy to option the SQL ORDER BY parameter (i.e. sort by date, or sort by title).

Regarding the special characters: I frequently date code my titles. For example: Worklog-1-23-10. I have other Worklog* notes. Tomdroid only parses the link to the "-" and then stops. So Worklog-1-23-10 finds just Worklog. If I select the date portion, Android sends it to the phone application. I'll post a bug for this like you asked.

Olivier Bilodeau (plaxx) said : #4

Thanks for the bug report. I'll look at it.

I also opened a blueprint to track your sorting feature request: https://blueprints.launchpad.net/tomdroid/+spec/note-sorting Feel free to comment on it.

Can you help with this problem?

Provide an answer of your own, or ask razrj for more information if necessary.

To post a message you must log in.