-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add TextureView/SurfaceView support #55
Comments
So, I'm not a TextureView/SurfaceView expert, but based on your description you seem to be on the right path, and I'd love to have the eventual fix pulled in. In this particular case, it looks like the View is drawing over your TextureView, probably because you have a view behind the TextureView which in production will be drawn first, but in your code is drawn after the TextureView.. something like this
The solution will be to draw the TextureView while drawing the rest of the views, which might be tricky (since it's the draw() that dispatches the draw() for the children). Perhaps a ScreenshotSafeTextureView that detects if it's running in a screenshot test and in which case just do the logic you showed inside of its onDraw() method? |
Hey 👋 @tdrhq Revisiting this one, the solution you suggested wasn't feasible because subclasses of It still remains adding a way to get a Happy to know what you think about #71 Thanks a lot! |
We are working on adding screenshot testing to the Mapbox SDK Test App.
In order to try
screenshot-tests-for-android
I added a test (which takes a screenshot after a simple map gets loaded) inapp-example-androidjunitrunner
.The problem is that I'm getting a screenshot with the part of the map transparent.
Screenshot:
Examining the code I found you're not taking into account views like
TextureView
orSurfaceView
(we use them to paint maps).Trying to add this enhancement (firstly with
TextureView
) I added some changes and got same screenshot 😕Funny thing is if I remove the
drawClippedView()
call, I get the screenshot with map properly painted but (obviously) the rest of the views not (e.g. Mapbox logo). Even clearer checking another screenshot generated from other test (whole screenshot is transparent).Screenshot:
Any thoughts on how to fix this?
Any info would help us adding this feature to the framework.
The text was updated successfully, but these errors were encountered: