Fix an issue with mentions (compose)

pull/434/head
Thomas 2 years ago
parent 4b3236e97e
commit 86f39fb4ee

@ -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);

@ -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);

Loading…
Cancel
Save