From e175a721d4e9d27ca091ecb189632142af25d664 Mon Sep 17 00:00:00 2001 From: sk Date: Fri, 2 Jun 2023 00:17:50 +0200 Subject: [PATCH] remove additional padding with translate button --- .../android/ui/displayitems/TextStatusDisplayItem.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/TextStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/TextStatusDisplayItem.java index fb9deb65a..c6fbd646e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/TextStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/TextStatusDisplayItem.java @@ -237,6 +237,15 @@ public class TextStatusDisplayItem extends StatusDisplayItem{ readMore.setText(item.status.textExpanded ? R.string.sk_collapse : R.string.sk_expand); spaceBelowText.setVisibility(translateVisible ? View.VISIBLE : View.GONE); + // remove additional padding when (transparently padded) translate button is visible + int pos = getAbsoluteAdapterPosition(); + itemView.setPadding(itemView.getPaddingLeft(), itemView.getPaddingTop(), itemView.getPaddingRight(), + (translateVisible && + item.parentFragment.getDisplayItems().size() >= pos + 1 && + item.parentFragment.getDisplayItems().get(pos + 1) instanceof FooterStatusDisplayItem) + ? 0 : V.dp(12) + ); + if (!GlobalUserPreferences.collapseLongPosts) { textScrollView.setLayoutParams(wrapParams); readMore.setVisibility(View.GONE);