Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android]: Replace deprecated drawing cache with Canvas #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saheem128
Copy link

@saheem128 saheem128 commented Dec 9, 2023

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.

s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant