From 910e14b37e253ef50f482d980d036922c3a5d4a9 Mon Sep 17 00:00:00 2001 From: Niedermann IT-Dienstleistungen Date: Fri, 24 Aug 2018 18:34:24 +0200 Subject: [PATCH] Fix in-note-search --- .../java/it/niedermann/owncloud/notes/util/DisplayUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/util/DisplayUtils.java b/app/src/main/java/it/niedermann/owncloud/notes/util/DisplayUtils.java index 00696a8a..431b3ed9 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/util/DisplayUtils.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/util/DisplayUtils.java @@ -49,8 +49,8 @@ public class DisplayUtils { while (m.find()) { - int start = text.indexOf(m.group()); - int end = text.indexOf(m.group()) + m.group().length(); + int start = m.start(); + int end = m.end(); spannable.setSpan(new ForegroundColorSpan(color), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); spannable.setSpan(new StyleSpan(Typeface.BOLD), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); }