1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 18:27:43 +00:00

Small improvement/fix

This commit is contained in:
M66B 2020-03-16 08:31:08 +01:00
parent 7eecc3f54e
commit 7f49de2a83

View file

@ -4630,8 +4630,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
for (int i = 0; i < list.size(); i++) {
TupleMessageEx message = list.get(i);
if (message != null)
if (message != null) {
keyPosition.put(message.id, i);
message.resolveKeywordColors(context);
}
}
differ.submitList(list);
@ -4767,18 +4769,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
int getPositionForKey(long key) {
if (keyPosition.isEmpty()) {
PagedList<TupleMessageEx> messages = getCurrentList();
if (messages != null) {
for (int i = 0; i < messages.size(); i++) {
TupleMessageEx message = messages.get(i);
if (message != null)
keyPosition.put(message.id, i);
}
Log.i("Mapped keys=" + keyPosition.size());
}
}
if (keyPosition.containsKey(key)) {
int pos = keyPosition.get(key);
Log.d("Position=" + pos + " @Key=" + key);