Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Sort option: sort alphabetically #613

Open
seano0 opened this issue Nov 10, 2015 · 3 comments
Open

Sort option: sort alphabetically #613

seano0 opened this issue Nov 10, 2015 · 3 comments

Comments

@seano0
Copy link

seano0 commented Nov 10, 2015

Please implement a sort option to sort tasks (especially completed tasks) alphabetically.
Use case: Mirakel Shopping List
A shopping list has items as tasks (e.g. milk, bread, lettuce, etc.) to be ticked off. When a shopping list is being made, previously completed items can be "un-completed" to add them back to the list. It should be quick and easy to find those items. Sorting completed items by creation date or completion date does not make it easy to find a single item in a list of ~100 items. Sorting alphabetically by task name would make it easy, greatly enhancing Mirakel's flexibility as a list manager.
Perhaps the sort by "Alphabetical" option could replace the redundant "Default" option (which appears to be the exact same as "Created date"?)

@igoralmeida
Copy link

I tried to implement this but got into a yak shaving quest trying to have the original app and my version coexist. Eventually I got fed up, and it sure didn't help that latest master does not build. Perhaps @azapps could chime in.

My approach was:

diff --git a/model/src/de/azapps/mirakel/model/list/ListMirakel.java b/model/src/de/azapps/mirakel/model/list/ListMirakel.java
index 15c4a5b..68d190f 100644
--- a/model/src/de/azapps/mirakel/model/list/ListMirakel.java
+++ b/model/src/de/azapps/mirakel/model/list/ListMirakel.java
@@ -83,6 +83,7 @@ public class ListMirakel extends ListBase implements ListMirakelInterface {
                                               };

     public enum SORT_BY {
+        //OPT, DUE, PRIO, ID, REVERT_DEFAULT, ALPHA;
         OPT, DUE, PRIO, ID, REVERT_DEFAULT;

         public short getShort() {
@@ -97,6 +98,8 @@ public class ListMirakel extends ListBase implements ListMirakelInterface {
                 return 3;
             case REVERT_DEFAULT:
                 return 4;
+            //case ALPHA:
+                //return 5;
             default:
                 throw new IllegalArgumentException("Unkown SORT_BY type " + this.toString());
             }
@@ -114,6 +117,8 @@ public class ListMirakel extends ListBase implements ListMirakelInterface {
                 return ID;
             case 4:
                 return REVERT_DEFAULT;
+            //case 5:
+                //return ALPHA;
             default:
                 throw new IllegalArgumentException("Cannot transform " + s + " to SORT_BY");
             }
@@ -156,6 +161,9 @@ public class ListMirakel extends ListBase implements ListMirakelInterface {
             qb.sort(Task.DONE, Sorting.ASC);
             qb.sort(dueSort, Sorting.ASC);
             break;
+        //case ALPHA:
+            //qb.sort(Task.NAME, Sorting.ASC);
+            //break;
         case REVERT_DEFAULT:
             qb.sort(Task.PRIORITY, Sorting.DESC);
             qb.sort(dueSort, Sorting.ASC);

@radfish
Copy link

radfish commented Jun 20, 2016

@igoralmeida What's the build error? I had issues with nasty Android Studio eating line breaks in .gradle build files, which broke their syntax.

@weiznich
Copy link
Member

@igoralmeida master builds fine for me. Take a look at our development tutorial. I think you are missing point 5 of "Clone our repo" (You must copy some files.).

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

No branches or pull requests

4 participants