Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffc02983 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch 'main' into 'main'

fix: improve fallback bitmap creation in AccountImageModelLoader fix bug...

Closes e/backlog#8834

See merge request !179
parents 5df8294b 2818e466
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -67,7 +67,11 @@ internal class AccountImageDataFetcher(
    }

    private fun createFallbackBitmap(): Bitmap {
        return accountFallbackImageProvider.getDrawable(accountImage.email, accountImage.color, accountImage.tag).toBitmap()
        val drawable = accountFallbackImageProvider.getDrawable(accountImage.email, accountImage.color, accountImage.tag)
        val width = drawable.intrinsicWidth.takeIf { it > 0 } ?: 168
        val height = drawable.intrinsicHeight.takeIf { it > 0 } ?: 168
        drawable.setBounds(0, 0, width, height)
        return drawable.toBitmap(width, height)
    }

    override fun getDataClass() = Bitmap::class.java