What's in here:
This commit modifies the startGesture method in the PinchableView class to use a Canvas for creating a bitmap snapshot of the view. The previous implementation used the now-deprecated drawing cache, which could lead to compatibility and performance issues, especially in newer Android versions.
My motivation:
Whenever I pinch an image and then change the image dynamically, it would return the old image on the next pinch geasture. Now, that could be solved by simply writing v.invalidate() in the startGesture method to kind of make it redraw the view, but doing it in Canvas already solved my issue.
What's in here: This commit modifies the
startGesture
method in the PinchableView class to use aCanvas
for creating a bitmap snapshot of the view. The previous implementation used the now-deprecated drawing cache, which could lead to compatibility and performance issues, especially in newer Android versions.My motivation: Whenever I pinch an image and then change the image dynamically, it would return the old image on the next pinch geasture. Now, that could be solved by simply writing
v.invalidate()
in thestartGesture
method to kind of make it redraw the view, but doing it inCanvas
already solved my issue.