forked from mirrors/Fedilab
Fix an issue with mentions (compose)
This commit is contained in:
parent
4b3236e97e
commit
86f39fb4ee
2 changed files with 2 additions and 2 deletions
|
@ -890,7 +890,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
holder.binding.content.setAdapter(accountsListAdapter);
|
holder.binding.content.setAdapter(accountsListAdapter);
|
||||||
final String oldContent = holder.binding.content.getText().toString();
|
final String oldContent = holder.binding.content.getText().toString();
|
||||||
if (oldContent.length() >= currentCursorPosition) {
|
if (oldContent.length() >= currentCursorPosition) {
|
||||||
String[] searchA = oldContent.substring(0, currentCursorPosition).split("@");
|
String[] searchA = oldContent.substring(0, currentCursorPosition).split("\\s+@|^@");
|
||||||
if (searchA.length > 0) {
|
if (searchA.length > 0) {
|
||||||
final String search = searchA[searchA.length - 1];
|
final String search = searchA[searchA.length - 1];
|
||||||
holder.binding.content.setOnItemClickListener((parent, view, position, id) -> {
|
holder.binding.content.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
@ -906,7 +906,6 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
if (currentCursorPosition >= oldContent.length())
|
if (currentCursorPosition >= oldContent.length())
|
||||||
deltaSearch = oldContent.substring(currentCursorPosition - searchLength);
|
deltaSearch = oldContent.substring(currentCursorPosition - searchLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!search.equals(""))
|
if (!search.equals(""))
|
||||||
deltaSearch = deltaSearch.replace("@" + search, "");
|
deltaSearch = deltaSearch.replace("@" + search, "");
|
||||||
String newContent = oldContent.substring(0, currentCursorPosition - searchLength);
|
String newContent = oldContent.substring(0, currentCursorPosition - searchLength);
|
||||||
|
|
|
@ -925,6 +925,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
} else {
|
} else {
|
||||||
holder.binding.username.setCompoundDrawables(null, null, null, null);
|
holder.binding.username.setCompoundDrawables(null, null, null, null);
|
||||||
}
|
}
|
||||||
|
//Button sizes depending of the defined scale
|
||||||
float normalSize = Helper.convertDpToPixel(28, context);
|
float normalSize = Helper.convertDpToPixel(28, context);
|
||||||
holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scale);
|
holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scale);
|
||||||
holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scale);
|
holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scale);
|
||||||
|
|
Loading…
Reference in a new issue