It turns out that simply adding an empty view to the overarching FrameLayout that includes the animated view apparently fixes the problem. I haven't looked into exactly why this is. And if you remove the extra empty view after adding it, the problem comes back (I wanted to try that to avoid having another view in the hierarchy, in case the add was just getting some kind of machinery to kick in that would stay).
So, as indicated in the stackoverflow post, all you need to do is this in your activity:
myFrameLayout.addView(new View(this));
and voila, the clipping is clipped.
Last year, this guy even wrote a modified version of FrameLayout to get around some aspects of the problem, and he pointed at the method "ViewGroup.gatherTransparentRegion" as the problem. Well, this method was apparently written to deal with SurfaceViews in the first place; here's the javadoc in View:
View.gatherTransparentRegion javadoc:
This is used by the RootView to perform an optimization when the view hierarchy contains one or several SurfaceView.
OK, back on the road to Ithaca.
No comments:
Post a Comment