Fix an issue with mentions (compose)

This commit is contained in:
Thomas 2022-10-20 16:18:22 +02:00
parent 4b3236e97e
commit 86f39fb4ee
2 changed files with 2 additions and 2 deletions

View File

@ -890,7 +890,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.content.setAdapter(accountsListAdapter);
final String oldContent = holder.binding.content.getText().toString();
if (oldContent.length() >= currentCursorPosition) {
String[] searchA = oldContent.substring(0, currentCursorPosition).split("@");
String[] searchA = oldContent.substring(0, currentCursorPosition).split("\\s+@|^@");
if (searchA.length > 0) {
final String search = searchA[searchA.length - 1];
holder.binding.content.setOnItemClickListener((parent, view, position, id) -> {
@ -906,7 +906,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
if (currentCursorPosition >= oldContent.length())
deltaSearch = oldContent.substring(currentCursorPosition - searchLength);
}
if (!search.equals(""))
deltaSearch = deltaSearch.replace("@" + search, "");
String newContent = oldContent.substring(0, currentCursorPosition - searchLength);

View File

@ -925,6 +925,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else {
holder.binding.username.setCompoundDrawables(null, null, null, null);
}
//Button sizes depending of the defined scale
float normalSize = Helper.convertDpToPixel(28, context);
holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scale);
holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scale);