square/spoon — pull request #207 by LucioC (2014-10-29 02:29:03+00:00)
Title: Supports adding a screenshot to the report

Hello guys,

I'm using spoon in my projects, but the screenshot method has some limitations to my needs, so I'm adding support to include screenshots to the report, so you can use another method to take screenshots and just pass them to spoon.

So far I found three important scenarios where spoon current screenshot method does not work:
- Dialogs
- Google Maps
- External Apps

For google maps, what I found (not tested) is that the GoogleMap itself has a snapshot method, so I can use it, and get the bitmap for the report.
For external apps, what I tested was to use the getInstrumentation().getUiAutomation().takeScreenshot(). We have several scenarios in our app that we send the user to external apps, so this function worked for it. The limitation is that this method is only available for api 18+, so does not seems a good option to be included in spoon screenshot method.

I still need to add some kind of test to the sample to show it working, maybe someone can help me with that.

Thank you,
Lucio