Highlight your own votes when displaying poll results (#2242)
* Highlight your own votes when displaying poll results * Unbreak tests * Add a checkmark to the description of self-voted options
This commit is contained in:
parent
45598cf047
commit
d07c1b098e
12 changed files with 47 additions and 15 deletions
|
|
@ -659,9 +659,12 @@ public class NotificationHelper {
|
|||
StringBuilder builder = new StringBuilder(notification.getStatus().getContent());
|
||||
builder.append('\n');
|
||||
Poll poll = notification.getStatus().getPoll();
|
||||
for(PollOption option: poll.getOptions()) {
|
||||
List<PollOption> options = poll.getOptions();
|
||||
for(int i = 0; i < options.size(); ++i) {
|
||||
PollOption option = options.get(i);
|
||||
builder.append(buildDescription(option.getTitle(),
|
||||
PollViewDataKt.calculatePercent(option.getVotesCount(), poll.getVotersCount(), poll.getVotesCount()),
|
||||
poll.getOwnVotes() != null && poll.getOwnVotes().contains(i),
|
||||
context));
|
||||
builder.append('\n');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue