mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Fix for IndexOutOfBoundException (race condition on Recipients resolution)
This commit is contained in:
parent
b044a68168
commit
a29120d911
@ -172,12 +172,13 @@ public class ConversationListItem extends RelativeLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
private CharSequence formatFrom(Recipients from, long count, boolean read) {
|
private CharSequence formatFrom(Recipients from, long count, boolean read) {
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder(from.toShortString());
|
String fromString = from.toShortString();
|
||||||
|
SpannableStringBuilder builder = new SpannableStringBuilder(fromString);
|
||||||
|
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
builder.append(" " + count);
|
builder.append(" " + count);
|
||||||
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#66333333")),
|
builder.setSpan(new ForegroundColorSpan(Color.parseColor("#66333333")),
|
||||||
from.toShortString().length(), builder.length(),
|
fromString.length(), builder.length(),
|
||||||
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,6 +199,7 @@ public class ConversationListItem extends RelativeLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class CheckedChangedListener implements CompoundButton.OnCheckedChangeListener {
|
private class CheckedChangedListener implements CompoundButton.OnCheckedChangeListener {
|
||||||
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isChecked) selectedThreads.add(threadId);
|
if (isChecked) selectedThreads.add(threadId);
|
||||||
else selectedThreads.remove(threadId);
|
else selectedThreads.remove(threadId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user