mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Categorize identities
This commit is contained in:
@@ -373,6 +373,11 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
|
||||
Collections.sort(identities, new Comparator<TupleIdentityEx>() {
|
||||
@Override
|
||||
public int compare(TupleIdentityEx i1, TupleIdentityEx i2) {
|
||||
int c = collator.compare(
|
||||
i1.accountCategory == null ? "" : i1.accountCategory,
|
||||
i2.accountCategory == null ? "" : i2.accountCategory);
|
||||
if (c != 0)
|
||||
return c;
|
||||
int n = collator.compare(i1.getDisplayName(), i2.getDisplayName());
|
||||
if (n != 0)
|
||||
return n;
|
||||
@@ -450,6 +455,13 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
|
||||
return items.get(position).id;
|
||||
}
|
||||
|
||||
public TupleIdentityEx getItemAtPosition(int pos) {
|
||||
if (pos >= 0 && pos < items.size())
|
||||
return items.get(pos);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
|
||||
Reference in New Issue
Block a user