I'm using a TextureView to show a cropped video by setting a scale-matrix with setTransform(matrix)
like in this tutorial. So the video gets larger than the view itself.
This works fine for all android versions except for KitKat (4.4).
The problem I have here is that the TextureView's content is not cropped at the view-bounds - it draws the cropped-away part of the video too. However, the outside part is only updated when the layout refreshes (scroll).
A cropped video (nature.mp4) should look like this:
This is what it looks like on KitKat (I'm showing layout bounds in this screenshot):
I tried setting clip-bounds to the view-bounds via setClipBounds(..)
- that's not working. Also, I can't use Canvas.clipRect(..)
since TextureView's draw-method is final.
It's clearly a bug with KitKat, but has anyone an idea for a workaround?