Closed davidvavra closed 4 years ago
So I found a root cause - data binding.
After binding data to a View, I need to call this code:
private fun <T : View> T.executePendingBindings() {
val binding = DataBindingUtil.getBinding<ViewDataBinding>(this)
binding?.executePendingBindings()
if (this is ViewGroup) {
children.forEach {
it.executePendingBindings()
}
}
}
plus data binding requires that this runs on Main thread, not test thread. Afterwards, the layout is fine.
Closing as this is due to extra setup needed for databinding. Unsure if that can be baked into the library.
Hi, I'm trying to use this library. I'm testing a custom view which contains a bunch of TextViews. I'm creating the custom view via constructor with
Context
. Then I'm testing it with:All textViews are cut to one line at that 300dp, they don't wrap. In the app it does wrap.
Any idea in which way to investigate?