question: private void updateThumbnailMatrix ( ) { if ( mThumbnail == null ) return ; if ( mImageMatrix == null ) mImageMatrix = new Matrix ( ) ; float widthScale = ( float ) getMeasuredWidth ( ) / mThumbnail . getWidth ( ) ; float heightScale = ( float ) getMeasuredHeight ( ) / mThumbnail . getHeight ( ) ; float scale = Math . max ( widthScale , heightScale ) ; mImageMatrix . setScale ( scale , scale ) ; setImageMatrix ( mImageMatrix ) ; }
target:  Updates the matrix used to scale the thumbnail when drawing it. This needs to be called whenever the thumbnail changes or this view's size changes. This matrix ensures that the thumbnail is anchored at the top left corner of this view and is scaled as small as possible while still covering the entire view. Surprisingly, there's no way to get this behavior using the other ImageView.ScaleTypes.