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

Replace deprecated getDrawingCache to capturing method. #324

Merged

Conversation

JSpiner
Copy link
Contributor

@JSpiner JSpiner commented Mar 10, 2021

Summary

getDrawingCache is deprecated and it occurs error #284.

How should we fix it?

Google suggests to use PixelCopy instead of getDrawingCache. But it requires window instance. It is difficult to get a window instance without the dependency of an activity or fragment.

So, as the next best thing, I drew a bitmap of the view on the canvas.

- getDrawingCache is deprecated.
- getDrawingCache raises burhanrashid52#284
- PixelCopy is better way. But it needs window instance.
@JSpiner
Copy link
Contributor Author

JSpiner commented Mar 10, 2021

스크린샷 2021-03-10 오후 12 05 52

스크린샷 2021-03-10 오후 12 06 16

CI build failed, but when I tested it locally, it worked.
I think it will succeed if rebuild it.

@burhanrashid52
Copy link
Owner

Changes look good. Have you tested this with different devices ?

@JSpiner
Copy link
Contributor Author

JSpiner commented Mar 11, 2021

I tested it on Galaxy S20+, Pixel(emulator). It works.

@burhanrashid52 burhanrashid52 merged commit fa3ced9 into burhanrashid52:master Mar 13, 2021
@JSpiner JSpiner deleted the feature/remove-drawing-cache branch March 15, 2021 01:46
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

2 participants