diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-20 21:08:33 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-20 21:08:33 +0200 |
commit | 21961673cbcb3132d2405c3d276058b94cbdbbfc (patch) | |
tree | a4cb9ef7f8c6395c2e7fc406f2c5a5e73ef1edcb /src/eu/siacs/conversations/ui/ContactDetailsActivity.java | |
parent | 0bb2c3c4d5b2a4b676610276fafd50ea55f43706 (diff) |
refactored avatar generation. first step
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/ui/ContactDetailsActivity.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java index 65bd5cbf..d43eee59 100644 --- a/src/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -313,10 +313,7 @@ public class ContactDetailsActivity extends XmppActivity { } accountJidTv.setText(getString(R.string.using_account, contact .getAccount().getJid())); - - UIHelper.prepareContactBadge(this, badge, contact, - getApplicationContext()); - + prepareContactBadge(badge, contact); if (contact.getSystemAccount() == null) { badge.setOnClickListener(onBadgeClick); } @@ -383,6 +380,16 @@ public class ContactDetailsActivity extends XmppActivity { } } + private void prepareContactBadge(QuickContactBadge badge, Contact contact) { + if (contact.getSystemAccount() != null) { + String[] systemAccount = contact.getSystemAccount().split("#"); + long id = Long.parseLong(systemAccount[0]); + badge.assignContactUri(Contacts.getLookupUri(id, systemAccount[1])); + } + badge.setImageBitmap(xmppConnectionService.getAvatarService() + .getAvatar(contact, getPixel(72))); + } + protected void confirmToDeleteFingerprint(final String fingerprint) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.delete_fingerprint); |