Hello, i am experiencing wierd behaviour when usin...
# compose
v
Hello, i am experiencing wierd behaviour when using
Card
inside
AdapterList
For example this code:
Copy code
@Composable
fun ArticleAdapterList(data: List<Article>) {
    AdapterList(data = data) { item ->
        Column {
            Column {
                Text(text = item.title)
                Text(text = item.content.take(200))
            }
        }
    }
}
works just fine, but once i change it to:
Copy code
@Composable
fun ArticleAdapterList(data: List<Article>) {
    AdapterList(data = data) { item ->
        Card(shape = RoundedCornerShape(8.dp), elevation = 4.dp, modifier = Modifier.fillMaxWidth() + Modifier.padding(8.dp)) {
            Column {
                Text(text = item.title)
                Text(text = item.content.take(200))
            }
        }
    }
}
i am getting
java.lang.IllegalStateException: Node should be attached to an owner
once i start scrolling anyone with similar issue? Thanx
v
I got the same error, but not from start. It happened after playing some time with scrolling on AS-4.1-alpha04 compose 0.1.0-dev08. I
t
For me it is finaly more or less working in dev-08. But onDispose is not called for the composables. Maybe this is also the reason why it will show wired behavior after some time. So still not able to use AdapterList espacially for showing lists of images.
v
Yeah, i am leaking things too, but i am also presenting quite a lot of stuff from database on first start and it takes a while until VerticalScroller gets drawn… 🤯
k
Hi Vlad, how are you able to run with
Copy code
0.1.0-dev08
?
I have static function error, i thought 0.1.0-dev08 was broken?
v
it would be nice to see your error, but generally, i had to split app into modules so that kapt + experimental suicide squad (room, flow, compose) does not reside in single module so: • separate module for database (room only) • aggregator data module which already provides ready to consume data (flow only) • feature modules with ui + viewModels (compose only)
k
Thanks!
v
The error has nothing with any data as text, because it arises without them.
r
But onDispose is not called for the composables.
https://issuetracker.google.com/issues/150174792
👍 2