diff options
author | Stefan Niedermann <info@niedermann.it> | 2021-04-01 12:01:19 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2021-04-01 12:01:19 +0300 |
commit | f1dce8938ec77378f8c695332e9b8cf107ed8c82 (patch) | |
tree | 1d426ad7b977205522378e409bdddbd7bd76b672 /app/src/main/java | |
parent | 65ca6b257f3dbd84d34e5cec1a12a67c52255d97 (diff) |
Fix #910 Number of tasks in a checklist is not shown unless there is a comment on the card too
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java')
5 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java index 6f2b70020..9914377e0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/model/Card.java @@ -91,11 +91,12 @@ public class Card extends AbstractRemoteEntity { this.commentsUnread = card.getCommentsUnread(); } + @NonNull public TaskStatus getTaskStatus() { if (taskStatus == null) { int count = 0, done = 0; if (description != null) { - Matcher matcher = PATTERN_MD_TASK.matcher(description); + final Matcher matcher = PATTERN_MD_TASK.matcher(description); while (matcher.find()) { count++; char c = matcher.group().charAt(1); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java index e25bf9719..3ab850b43 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CardAdapter.java @@ -101,7 +101,8 @@ public class CardAdapter extends RecyclerView.Adapter<AbstractCardViewHolder> im if (fullCard.getAttachments().size() == 0 && fullCard.getAssignedUsers().size() == 0 && fullCard.getLabels().size() == 0 - && fullCard.getCommentCount() == 0) { + && fullCard.getCommentCount() == 0 + && fullCard.getCard().getTaskStatus().taskCount == 0) { return R.layout.item_card_default_only_title; } return R.layout.item_card_default; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CompactCardViewHolder.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CompactCardViewHolder.java index e9f366d99..0e3cd58c0 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CompactCardViewHolder.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/CompactCardViewHolder.java @@ -21,7 +21,7 @@ import it.niedermann.nextcloud.deck.model.Label; import it.niedermann.nextcloud.deck.model.full.FullCard; public class CompactCardViewHolder extends AbstractCardViewHolder { - private ItemCardCompactBinding binding; + private final ItemCardCompactBinding binding; @SuppressWarnings("WeakerAccess") public CompactCardViewHolder(@NonNull ItemCardCompactBinding binding) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardOnlyTitleViewHolder.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardOnlyTitleViewHolder.java index 2f9e132c9..27aacc614 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardOnlyTitleViewHolder.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardOnlyTitleViewHolder.java @@ -14,7 +14,7 @@ import com.google.android.material.card.MaterialCardView; import it.niedermann.nextcloud.deck.databinding.ItemCardDefaultOnlyTitleBinding; public class DefaultCardOnlyTitleViewHolder extends AbstractCardViewHolder { - private ItemCardDefaultOnlyTitleBinding binding; + private final ItemCardDefaultOnlyTitleBinding binding; @SuppressWarnings("WeakerAccess") public DefaultCardOnlyTitleViewHolder(@NonNull ItemCardDefaultOnlyTitleBinding binding) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardViewHolder.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardViewHolder.java index 6025cdada..0d6a7dea6 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardViewHolder.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/DefaultCardViewHolder.java @@ -29,7 +29,7 @@ import it.niedermann.nextcloud.deck.model.User; import it.niedermann.nextcloud.deck.model.full.FullCard; public class DefaultCardViewHolder extends AbstractCardViewHolder { - private ItemCardDefaultBinding binding; + private final ItemCardDefaultBinding binding; @SuppressWarnings("WeakerAccess") public DefaultCardViewHolder(@NonNull ItemCardDefaultBinding binding) { |