Actions

Kotlin - rounded corners on image

From zen2

Revision as of 21:47, 21 November 2017 by Chris (talk | contribs)
val bitmap = BitmapFactory.decodeResource(resources,R.drawable.devslopesprofilelogo)
val roundedLogo = RoundedBitmapDrawableFactory.create(resources,bitmap)
roundedLogo.cornerRadius = 15f
logo.setImageDrawable(roundedLogo)

Circular images

For fully circular:

val bitmap = BitmapFactory.decodeResource(resources,R.drawable.devslopesprofilelogo)
val roundedLogo = RoundedBitmapDrawableFactory.create(resources,bitmap)
roundedLogo.isCircular = true
logo.setImageDrawable(roundedLogo)