Search descriptions in addition to titles

Closes #232
pull/322/merge
khaled Al-Sabbagh 9 years ago committed by Alex Baker
parent 31b3e5ff4c
commit 9bdffd38a3

@ -25,6 +25,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import com.todoroo.andlib.data.Callback; import com.todoroo.andlib.data.Callback;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.QueryTemplate; import com.todoroo.andlib.sql.QueryTemplate;
import com.todoroo.andlib.utility.AndroidUtilities; import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.actfm.FilterSettingsActivity; import com.todoroo.astrid.actfm.FilterSettingsActivity;
@ -222,10 +223,20 @@ public class TaskListActivity extends AstridActivity implements OnPageChangeList
query = query.trim(); query = query.trim();
String title = getString(R.string.FLA_search_filter, query); String title = getString(R.string.FLA_search_filter, query);
Filter savedFilter = new Filter(title, Filter savedFilter = new Filter(title,
new QueryTemplate().where(Task.TITLE.like( new QueryTemplate().where
"%" + //$NON-NLS-1$ (Criterion.or(Task.NOTES.
query + "%")), //$NON-NLS-1$ like (
null); "%" + //$NON-NLS-1$
query + "%"
),
Task.TITLE.
like (
"%" + //$NON-NLS-1$
query + "%"
)
)
),null);
onFilterItemClicked(savedFilter); onFilterItemClicked(savedFilter);
MenuItemCompat.collapseActionView(item); MenuItemCompat.collapseActionView(item);
return true; return true;

Loading…
Cancel
Save