aboutsummaryrefslogtreecommitdiffstats
path: root/src/de/gultsch/chat/utils
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-05 22:33:39 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-02-05 22:33:39 +0100
commitaa42eb544a1ebf99dc52d71c917b899d1fce628d (patch)
treebb5523f3342823faf7dce746d298f2650936d03a /src/de/gultsch/chat/utils
parent4670585e7a474d878c823df6de1846980b5c65d3 (diff)
basic muc support. reworked contact list stuff
Diffstat (limited to 'src/de/gultsch/chat/utils')
-rw-r--r--src/de/gultsch/chat/utils/UIHelper.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/de/gultsch/chat/utils/UIHelper.java b/src/de/gultsch/chat/utils/UIHelper.java
index 1c7a568e..b7ea5289 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);