Issue
Robolectric 3.0 provided ShadowViewTreeObserver class, but it's missing in Robolectric 3.1.
Official upgrade guide (https://github.com/robolectric/robolectric/wiki/3.0-to-3.1-Upgrade-Guide) tells about shadow methods being removed due to duplication of Android API funtionalities, yet ShadowViewTreeObserver is not mentioned there.
What happened to this class ? Should Android API methods of ViewTreeObserver be used instead of this particular shadow in 3.1 ?
Solution
Yes, in Robolectric 3.1.x there's no more ShadowViewTreeObserver class, Check: Overview.
The reason of this change is explained in this merge request
Deleting ShadowViewTreeObserver as it reimplements what the real class does. #2308, which has only one commit named
As you would see the answer for your question would be in commit: https://github.com/robolectric/robolectric/pull/2308/commits/e10bddd18ebb3df14423d3743e11772e4fd76e49.
What might be interesting for you it has only one commit, which has solution in name as it is called Deleting ShadowViewTreeObserver. Please use the real class moving forward.
tells about shadow methods being removed due to duplication of Android API funtionalities, yet
ShadowViewTreeObserveris not mentioned there.
Seems to they forgot to update their docs ;-)
Hope it will help
Answered By - piotrek1543
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.