From f5e1326d9f82c340d43f63134e9c952fdce8af54 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Fri, 17 Nov 2023 20:27:38 +0100 Subject: [PATCH] fix: hide results button when voted --- .../android/ui/displayitems/PollFooterStatusDisplayItem.java | 1 + 1 file changed, 1 insertion(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollFooterStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollFooterStatusDisplayItem.java index 8e187417d3..abe11794c2 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollFooterStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollFooterStatusDisplayItem.java @@ -55,6 +55,7 @@ public void onBind(PollFooterStatusDisplayItem item){ text+=" "+sep+" "+item.parentFragment.getString(R.string.poll_closed); } this.text.setText(text); + resultsButton.setVisibility(item.poll.isExpired() || item.poll.voted ? View.GONE : View.VISIBLE); resultsButton.setText(item.resultsVisible ? R.string.sk_poll_view : R.string.sk_poll_results); voteButton.setVisibility(item.poll.isExpired() || item.poll.voted || (!item.poll.multiple && !GlobalUserPreferences.voteButtonForSingleChoice) ? View.GONE : View.VISIBLE); voteButton.setEnabled(item.poll.selectedOptions!=null && !item.poll.selectedOptions.isEmpty() && !item.resultsVisible);