mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Bugfix for negative modulo result indexing the palette array
This commit is contained in:
parent
64212072c0
commit
d45c8b053b
@ -163,7 +163,7 @@ public class ContactPictureLoader {
|
|||||||
|
|
||||||
private int calcUnknownContactColor(Address address) {
|
private int calcUnknownContactColor(Address address) {
|
||||||
int val = address.getAddress().toLowerCase().hashCode();
|
int val = address.getAddress().toLowerCase().hashCode();
|
||||||
int rgb = CONTACT_DUMMY_COLORS_ARGB[val % CONTACT_DUMMY_COLORS_ARGB.length];
|
int rgb = CONTACT_DUMMY_COLORS_ARGB[Math.abs(val) % CONTACT_DUMMY_COLORS_ARGB.length];
|
||||||
return rgb;
|
return rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user