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 2724e27e8..caa4e3d4c 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 @@ -1482,16 +1482,12 @@ public class StatusAdapter extends RecyclerView.Adapter holder.binding.media.media3Container.mediaRoot.setVisibility(View.VISIBLE); holder.binding.media.media4Container.mediaRoot.setVisibility(View.VISIBLE); holder.binding.media.moreMedia.setVisibility(View.VISIBLE); + holder.binding.media.moreMedia.setText(context.getString(R.string.more_media, "+" + (statusToDeal.media_attachments.size() - 4))); } } for (Attachment attachment : statusToDeal.media_attachments) { - if (fullAttachement) { - - } LayoutMediaBinding layoutMediaBinding = null; - - if ((fullAttachement && (!statusToDeal.sensitive || expand_media))) { layoutMediaBinding = LayoutMediaBinding.inflate(LayoutInflater.from(context)); holder.binding.mediaContainer.addView(layoutMediaBinding.getRoot()); @@ -1524,13 +1520,9 @@ public class StatusAdapter extends RecyclerView.Adapter } loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, mediaW, mediaH, ratio, statusToDeal, attachment); - } else { - if (layoutMediaBinding != null) { - loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, -1.f, -1.f, -1.f, statusToDeal, attachment); - } + } else if (layoutMediaBinding != null) { + loadAndAddAttachment(context, layoutMediaBinding, holder, adapter, mediaPosition, -1.f, -1.f, -1.f, statusToDeal, attachment); } - - mediaPosition++; } if (!fullAttachement || statusToDeal.sensitive) { @@ -1622,7 +1614,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 = ((double) (pollItem.votes_count * 100) / (double) statusToDeal.poll.voters_count); + double value = Math.ceil((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/java/app/fedilab/android/mastodon/ui/drawer/StatusDirectMessageAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusDirectMessageAdapter.java index 36f3b9db3..340462e03 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusDirectMessageAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusDirectMessageAdapter.java @@ -285,7 +285,7 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter @@ -460,7 +461,7 @@ android:id="@+id/media" layout="@layout/layout_drawer_attachments" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="300dp" android:layout_marginStart="48dp" android:layout_marginTop="6dp" android:layout_marginEnd="6dp" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 42727e84b..e8aa1f504 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1904,4 +1904,5 @@ Translator domain Chat timeline for direct messages + %1$s more media \ No newline at end of file