diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-12-13 17:46:34 +0300 |
---|---|---|
committer | desperateCoder <echotodevnull@gmail.com> | 2020-12-13 17:46:34 +0300 |
commit | 88f769c2b61379695356f40a54acb2a5ccdb5bce (patch) | |
tree | 701c4fa307288a2a9ac85e0d523e3c383b7076d2 | |
parent | 58ac12886cb5b53adacc08da9ccc833f232c6518 (diff) |
#597 filter widget: actually select the cards by filter information WIP
2 files changed, 19 insertions, 6 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/widget/filter/FilterWidgetSort.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/widget/filter/FilterWidgetSort.java index 43fbdfe12..965e701f3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/widget/filter/FilterWidgetSort.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/widget/filter/FilterWidgetSort.java @@ -75,6 +75,14 @@ public class FilterWidgetSort { this.ruleOrder = ruleOrder; } + public boolean isDirection() { + return direction; + } + + public void setDirection(boolean direction) { + this.direction = direction; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java index 5b0bb298c..1e2c2a554 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DataBaseAdapter.java @@ -1148,15 +1148,20 @@ public class DataBaseAdapter { List<FullCard> cardsResult = new ArrayList<>(); List<Long> accounts = new ArrayList<>(); List<Long> stacks = new ArrayList<>(); - for (FilterWidgetAccount account : filterWidget.getAccounts()) { - accounts.add(account.getId()); - if (account.getBoards().isEmpty()) { - filter - cardsResult.addAll(db.getCardDao().getFilteredFullCardsForStackDirectly(getQueryForFilter(filter, accounts, stacks))); - } else { + if (filterWidget.getAccounts().isEmpty()) { + + } else { + for (FilterWidgetAccount account : filterWidget.getAccounts()) { + accounts.add(account.getId()); + if (account.getBoards().isEmpty()) { +// filter + cardsResult.addAll(db.getCardDao().getFilteredFullCardsForStackDirectly(getQueryForFilter(filter, accounts, stacks))); + } else { + } } } + if (filterWidget.getDueType()!=null) { filter.setDueType(EDueType.findById(filterWidget.getDueType())); } else filter.setDueType(EDueType.NO_FILTER); |