How to set ImageView ScaleType to TOPCROP

Yesterday I have had the need to align TopCrop an image inside an Android ImageView. Unfortunally Android ImageView doesn’t allow this crop style, so I have implemented it by my own starting from a java sample. you can find the source code here: