diff options
author | lookshe <github@lookshe.org> | 2016-03-15 09:18:03 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2016-03-15 09:18:03 +0100 |
commit | 25d3aba4d7dad3edffb92a06b2b018df7ca9b177 (patch) | |
tree | 6a3c388c6b17f000472bdf683fa3907f59952d46 /src/main/java | |
parent | 340272ba841be12dcdf1317e183a45d8b46dce44 (diff) | |
parent | 76a1937745ed0281e817722ab0ce159546397b3c (diff) |
Merge branch 'trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/AvatarService.java | 6 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 93eb0889..f4cbdf3d 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -308,8 +308,7 @@ public class AvatarService { } bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); - final String trimmedName = name.trim(); - drawTile(canvas, trimmedName, 0, 0, size, size); + drawTile(canvas, name, 0, 0, size, size); ImageUtil.addBitmapToCache(KEY, bitmap); return bitmap; } @@ -382,7 +381,8 @@ public class AvatarService { private boolean drawTile(Canvas canvas, String name, int left, int top, int right, int bottom) { if (name != null) { - final String letter = name.isEmpty() ? "X" : name.substring(0, 1); + String trimmedName = name.trim(); + final String letter = trimmedName.isEmpty() ? "X" : trimmedName.substring(0, 1); final int color = UIHelper.getColorForName(name); drawTile(canvas, letter, color, left, top, right, bottom); return true; diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 4e751799..a6468970 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -742,7 +742,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU Presence.Status s = p == null ? Presence.Status.OFFLINE : p.getStatus(); if (contact.showInRoster() && contact.match(needle) && (!this.mHideOfflineContacts - || (needle != null && !needle.trim().isEmpty()) + || (needle != null && !needle.isEmpty()) || s.compareTo(Presence.Status.OFFLINE) < 0)) { this.contacts.add(contact); } |