Closed tasomaniac closed 8 years ago
Rebased this to the latest master branch to see the successful build on Travis. :)
I'm not too fond of the complete breakage of the API like this.
I finally got around to taking a look at what another team was doing internally to solve the maps problem and their solution was to extend from TelescopeLayout
and to override getDrawingCache()
which is where they put the tweaks/workarounds for the map view. Is this a reasonable solution for you? What are you doing in the processing step that takes a long time?
The changes actually doesn't break the API. The only breakage is for custom Lens users. They only need to change 'implements' to 'extends' and will be fine.
GoogleMaps's snapshot function works async. That is the limitation. I wonder how they just override it.
Thanks! Looking forward to the sample.
What I did was to split capturing of the screenshot and saving it.
onCapture
with Bitmap parameter is called first in the Lens. Possible bitmap transformations can be made in that method. After the operation finishes,onBitmapReady
method ofBitmapProcessorListener
will be called. The default implementation does nothing and just callsonBitmapReady
.This processing operation can take long. That's why I did it like this to inform TelescopeLayout to continue the operation when it finishes. While this operation continues,
capturing
is kepttrue
and all the screen touch events are ignored.I don't like introducing new classes into other people's libraries. Sorry about that.
This worked for me for my Google Maps screenshot problem. I opened the PR to discuss it. I also want to create Maps Activity in the sample to demonstrate it.
Thank you for the great library. Thank you for taking time to review this.