It would be much nicer to be able to adjust this custom view's height to its parent, right now with match_parent your image will just be bigger than your parent component.
An ImageView already has scaleType to solve this issue.
So maybe you could inherit your component from ImageView or build something alike?