diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-10 21:33:48 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-10 21:33:48 +0100 |
commit | 8031e1e521f5e051f11c48ac5ebdda0956837e9c (patch) | |
tree | af8b50685989b7587a50e18d8c6c0761a273e9ea /src/main/java/de/pixart/messenger/ui/adapter | |
parent | 213672da66bcb91014d1096a022e601240780cc9 (diff) |
Refined avatar generation a bit
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/adapter')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java index 0c1c5cc0a..451e326e6 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java @@ -98,7 +98,7 @@ public class AccountAdapter extends ArrayAdapter<Account> { imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); } else { - imageView.setBackgroundColor(UIHelper.getColorForName(account.getDisplayName())); + imageView.setBackgroundColor(UIHelper.getColorForName(account.getJid().toBareJid().toString())); imageView.setImageDrawable(null); final BitmapWorkerTask task = new BitmapWorkerTask(imageView); final AsyncDrawable asyncDrawable = new AsyncDrawable(activity.getResources(), null, task); diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java index aaebf9862..8b4af00d8 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java @@ -160,7 +160,8 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> { imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); } else { - imageView.setBackgroundColor(UIHelper.getColorForName(item.getDisplayName())); + String seed = item.getJid() != null ? item.getJid().toBareJid().toString() : item.getDisplayName(); + imageView.setBackgroundColor(UIHelper.getColorForName(seed)); imageView.setImageDrawable(null); final BitmapWorkerTask task = new BitmapWorkerTask(imageView); final AsyncDrawable asyncDrawable = new AsyncDrawable(activity.getResources(), null, task); |