1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-03-09 05:50:34 -04: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 committed by cketti
parent 6ebec69383
commit f95ab8f6a8

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;
}