According with your question, the methods setScaleX
and setScaleY
flicker because they perform inside the "drawing to a View" context (setScaleX
and setScaleY
belong to View
). Documentation says:
Option "a," drawing to a View, is your best choice when you want to draw simple graphics that do not need to change dynamically and are not part of a performance-intensive game. For example, you should draw your graphics into a View when you want to display a static graphic or predefined animation, within an otherwise static application.
On the other hand, if you follow the @g00dy answer, you will be performing inside the "drawing to a Canvas" context (scale()
belongs to Canvas
). Documentation says:
Option "b," drawing to a Canvas, is better when your application needs to regularly re-draw itself. Applications such as video games should be drawing to the Canvas on its own.
A pinch gesture is intensive, so it needs to be performed in Option b... so you should use the @g00dy solution or any approach like that.
Here is the documentation cited.
I hope it helps you.