bolteu / screenshotty

A library for programatically capturing screenshots on Android
MIT License
265 stars 41 forks source link

PixelCopy delegate doesn't render dialogs #3

Closed yarolegovich closed 5 years ago

yarolegovich commented 5 years ago

Dialogs and popup windows have their own Window, so the screenshot we get by making a PixelCopy of activity window won't capture their views. Since the probability that a dialog/popup contains a SurfaceView is very low, the proposal is to simply render dialogs as Views on top of the Bitmap we get from PixelCopy. For this, a separate class that renders floating panels can be created and we can also reuse it in DefaultFallbackStrategy to remove Falcon from the project. What I don't like is that Falcon contains some unobvious logic of positioning dialogs on top of activity in the list and also draws all the activity stack stored in global window manager. The only thing I'm not sure about is whether to make dialogs rendering optional or mandatory. I personally favor the former, because if for some reason reflection fails for an activity without dialogs we just discard a perfectly valid screenshot. What do you think about this?