From b0405ae8542ac2b7baaf6352e18c29e586818791 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 17 May 2022 08:22:06 +0200 Subject: [PATCH] Fix issue #57 --- .../main/java/app/fedilab/android/helper/SpannableHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index 73d99369..115a823d 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -184,7 +184,7 @@ public class SpannableHelper { if (matchEnd > content.toString().length()) { matchEnd = content.toString().length(); } - if (content.toString().length() > matchEnd || matchStart < 0) { + if (content.toString().length() < matchEnd || matchStart < 0) { continue; } final String url = content.toString().substring(matchStart, matchEnd); @@ -210,7 +210,7 @@ public class SpannableHelper { continue; } - if (matchStart >= 0 && matchEnd <= content.length() && matchEnd >= matchStart) { + if (matchEnd <= content.length() && matchEnd >= matchStart) { content.setSpan(new LongClickableSpan() { @Override public void onLongClick(View view) {