diff --git a/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java b/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java index 91cdaed9f..c855ce686 100644 --- a/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java +++ b/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java @@ -228,8 +228,8 @@ public class FilterAdapter extends ArrayAdapter { } } - public void addSubMenu(final int titleResource, List filters) { - if (filters.isEmpty()) { + private void addSubMenu(final int titleResource, List filters, boolean hideIfEmpty) { + if (hideIfEmpty && filters.isEmpty()) { return; } @@ -245,7 +245,7 @@ public class FilterAdapter extends ArrayAdapter { add(filterProvider.getMyTasksFilter()); - addSubMenu(R.string.filters, filterProvider.getFilters()); + addSubMenu(R.string.filters, filterProvider.getFilters(), false); if (navigationDrawer) { add(new NavigationDrawerAction( @@ -255,7 +255,7 @@ public class FilterAdapter extends ArrayAdapter { TaskListFragment.ACTIVITY_REQUEST_NEW_FILTER)); } - addSubMenu(R.string.tags, filterProvider.getTags()); + addSubMenu(R.string.tags, filterProvider.getTags(), false); if (navigationDrawer) { add(new NavigationDrawerAction( @@ -265,7 +265,7 @@ public class FilterAdapter extends ArrayAdapter { NavigationDrawerFragment.REQUEST_NEW_LIST)); } - addSubMenu(R.string.gtasks_GPr_header, filterProvider.getGoogleTaskFilters()); + addSubMenu(R.string.gtasks_GPr_header, filterProvider.getGoogleTaskFilters(), true); if (navigationDrawer) { add(new NavigationDrawerSeparator());