1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-24 08:38:51 -05:00

Fix contact picture color generation.

Make sure to return different colors for senders with different name,
but the same mail address (e.g. mails sent by certain issue tracking
systems).
This commit is contained in:
Danny Baumann 2013-11-11 13:29:14 +01:00
parent 0eb24512b0
commit b500047e42

View File

@ -161,7 +161,7 @@ public class ContactPictureLoader {
return mDefaultBackgroundColor;
}
int val = address.getAddress().toLowerCase(Locale.getDefault()).hashCode();
int val = address.hashCode();
int rgb = CONTACT_DUMMY_COLORS_ARGB[Math.abs(val) % CONTACT_DUMMY_COLORS_ARGB.length];
return rgb;
}