A view that will always be a square, using the width as width and height size.
class WidthDefinedAlbumArtView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = 0
) : AppCompatImageView(context, attrs, defStyle) {
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
// proceed only with width so we get a square, ignore height
super.onMeasure(widthMeasureSpec, widthMeasureSpec)
}
}