Fix polls

This commit is contained in:
Thomas 2023-09-14 11:14:01 +02:00
parent 14127fd203
commit 61ff1608f8
2 changed files with 2 additions and 2 deletions

View file

@ -1826,7 +1826,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} }
for (Poll.PollItem pollItem : statusToDeal.poll.options) { for (Poll.PollItem pollItem : statusToDeal.poll.options) {
@NonNull LayoutPollItemBinding pollItemBinding = LayoutPollItemBinding.inflate(inflater, holder.binding.poll.rated, true); @NonNull LayoutPollItemBinding pollItemBinding = LayoutPollItemBinding.inflate(inflater, holder.binding.poll.rated, true);
double value = Math.ceil((pollItem.votes_count * 100) / (double) statusToDeal.poll.voters_count); double value = Math.round((pollItem.votes_count * 100) / (double) statusToDeal.poll.voters_count);
pollItemBinding.pollItemPercent.setText(String.format("%s %%", (int) value)); pollItemBinding.pollItemPercent.setText(String.format("%s %%", (int) value));
pollItemBinding.pollItemText.setText( pollItemBinding.pollItemText.setText(
pollItem.getSpanTitle(context, statusToDeal, pollItem.getSpanTitle(context, statusToDeal,

View file

@ -40,7 +40,7 @@
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="false"
tools:text="Option" /> tools:text="Option" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>