Friday, February 15, 2019

Robolectric's shadow of ViewTreeObserver is no more

An Android app I'm testing with Robolectric uses ViewTreeObservers to listen for sizing information to be ready. Those needed to be triggered before the functionality I wanted to test would appear. On the web, I found mention of ShadowViewTreeObserver, Robolectric's shadow (internals-exposing) version of that. But the shadow version seems to now be gone because it didn't provide any advantage over the real version. ViewTreeObserver has a displayOnGlobalLayout function that triggers layout notifications.

No comments:

Post a Comment