# HG changeset patch # User Da Risk # Date 1292971546 -3600 # Node ID 7b8af7616ba904a3f23c794413fe4e6d3b92dc62 # Parent e6f793612724008b05204281fccef5f25cd2a2ab chekstyle diff -r e6f793612724 -r 7b8af7616ba9 src/com/beem/project/beem/ui/Chat.java --- a/src/com/beem/project/beem/ui/Chat.java Tue Dec 21 23:27:33 2010 +0100 +++ b/src/com/beem/project/beem/ui/Chat.java Tue Dec 21 23:45:46 2010 +0100 @@ -574,6 +574,12 @@ mContactStatusIcon.setImageLevel(mContact.getStatus()); } + /** + * Get a Drawable containing the avatar icon. + * + * @param avatarId the avatar id to retrieve or null to get default + * @return a Drawable + */ private Drawable getAvatarDrawable(String avatarId) { Drawable avatarDrawable = null; try { diff -r e6f793612724 -r 7b8af7616ba9 src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Tue Dec 21 23:27:33 2010 +0100 +++ b/src/com/beem/project/beem/ui/ContactList.java Tue Dec 21 23:45:46 2010 +0100 @@ -662,14 +662,19 @@ ImageView img = (ImageView) view.findViewById(R.id.avatar); String avatarId = curContact.getAvatarId(); int contactStatus = curContact.getStatus(); - Drawable avatar = getAvatarStatusDrawable(curContact.getAvatarId(), - curContact.getStatus()); + Drawable avatar = getAvatarStatusDrawable(curContact.getAvatarId()); img.setImageDrawable(avatar); img.setImageLevel(contactStatus); } } - private Drawable getAvatarStatusDrawable(String avatarId, int contactStatus) { + /** + * Get a LayerDrawable containing the avatar and the status icon. + * The status icon will change with the level of the drawable. + * @param avatarId the avatar id to retrieve or null to get default + * @return a LayerDrawable + */ + private Drawable getAvatarStatusDrawable(String avatarId) { Drawable avatarDrawable = null; try { byte[] avatar = mXmppFacade.getAvatar(avatarId);