mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2025-01-03 14:40:07 +02:00
some fixes
This commit is contained in:
parent
aae5c8e3ca
commit
8aaf5bfb25
2 changed files with 5 additions and 3 deletions
|
@ -243,6 +243,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
if (statusDraft.statusReplyList != null) {
|
if (statusDraft.statusReplyList != null) {
|
||||||
statusDraft.statusReplyList = SpannableHelper.convertStatus(getApplication().getApplicationContext(), statusDraft.statusReplyList);
|
statusDraft.statusReplyList = SpannableHelper.convertStatus(getApplication().getApplicationContext(), statusDraft.statusReplyList);
|
||||||
}
|
}
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
if (statusDraft.statusReplyList != null) {
|
if (statusDraft.statusReplyList != null) {
|
||||||
statusList.addAll(statusDraft.statusReplyList);
|
statusList.addAll(statusDraft.statusReplyList);
|
||||||
|
@ -257,12 +258,13 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
binding.recyclerView.setAdapter(composeAdapter);
|
binding.recyclerView.setAdapter(composeAdapter);
|
||||||
binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1);
|
binding.recyclerView.scrollToPosition(composeAdapter.getItemCount() - 1);
|
||||||
};
|
};
|
||||||
myRunnable.run();
|
mainHandler.post(myRunnable);
|
||||||
}).start();
|
}).start();
|
||||||
|
|
||||||
} else if (statusReply != null) {
|
} else if (statusReply != null) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
statusReply = SpannableHelper.convertStatus(getApplication().getApplicationContext(), statusReply);
|
statusReply = SpannableHelper.convertStatus(getApplication().getApplicationContext(), statusReply);
|
||||||
|
Handler mainHandler = new Handler(Looper.getMainLooper());
|
||||||
Runnable myRunnable = () -> {
|
Runnable myRunnable = () -> {
|
||||||
statusList.add(statusReply);
|
statusList.add(statusReply);
|
||||||
int statusCount = statusList.size();
|
int statusCount = statusList.size();
|
||||||
|
@ -315,7 +317,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
|
||||||
statusesVM.getContext(currentInstance, BaseMainActivity.currentToken, statusReply.id)
|
statusesVM.getContext(currentInstance, BaseMainActivity.currentToken, statusReply.id)
|
||||||
.observe(ComposeActivity.this, this::initializeContextView);
|
.observe(ComposeActivity.this, this::initializeContextView);
|
||||||
};
|
};
|
||||||
myRunnable.run();
|
mainHandler.post(myRunnable);
|
||||||
}).start();
|
}).start();
|
||||||
} else {
|
} else {
|
||||||
//Compose without replying
|
//Compose without replying
|
||||||
|
|
|
@ -1153,7 +1153,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
||||||
addAttachment(position, uris);
|
addAttachment(position, uris);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (statusDraft.cursorPosition < holder.binding.content.length()) {
|
if (statusDraft.cursorPosition <= holder.binding.content.length()) {
|
||||||
holder.binding.content.setSelection(statusDraft.cursorPosition);
|
holder.binding.content.setSelection(statusDraft.cursorPosition);
|
||||||
}
|
}
|
||||||
if (statusDraft.setCursorToEnd) {
|
if (statusDraft.setCursorToEnd) {
|
||||||
|
|
Loading…
Reference in a new issue