Fixing animations

This commit is contained in:
Hemanth S 2020-12-04 02:27:44 +05:30
parent 0679774d41
commit b944ef5de6
21 changed files with 123 additions and 122 deletions

View file

@ -31,9 +31,12 @@ class RetroShapeableImageView @JvmOverloads constructor(
init {
val typedArray =
context.obtainStyledAttributes(attrs, R.styleable.RetroShapeableImageView, defStyle, -1)
val cornerSize =
typedArray.getDimension(R.styleable.RetroShapeableImageView_retroCornerSize, 0f)
updateCornerSize(cornerSize)
val cornerSize = typedArray.getDimension(R.styleable.RetroShapeableImageView_retroCornerSize, 0f)
val circleShape = typedArray.getBoolean(R.styleable.RetroShapeableImageView_circleShape, false)
addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ ->
val radius = width / 2f
shapeAppearanceModel = ShapeAppearanceModel().withCornerSize(radius)
}
typedArray.recycle()
}