mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-21 20:49:36 +01:00
Fix bugs with autocomplete
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
d8cd08884c
commit
e3ad95da74
@ -17,8 +17,8 @@ android {
|
||||
targetSdkVersion 28
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
versionCode 81
|
||||
versionName "3.2.2"
|
||||
versionCode 82
|
||||
versionName "3.2.3"
|
||||
|
||||
flavorDimensions "default"
|
||||
renderscriptTargetApi 19
|
||||
|
@ -21,17 +21,16 @@
|
||||
package com.nextcloud.talk.callbacks;
|
||||
|
||||
import android.text.Editable;
|
||||
|
||||
import com.nextcloud.talk.models.json.mention.Mention;
|
||||
import com.nextcloud.talk.utils.MagicCharPolicy;
|
||||
import com.otaliastudios.autocomplete.AutocompleteCallback;
|
||||
import com.otaliastudios.autocomplete.CharPolicy;
|
||||
|
||||
public class MentionAutocompleteCallback implements AutocompleteCallback<Mention> {
|
||||
@Override
|
||||
public boolean onPopupItemClicked(Editable editable, Mention item) {
|
||||
int[] range = CharPolicy.getQueryRange(editable);
|
||||
int[] range = MagicCharPolicy.getQueryRange(editable);
|
||||
if (range == null) return false;
|
||||
int start = range[0];
|
||||
int start = range[0] + 1;
|
||||
int end = range[1];
|
||||
String replacement = item.getId() + " ";
|
||||
editable.replace(start, end, replacement);
|
||||
|
@ -22,7 +22,6 @@ package com.nextcloud.talk.utils;
|
||||
|
||||
import android.text.Spannable;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.otaliastudios.autocomplete.AutocompletePolicy;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user