From 61ff1608f803e1a8c73da4768052e06e7cbd61ff Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 14 Sep 2023 11:14:01 +0200 Subject: [PATCH] Fix polls --- .../app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java | 2 +- app/src/main/res/layouts/mastodon/layout/layout_poll_item.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java index 6eff3cf5..f05f5a20 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java @@ -1826,7 +1826,7 @@ public class StatusAdapter extends RecyclerView.Adapter } for (Poll.PollItem pollItem : statusToDeal.poll.options) { @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.pollItemText.setText( pollItem.getSpanTitle(context, statusToDeal, diff --git a/app/src/main/res/layouts/mastodon/layout/layout_poll_item.xml b/app/src/main/res/layouts/mastodon/layout/layout_poll_item.xml index c630f2ce..d1972b1d 100644 --- a/app/src/main/res/layouts/mastodon/layout/layout_poll_item.xml +++ b/app/src/main/res/layouts/mastodon/layout/layout_poll_item.xml @@ -40,7 +40,7 @@ android:layout_marginStart="12dp" android:drawablePadding="5dp" android:ellipsize="end" - android:singleLine="true" + android:singleLine="false" tools:text="Option" />