mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 20:19:42 +01:00
Workaround for crash when loading avatar
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
parent
cdc4e89e54
commit
ddcf1c48aa
@ -424,12 +424,17 @@ class ChatController(args: Bundle) :
|
||||
if (actionBar != null && bitmap != null && resources != null) {
|
||||
|
||||
val avatarSize = (actionBar?.height!! / 1.5).roundToInt()
|
||||
val bitmapResized = Bitmap.createScaledBitmap(bitmap, avatarSize, avatarSize, false)
|
||||
if (avatarSize > 0) {
|
||||
val bitmapResized = Bitmap.createScaledBitmap(bitmap, avatarSize, avatarSize, false)
|
||||
|
||||
val roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(resources!!, bitmapResized)
|
||||
roundedBitmapDrawable.isCircular = true
|
||||
roundedBitmapDrawable.setAntiAlias(true)
|
||||
actionBar?.setIcon(roundedBitmapDrawable)
|
||||
val roundedBitmapDrawable =
|
||||
RoundedBitmapDrawableFactory.create(resources!!, bitmapResized)
|
||||
roundedBitmapDrawable.isCircular = true
|
||||
roundedBitmapDrawable.setAntiAlias(true)
|
||||
actionBar?.setIcon(roundedBitmapDrawable)
|
||||
} else {
|
||||
Log.d(TAG, "loadAvatarForStatusBar avatarSize <= 0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user