From 9bdffd38a381666b7a45d23ed774ad30f555350c Mon Sep 17 00:00:00 2001 From: khaled Al-Sabbagh Date: Fri, 16 Oct 2015 17:33:30 +0200 Subject: [PATCH] Search descriptions in addition to titles Closes #232 --- .../astrid/activity/TaskListActivity.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java b/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java index 8fa5277b7..e09b14f1e 100644 --- a/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java +++ b/src/main/java/com/todoroo/astrid/activity/TaskListActivity.java @@ -25,6 +25,7 @@ import android.view.MenuItem; import android.view.View; import com.todoroo.andlib.data.Callback; +import com.todoroo.andlib.sql.Criterion; import com.todoroo.andlib.sql.QueryTemplate; import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.astrid.actfm.FilterSettingsActivity; @@ -222,10 +223,20 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList query = query.trim(); String title = getString(R.string.FLA_search_filter, query); Filter savedFilter = new Filter(title, - new QueryTemplate().where(Task.TITLE.like( - "%" + //$NON-NLS-1$ - query + "%")), //$NON-NLS-1$ - null); + new QueryTemplate().where + (Criterion.or(Task.NOTES. + like ( + "%" + //$NON-NLS-1$ + query + "%" + ), + Task.TITLE. + like ( + "%" + //$NON-NLS-1$ + query + "%" + ) + ) + ),null); + onFilterItemClicked(savedFilter); MenuItemCompat.collapseActionView(item); return true;