mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 10:47:46 +00:00
Fix identicon crash
This commit is contained in:
parent
21fc47d7bf
commit
342bd797b8
@ -199,8 +199,11 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
int width = profilePictureImageView.getWidth();
|
||||
int height = profilePictureImageView.getHeight();
|
||||
if (width == 0 || height == 0) return true;
|
||||
profilePictureImageView.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
ClassicIdenticonDrawable identicon = new ClassicIdenticonDrawable(profilePictureImageView.getWidth(), profilePictureImageView.getHeight(), recipient.getAddress().serialize().hashCode());
|
||||
ClassicIdenticonDrawable identicon = new ClassicIdenticonDrawable(width, height, recipient.getAddress().serialize().hashCode());
|
||||
profilePictureImageView.setImageDrawable(identicon);
|
||||
return true;
|
||||
}
|
||||
|
@ -97,8 +97,11 @@ public class ProfilePreference extends Preference {
|
||||
|
||||
@Override
|
||||
public boolean onPreDraw() {
|
||||
int width = avatarView.getWidth();
|
||||
int height = avatarView.getHeight();
|
||||
if (width == 0 || height == 0) return true;
|
||||
avatarView.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||
ClassicIdenticonDrawable identicon = new ClassicIdenticonDrawable(avatarView.getWidth(), avatarView.getHeight(), userHexEncodedPublicKey.hashCode());
|
||||
ClassicIdenticonDrawable identicon = new ClassicIdenticonDrawable(width, height, userHexEncodedPublicKey.hashCode());
|
||||
avatarView.setImageDrawable(identicon);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user