mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
fix tag filtering.
This commit is contained in:
parent
070f625aaa
commit
abc22f070c
2 changed files with 8 additions and 1 deletions
|
|
@ -32,6 +32,10 @@ public class TagsHelper {
|
|||
return this.tagsId;
|
||||
}
|
||||
|
||||
public boolean isTagChecked(String tagID) {
|
||||
return this.tagsId.contains(tagID);
|
||||
}
|
||||
|
||||
public List<Task> filter(List<Task> tasks) {
|
||||
List<Task> filtered = new ArrayList<Task>();
|
||||
for (Task t : tasks) {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,9 @@ public class TasksFragment extends BaseFragment implements OnCheckedChangeListen
|
|||
filterDrawer.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.RIGHT);
|
||||
|
||||
viewPager.setCurrentItem(0);
|
||||
this.tagsHelper = new TagsHelper();
|
||||
if (this.tagsHelper == null) {
|
||||
this.tagsHelper = new TagsHelper();
|
||||
}
|
||||
|
||||
loadTaskLists();
|
||||
|
||||
|
|
@ -462,6 +464,7 @@ public class TasksFragment extends BaseFragment implements OnCheckedChangeListen
|
|||
filterDrawer.addItem(new SwitchDrawerItem()
|
||||
.withName(t.getName())
|
||||
.withTag(t)
|
||||
.withChecked(this.tagsHelper.isTagChecked(t.getId()))
|
||||
.withOnCheckedChangeListener(this)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue