Fix polls

This commit is contained in:
Grishka
2023-06-26 16:09:02 +03:00
parent bf996feccf
commit b69565e9e6

View File

@@ -91,6 +91,7 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{
bg.setLevel(Math.round(10000f*item.votesFraction)); bg.setLevel(Math.round(10000f*item.votesFraction));
button.setBackground(bg); button.setBackground(bg);
itemView.setSelected(item.isMostVoted); itemView.setSelected(item.isMostVoted);
check.setSelected(item.poll.ownVotes!=null && item.poll.ownVotes.contains(item.optionIndex));
percent.setText(String.format(Locale.getDefault(), "%d%%", Math.round(item.votesFraction*100f))); percent.setText(String.format(Locale.getDefault(), "%d%%", Math.round(item.votesFraction*100f)));
}else{ }else{
itemView.setSelected(item.poll.selectedOptions!=null && item.poll.selectedOptions.contains(item.option)); itemView.setSelected(item.poll.selectedOptions!=null && item.poll.selectedOptions.contains(item.option));