mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
found the error
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
This commit is contained in:
parent
11fc9fa0d0
commit
4feac1cb50
@ -366,15 +366,23 @@ class MessageInputFragment : Fragment() {
|
|||||||
var mentionSpan: Spans.MentionChipSpan
|
var mentionSpan: Spans.MentionChipSpan
|
||||||
for (i in mentionSpans.indices) {
|
for (i in mentionSpans.indices) {
|
||||||
mentionSpan = mentionSpans[i]
|
mentionSpan = mentionSpans[i]
|
||||||
|
val start = editable.getSpanStart(mentionSpan)
|
||||||
|
val end = editable.getSpanEnd(mentionSpan)
|
||||||
|
Log.d("Julius", "S:$start E:$end")
|
||||||
if (start >= editable.getSpanStart(mentionSpan) &&
|
if (start >= editable.getSpanStart(mentionSpan) &&
|
||||||
start < editable.getSpanEnd(mentionSpan)
|
start < editable.getSpanEnd(mentionSpan)
|
||||||
) {
|
) {
|
||||||
if (editable.subSequence(
|
val what = editable.subSequence(
|
||||||
editable.getSpanStart(mentionSpan),
|
editable.getSpanStart(mentionSpan),
|
||||||
editable.getSpanEnd(mentionSpan)
|
editable.getSpanEnd(mentionSpan)
|
||||||
).toString().trim { it <= ' ' } != mentionSpan.label
|
).toString()
|
||||||
|
|
||||||
|
if (what.trim { it <= ' ' } != mentionSpan.label
|
||||||
) {
|
) {
|
||||||
editable.removeSpan(mentionSpan)
|
Log.d("Julius", "What: $what")
|
||||||
|
Log.d("Julius", "MentionSpan removed: $mentionSpan")
|
||||||
|
// FIXME error here- I knew it I was right, but why?
|
||||||
|
// editable.removeSpan(mentionSpan)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,14 @@ package com.nextcloud.talk.utils;
|
|||||||
|
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import com.otaliastudios.autocomplete.AutocompletePolicy;
|
import com.otaliastudios.autocomplete.AutocompletePolicy;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
public class CharPolicy implements AutocompletePolicy {
|
public class CharPolicy implements AutocompletePolicy {
|
||||||
|
|
||||||
private final char character;
|
private final char character;
|
||||||
|
Loading…
Reference in New Issue
Block a user