Open Diy2210 opened 4 years ago
I'm not sure that it is possible with ListWidget inside ScrollWidget. But I think, you can rework screen and make it with just one big list, except of scroll with linear. It would be better solution for screen with dynamic data. And this will resolve problems with scroll inside scroll.
I fixed it by changing the blocks in some places down!
But I think this is bug, if container dont change size.
Basically you should avoid nesting containers with scroll support. https://developer.android.com/reference/android/widget/ScrollView
Never add a RecyclerView or ListView to a scroll view. Doing so results in poor user interface performance and a poor user experience.
For vertical scrolling, consider NestedScrollView instead of scroll view which offers greater user interface flexibility and support for the material design scrolling patterns.
Maybe you can consider adding NestedScrollView support.
hi, @Diy2210
in your case you should not use ScrollWidget
with child ListWidget
. You can achive required result with ListWidget
- just use multiple UnitItems.
this your screen:
can be built from units like:
val headers = listOf(
BasicItem(title = "System date".desc(), value = date.desc()),
BasicItem(title = "Updates".desc(), value = "available 29".desc()),
HeaderItem(title = "Disk Usage".desc())
)
val disksUsage = disks.map { disk ->
DiskUsageItem(name = disk.map { it.name.desc() }, available = disk.map { "${it.available} %".desc() }, space = disk.map { it.space }
}
val serverStatus = statuses.map { status ->
....
}
val softwareVersions = versions.map { version ->
....
}
viewModel.listUnits.value = headers
.plus(DiskUsageHeaderItem()),
.plus(disksUsage),
.plus(HeaderItem(title = "Server status")),
.plus(serverStatus),
.plus(HeaderItem(title = "Software versions")),
.plus(softwareVersions)
and in screen just observe in ListWidget - viewModel.listUnits
How disable scroll from ListWidget inside Scroll Code: scroll( id = Ids.RootScroll, size = AsParent, child = linear( id = Ids.RootLinearId, size = WidthAsParentHeightWrapContent ) { ... }
My ListWidget inside Constraint:
I try change Size from List but scroll is enabled too.
Server Status Block: