Tin Tran
03/10/2021, 8:44 AMitem{}
works in LazyColumn? I’m having a weird issue with it
If i have 2 item
block inside a LazyColumn when i scroll pass the all the elements in the first item block and scroll back to it, all the composable in the first item block got recomposed even if the data haven’t changed.Tin Tran
03/10/2021, 8:46 AMLazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(bottom = 48.dp)
) {
item {
Account()
Lessons()
Schedule()
}
item {
LazyColumn(
modifier = Modifier.height(500.dp)
) {
items(lessons) { lesson: Lesson ->
LessonScheduleView(
item = lesson,
modifier = Modifier
.fillMaxWidth()
)
}
}
NewsList()
Products()
FollowUs()
}
}
Tin Tran
03/10/2021, 8:47 AMSchedule()
and scroll back again all Account()
, Lessons()
and Schedule()
get recomposedTin Tran
03/10/2021, 8:48 AMLazyColumn {
item {
Account()
Lessons()
Schedule()
LazyColumn(
modifier = Modifier.height(500.dp)
) {
items(lessons) { lesson: Lesson ->
LessonScheduleView(
item = lesson,
modifier = Modifier
.fillMaxWidth()
)
}
}
NewsList()
Products()
FollowUs()
}
}
Andrey Kulikov
03/10/2021, 11:59 AMTin Tran
03/10/2021, 12:59 PMTin Tran
03/10/2021, 12:59 PMitem{}
blockAndrey Kulikov
03/10/2021, 1:39 PMAndrey Kulikov
03/10/2021, 1:41 PMAdam Powell
03/10/2021, 2:01 PMTin Tran
03/10/2021, 5:22 PMAdam Powell
03/10/2021, 5:27 PMAndrey Kulikov
03/10/2021, 6:12 PMTin Tran
03/11/2021, 1:46 AM