From aa42eb544a1ebf99dc52d71c917b899d1fce628d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 5 Feb 2014 22:33:39 +0100 Subject: basic muc support. reworked contact list stuff --- src/de/gultsch/chat/utils/UIHelper.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/de/gultsch/chat/utils') diff --git a/src/de/gultsch/chat/utils/UIHelper.java b/src/de/gultsch/chat/utils/UIHelper.java index 1c7a568ea..b7ea5289e 100644 --- a/src/de/gultsch/chat/utils/UIHelper.java +++ b/src/de/gultsch/chat/utils/UIHelper.java @@ -46,13 +46,11 @@ public class UIHelper { public static Bitmap getUnknownContactPicture(String name, int size) { String firstLetter = name.substring(0, 1).toUpperCase(); - String centerLetter = name.substring(name.length() / 2, - (name.length() / 2) + 1); int holoColors[] = { 0xFF1da9da, 0xFFb368d9, 0xFF83b600, 0xFFffa713, 0xFFe92727 }; - int color = holoColors[centerLetter.charAt(0) % holoColors.length]; + int color = holoColors[Math.abs(name.hashCode()) % holoColors.length]; Bitmap bitmap = Bitmap .createBitmap(size, size, Bitmap.Config.ARGB_8888); -- cgit v1.2.3