From 39f3e72a47b2e07ba927456b6823189599968550 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Tue, 19 Mar 2024 09:14:09 +0100 Subject: [PATCH] fix: display inline avatar on short text --- .../displayitems/ReblogOrReplyLineStatusDisplayItem.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java index 180c27ef4..c297ac7e5 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java @@ -67,7 +67,12 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{ ssb.setSpan(new SpacerSpan(15, 20), 1, 2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); } int replyPrefixLength=context.getString(R.string.in_reply_to).length()-2; //subtract 2 for placeholder - if(status.inReplyToAccountId!=null&&ssb.length()>replyPrefixLength&&account!=null){ + boolean shortText=false; + if(account!=null&&text.toString().equals(account.getDisplayName())){ + replyPrefixLength=0; + shortText=true; + } + if((status.inReplyToAccountId!=null || shortText) && ssb.length()>=replyPrefixLength && account!=null){ //add temp chars for span replacement, should be same as spans added below ssb.insert(replyPrefixLength, " "); ssb.setSpan(new SpacerSpan(15, 20), replyPrefixLength+1, replyPrefixLength+2, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);