mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-23 09:10:04 +02:00
Fix issue #340
This commit is contained in:
parent
68f779c943
commit
63a5423d7d
1 changed files with 4 additions and 4 deletions
|
@ -763,11 +763,9 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
public void run() {
|
public void run() {
|
||||||
String fedilabHugsTrigger = ":fedilab_hugs:";
|
String fedilabHugsTrigger = ":fedilab_hugs:";
|
||||||
String fedilabMorseTrigger = ":fedilab_morse:";
|
String fedilabMorseTrigger = ":fedilab_morse:";
|
||||||
|
|
||||||
if (s.toString().contains(fedilabHugsTrigger)) {
|
if (s.toString().contains(fedilabHugsTrigger)) {
|
||||||
newContent[0] = s.toString().replaceAll(fedilabHugsTrigger, "");
|
newContent[0] = s.toString().replaceAll(Pattern.quote(fedilabHugsTrigger), "").trim();
|
||||||
|
int toFill = 500 - newContent[0].length();
|
||||||
int toFill = 500 - currentLength;
|
|
||||||
if (toFill <= 0) {
|
if (toFill <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -782,6 +780,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
newContent[0] = newContent[0] + hugs;
|
newContent[0] = newContent[0] + hugs;
|
||||||
holder.binding.content.setText(newContent[0]);
|
holder.binding.content.setText(newContent[0]);
|
||||||
holder.binding.content.setSelection(holder.binding.content.getText().length());
|
holder.binding.content.setSelection(holder.binding.content.getText().length());
|
||||||
|
statusList.get(holder.getBindingAdapterPosition()).text = newContent[0];
|
||||||
autocomplete = false;
|
autocomplete = false;
|
||||||
updateCharacterCount(holder);
|
updateCharacterCount(holder);
|
||||||
};
|
};
|
||||||
|
@ -826,6 +825,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
|
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
holder.binding.content.setText(newContent[0]);
|
holder.binding.content.setText(newContent[0]);
|
||||||
|
statusList.get(holder.getBindingAdapterPosition()).text = newContent[0];
|
||||||
holder.binding.content.setSelection(holder.binding.content.getText().length());
|
holder.binding.content.setSelection(holder.binding.content.getText().length());
|
||||||
autocomplete = false;
|
autocomplete = false;
|
||||||
updateCharacterCount(holder);
|
updateCharacterCount(holder);
|
||||||
|
|
Loading…
Reference in a new issue