Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdd9e3ca authored by Marten Gajda's avatar Marten Gajda
Browse files

fix sortings

parent 3a9b5104
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ public class ByList extends AbstractGroupingFactory
	public ExpandableChildDescriptor makeExpandableChildDescriptor(String authority)
	{
		return new ExpandableChildDescriptor(Instances.getContentUri(authority), INSTANCE_PROJECTION, Instances.VISIBLE + "=1 and " + Instances.LIST_ID + "=?",
			Instances.INSTANCE_DUE + " is null, " + Instances.INSTANCE_DUE + ", " + Instances.TITLE + " COLLATE NOCASE ASC", 0)
			Instances.INSTANCE_DUE_SORTING + " is null, " + Instances.INSTANCE_DUE_SORTING + ", " + Instances.TITLE + " COLLATE NOCASE ASC", 0)
			.setViewDescriptor(TASK_VIEW_DESCRIPTOR);
	}

+1 −1
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ public class ByPriority extends AbstractGroupingFactory
	{
		return new ExpandableChildDescriptor(Instances.getContentUri(authority), INSTANCE_PROJECTION, Instances.VISIBLE + "=1 and (" + Instances.PRIORITY
			+ ">=? and " + Instances.PRIORITY + " <= ? or ? is null and " + Instances.PRIORITY + " <= ? or " + Instances.PRIORITY + " is ?)",
			Instances.INSTANCE_DUE + " is null, " + Instances.INSTANCE_DUE + ", " + Instances.TITLE + " COLLATE NOCASE ASC", 1, 2, 1, 2, 1)
			Instances.INSTANCE_DUE_SORTING + " is null, " + Instances.INSTANCE_DUE_SORTING + ", " + Instances.TITLE + " COLLATE NOCASE ASC", 1, 2, 1, 2, 1)
			.setViewDescriptor(TASK_VIEW_DESCRIPTOR);
	}

+1 −1
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ public class ByProgress extends AbstractGroupingFactory
	{
		return new ExpandableChildDescriptor(Instances.getContentUri(authority), INSTANCE_PROJECTION, Instances.VISIBLE + "=1 and ("
			+ Instances.PERCENT_COMPLETE + ">=? and " + Instances.PERCENT_COMPLETE + " <= ? or ? is null and " + Instances.PERCENT_COMPLETE + " <= ? or "
			+ Instances.PERCENT_COMPLETE + " is ?)", Instances.INSTANCE_DUE + " is null, " + Instances.INSTANCE_DUE + ", " + Instances.TITLE
			+ Instances.PERCENT_COMPLETE + " is ?)", Instances.INSTANCE_DUE_SORTING + " is null, " + Instances.INSTANCE_DUE_SORTING + ", " + Instances.TITLE
			+ " COLLATE NOCASE ASC", 1, 2, 1, 2, 1).setViewDescriptor(TASK_VIEW_DESCRIPTOR);
	}

+4 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package org.dmfs.tasks.groupings;

import java.text.DateFormat;

import org.dmfs.provider.tasks.TaskContract.Instances;
import org.dmfs.provider.tasks.TaskContract.Tasks;
import org.dmfs.tasks.R;
import org.dmfs.tasks.groupings.cursorloaders.SearchHistoryCursorLoaderFactory;
@@ -323,8 +324,9 @@ public class BySearch extends AbstractGroupingFactory
	@Override
	public ExpandableChildDescriptor makeExpandableChildDescriptor(String authority)
	{
		return new SearchChildDescriptor(authority, SearchHistoryDatabaseHelper.SearchHistoryColumns.SEARCH_QUERY, TASK_PROJECTION, null,
			Tasks.DEFAULT_SORT_ORDER, null).setViewDescriptor(TASK_VIEW_DESCRIPTOR);
		return new SearchChildDescriptor(authority, SearchHistoryDatabaseHelper.SearchHistoryColumns.SEARCH_QUERY, TASK_PROJECTION, null, Tasks.SCORE + ", "
			+ Instances.INSTANCE_DUE_SORTING + " is null, " + Instances.INSTANCE_DUE_SORTING + ", " + Instances.PRIORITY + ", " + Instances.TITLE
			+ " COLLATE NOCASE ASC", null).setViewDescriptor(TASK_VIEW_DESCRIPTOR);

	}

+2 −1
Original line number Diff line number Diff line
@@ -334,7 +334,8 @@ public class ByStartDate extends AbstractGroupingFactory
		// Note that we're using INSTANCE_START_SORTING to get correct grouping of all-day tasks
		return new ExpandableChildDescriptor(Instances.getContentUri(authority), INSTANCE_PROJECTION, Instances.VISIBLE + "=1 and ((("
			+ Instances.INSTANCE_START_SORTING + ">=?) and (" + Instances.INSTANCE_START_SORTING + "<?)) or ((" + Instances.INSTANCE_START_SORTING + ">=? or "
			+ Instances.INSTANCE_START_SORTING + " is ?) and ? is null))", Instances.DEFAULT_SORT_ORDER, 0, 1, 0, 1, 1).setViewDescriptor(TASK_VIEW_DESCRIPTOR);
			+ Instances.INSTANCE_START_SORTING + " is ?) and ? is null))", Instances.INSTANCE_START_SORTING, 0, 1, 0, 1, 1)
			.setViewDescriptor(TASK_VIEW_DESCRIPTOR);
	}