diff --git a/redwood-lazylayout-compose/src/commonTest/kotlin/app/cash/redwood/lazylayout/compose/LazyListTest.kt b/redwood-lazylayout-compose/src/commonTest/kotlin/app/cash/redwood/lazylayout/compose/LazyListTest.kt index d9c97a55fe..bfb7c279b5 100644 --- a/redwood-lazylayout-compose/src/commonTest/kotlin/app/cash/redwood/lazylayout/compose/LazyListTest.kt +++ b/redwood-lazylayout-compose/src/commonTest/kotlin/app/cash/redwood/lazylayout/compose/LazyListTest.kt @@ -55,7 +55,7 @@ class LazyListTest { assertThat(snapshot) .containsExactly( DefaultLazyListValue.copy( - placeholder = List(20) { TextValue(Modifier, "Placeholder") }, + placeholder = List(30) { TextValue(Modifier, "Placeholder") }, ), ) } @@ -91,7 +91,7 @@ class LazyListTest { .containsExactly( DefaultLazyListValue.copy( itemsAfter = expectedItemsAfter, - placeholder = List(20) { TextValue(Modifier, "Placeholder") }, + placeholder = List(30) { TextValue(Modifier, "Placeholder") }, items = List(expectedItemCount) { TextValue(Modifier, it.toString()) }, ), ) @@ -124,7 +124,7 @@ class LazyListTest { DefaultLazyListValue.copy( itemsBefore = 35, itemsAfter = 25, - placeholder = List(20) { TextValue(Modifier, "Placeholder") }, + placeholder = List(30) { TextValue(Modifier, "Placeholder") }, items = List(40) { TextValue(Modifier, (it + 35).toString()) }, ), ) diff --git a/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt b/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt index 65b76db094..bdc6319ebe 100644 --- a/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt +++ b/redwood-lazylayout-uiview/src/commonMain/kotlin/app/cash/redwood/lazylayout/uiview/UIViewLazyList.kt @@ -117,7 +117,10 @@ internal open class UIViewLazyList( override fun tableView( tableView: UITableView, numberOfRowsInSection: NSInteger, - ) = processor.size.toLong() + ): Long { + require(numberOfRowsInSection == 0L) + return processor.size.toLong() + } override fun tableView( tableView: UITableView, @@ -146,7 +149,6 @@ internal open class UIViewLazyList( delegate = tableViewDelegate prefetchingEnabled = true rowHeight = UITableViewAutomaticDimension - estimatedRowHeight = 44.0 separatorStyle = UITableViewCellSeparatorStyleNone registerClass(