You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by cmathew April 14, 2023
Crossposting from the Google Group.
I'm looking to create my own shadow for a low-level Android class. My current implementation extends the one included in Robolectric 4.9.2, and adds some additional functionality:
@Implements(value = ViewRootImpl::class)
class MyShadowViewRootImpl : ShadowViewRootImpl() {
@Implementation
fun getWindowInsets(forceConstruct: Boolean): WindowInsets {
// return some reasonable insets
}
}
To allow my project to reference ViewRootImpl, I found that I could include the android-all library. However, I'm not sure whether this is the correct next step to take. Also, having this on my classpath seems to be stomping on some framework classes in ways that result in runtime exceptions. For example, my Android Log calls now result in linking errors.
I would like to learn more about:
1.) How do I create low-level Shadows? What is android-all, and what roles does it play?
2.) Besides android-all, I noticed other interesting-sounding libraries surrounding Robolectric e.g. shadows-framework, shadowapi, sandbox, and android-all-instrumented. What are these libraries, and how should developers use them?
Thanks for any help!
The text was updated successfully, but these errors were encountered:
Discussed in robolectric/robolectric#8140
Originally posted by cmathew April 14, 2023
Crossposting from the Google Group.
I'm looking to create my own shadow for a low-level Android class. My current implementation extends the one included in Robolectric 4.9.2, and adds some additional functionality:
To allow my project to reference ViewRootImpl, I found that I could include the android-all library. However, I'm not sure whether this is the correct next step to take. Also, having this on my classpath seems to be stomping on some framework classes in ways that result in runtime exceptions. For example, my Android Log calls now result in linking errors.
I would like to learn more about:
1.) How do I create low-level Shadows? What is android-all, and what roles does it play?
2.) Besides android-all, I noticed other interesting-sounding libraries surrounding Robolectric e.g. shadows-framework, shadowapi, sandbox, and android-all-instrumented. What are these libraries, and how should developers use them?
Thanks for any help!
The text was updated successfully, but these errors were encountered: