Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Px class to represent raw host pixel value. #2204

Merged
merged 7 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
New:
- Wasm JS added as a target for common Redwood modules. There is no Treehouse support today.
- Add `onScroll` property to `Row` and `Column`. This property is invoked when `overflow = Overflow.Scroll` and the container is scrolled.
- Add `Px` class to represent a raw pixel value in the host's coordinate system.

Changed:
- The `TreehouseApp` type is now an abstract class. This should make it easier to write unit tests for code that integrates Treehouse.
Expand Down
4 changes: 2 additions & 2 deletions redwood-layout-compose/api/redwood-layout-compose.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ final val app.cash.redwood.layout.compose/app_cash_redwood_layout_compose_Vertic
final val app.cash.redwood.layout.compose/app_cash_redwood_layout_compose_WidthImpl$stableprop // app.cash.redwood.layout.compose/app_cash_redwood_layout_compose_WidthImpl$stableprop|#static{}app_cash_redwood_layout_compose_WidthImpl$stableprop[0]

final fun app.cash.redwood.layout.compose/Box(app.cash.redwood.layout.api/Constraint?, app.cash.redwood.layout.api/Constraint?, app.cash.redwood.ui/Margin?, app.cash.redwood.layout.api/CrossAxisAlignment?, app.cash.redwood.layout.api/CrossAxisAlignment?, app.cash.redwood/Modifier?, kotlin/Function3<app.cash.redwood.layout.compose/BoxScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Box|Box(app.cash.redwood.layout.api.Constraint?;app.cash.redwood.layout.api.Constraint?;app.cash.redwood.ui.Margin?;app.cash.redwood.layout.api.CrossAxisAlignment?;app.cash.redwood.layout.api.CrossAxisAlignment?;app.cash.redwood.Modifier?;kotlin.Function3<app.cash.redwood.layout.compose.BoxScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.layout.compose/Column(app.cash.redwood.layout.api/Constraint?, app.cash.redwood.layout.api/Constraint?, app.cash.redwood.ui/Margin?, app.cash.redwood.layout.api/Overflow?, app.cash.redwood.layout.api/CrossAxisAlignment?, app.cash.redwood.layout.api/MainAxisAlignment?, kotlin/Function1<kotlin/Double, kotlin/Unit>?, app.cash.redwood/Modifier?, kotlin/Function3<app.cash.redwood.layout.compose/ColumnScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Column|Column(app.cash.redwood.layout.api.Constraint?;app.cash.redwood.layout.api.Constraint?;app.cash.redwood.ui.Margin?;app.cash.redwood.layout.api.Overflow?;app.cash.redwood.layout.api.CrossAxisAlignment?;app.cash.redwood.layout.api.MainAxisAlignment?;kotlin.Function1<kotlin.Double,kotlin.Unit>?;app.cash.redwood.Modifier?;kotlin.Function3<app.cash.redwood.layout.compose.ColumnScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.layout.compose/Row(app.cash.redwood.layout.api/Constraint?, app.cash.redwood.layout.api/Constraint?, app.cash.redwood.ui/Margin?, app.cash.redwood.layout.api/Overflow?, app.cash.redwood.layout.api/MainAxisAlignment?, app.cash.redwood.layout.api/CrossAxisAlignment?, kotlin/Function1<kotlin/Double, kotlin/Unit>?, app.cash.redwood/Modifier?, kotlin/Function3<app.cash.redwood.layout.compose/RowScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Row|Row(app.cash.redwood.layout.api.Constraint?;app.cash.redwood.layout.api.Constraint?;app.cash.redwood.ui.Margin?;app.cash.redwood.layout.api.Overflow?;app.cash.redwood.layout.api.MainAxisAlignment?;app.cash.redwood.layout.api.CrossAxisAlignment?;kotlin.Function1<kotlin.Double,kotlin.Unit>?;app.cash.redwood.Modifier?;kotlin.Function3<app.cash.redwood.layout.compose.RowScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.layout.compose/Column(app.cash.redwood.layout.api/Constraint?, app.cash.redwood.layout.api/Constraint?, app.cash.redwood.ui/Margin?, app.cash.redwood.layout.api/Overflow?, app.cash.redwood.layout.api/CrossAxisAlignment?, app.cash.redwood.layout.api/MainAxisAlignment?, kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>?, app.cash.redwood/Modifier?, kotlin/Function3<app.cash.redwood.layout.compose/ColumnScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Column|Column(app.cash.redwood.layout.api.Constraint?;app.cash.redwood.layout.api.Constraint?;app.cash.redwood.ui.Margin?;app.cash.redwood.layout.api.Overflow?;app.cash.redwood.layout.api.CrossAxisAlignment?;app.cash.redwood.layout.api.MainAxisAlignment?;kotlin.Function1<app.cash.redwood.ui.Px,kotlin.Unit>?;app.cash.redwood.Modifier?;kotlin.Function3<app.cash.redwood.layout.compose.ColumnScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.layout.compose/Row(app.cash.redwood.layout.api/Constraint?, app.cash.redwood.layout.api/Constraint?, app.cash.redwood.ui/Margin?, app.cash.redwood.layout.api/Overflow?, app.cash.redwood.layout.api/MainAxisAlignment?, app.cash.redwood.layout.api/CrossAxisAlignment?, kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>?, app.cash.redwood/Modifier?, kotlin/Function3<app.cash.redwood.layout.compose/RowScope, androidx.compose.runtime/Composer, kotlin/Int, kotlin/Unit>, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Row|Row(app.cash.redwood.layout.api.Constraint?;app.cash.redwood.layout.api.Constraint?;app.cash.redwood.ui.Margin?;app.cash.redwood.layout.api.Overflow?;app.cash.redwood.layout.api.MainAxisAlignment?;app.cash.redwood.layout.api.CrossAxisAlignment?;kotlin.Function1<app.cash.redwood.ui.Px,kotlin.Unit>?;app.cash.redwood.Modifier?;kotlin.Function3<app.cash.redwood.layout.compose.RowScope,androidx.compose.runtime.Composer,kotlin.Int,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
final fun app.cash.redwood.layout.compose/Spacer(app.cash.redwood.ui/Dp, app.cash.redwood.ui/Dp, app.cash.redwood/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // app.cash.redwood.layout.compose/Spacer|Spacer(app.cash.redwood.ui.Dp;app.cash.redwood.ui.Dp;app.cash.redwood.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import app.cash.paparazzi.Paparazzi
import app.cash.redwood.layout.AbstractFlexContainerTest
import app.cash.redwood.layout.TestFlexContainer
import app.cash.redwood.layout.widget.FlexContainer
import app.cash.redwood.ui.Px
import app.cash.redwood.widget.Widget
import app.cash.redwood.widget.compose.ComposeWidgetChildren
import app.cash.redwood.yoga.FlexDirection
Expand Down Expand Up @@ -79,13 +80,13 @@ class ComposeUiFlexContainerTest(
},
)

override fun onScroll(onScroll: ((Double) -> Unit)?) {
override fun onScroll(onScroll: ((Px) -> Unit)?) {
delegate.onScroll(onScroll)
}

override fun scroll(offset: Double) {
override fun scroll(offset: Px) {
runBlocking {
delegate.scrollState?.scrollTo(offset.toInt())
delegate.scrollState?.scrollTo(offset.value.toInt())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import app.cash.redwood.layout.api.MainAxisAlignment
import app.cash.redwood.layout.api.Overflow
import app.cash.redwood.ui.Density
import app.cash.redwood.ui.Margin
import app.cash.redwood.ui.Px
import app.cash.redwood.widget.compose.ComposeWidgetChildren
import app.cash.redwood.yoga.Direction
import app.cash.redwood.yoga.FlexDirection
Expand All @@ -69,7 +70,7 @@ internal class ComposeUiFlexContainer(
private var height by mutableStateOf(Constraint.Wrap)
private var overflow by mutableStateOf(Overflow.Clip)
private var margin by mutableStateOf(Margin.Zero)
private var onScroll: ((Double) -> Unit)? by mutableStateOf(null)
private var onScroll: ((Px) -> Unit)? by mutableStateOf(null)
override var density = Density(1.0)

internal var testOnlyModifier: Modifier? = null
Expand All @@ -91,7 +92,7 @@ internal class ComposeUiFlexContainer(
this.overflow = overflow
}

override fun onScroll(onScroll: ((Double) -> Unit)?) {
override fun onScroll(onScroll: ((Px) -> Unit)?) {
this.onScroll = onScroll
}

Expand Down Expand Up @@ -164,7 +165,7 @@ internal class ComposeUiFlexContainer(
if (onScroll != null) {
val offset by remember { derivedStateOf { scrollState.value.toDouble() } }
LaunchedEffect(offset) {
onScroll(offset)
onScroll(Px(offset))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import app.cash.redwood.layout.widget.Row
import app.cash.redwood.layout.widget.Spacer
import app.cash.redwood.ui.Dp
import app.cash.redwood.ui.Margin
import app.cash.redwood.ui.Px
import app.cash.redwood.widget.HTMLElementChildren
import app.cash.redwood.widget.Widget
import org.w3c.dom.Document
Expand Down Expand Up @@ -105,7 +106,7 @@ private class HTMLFlexContainer(
value.overflowSetter(overflow.toCss())
}

override fun onScroll(onScroll: ((Double) -> Unit)?) {
override fun onScroll(onScroll: ((Px) -> Unit)?) {
scrollEventListener?.let { eventListener ->
value.removeEventListener("scroll", eventListener)
scrollEventListener = null
Expand All @@ -119,7 +120,7 @@ private class HTMLFlexContainer(
"column" -> value.scrollLeft
else -> throw AssertionError()
}
onScroll(offset)
onScroll(Px(offset))
}
}.also { scrollEventListener = it }
value.addEventListener("scroll", eventListener)
Expand Down
4 changes: 2 additions & 2 deletions redwood-layout-schema/redwood-api.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<property tag="4" name="overflow" type="app.cash.redwood.layout.api.Overflow"/>
<property tag="5" name="horizontalAlignment" type="app.cash.redwood.layout.api.MainAxisAlignment"/>
<property tag="6" name="verticalAlignment" type="app.cash.redwood.layout.api.CrossAxisAlignment"/>
<event tag="7" name="onScroll" params="kotlin.Double" nullable="true"/>
<event tag="7" name="onScroll" params="app.cash.redwood.ui.Px" nullable="true"/>
<children tag="1" name="children"/>
</widget>
<widget tag="2" type="app.cash.redwood.layout.Column">
Expand All @@ -16,7 +16,7 @@
<property tag="4" name="overflow" type="app.cash.redwood.layout.api.Overflow"/>
<property tag="5" name="horizontalAlignment" type="app.cash.redwood.layout.api.CrossAxisAlignment"/>
<property tag="6" name="verticalAlignment" type="app.cash.redwood.layout.api.MainAxisAlignment"/>
<event tag="7" name="onScroll" params="kotlin.Double" nullable="true"/>
<event tag="7" name="onScroll" params="app.cash.redwood.ui.Px" nullable="true"/>
<children tag="1" name="children"/>
</widget>
<widget tag="3" type="app.cash.redwood.layout.Spacer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import app.cash.redwood.schema.Property
import app.cash.redwood.schema.Widget
import app.cash.redwood.ui.Dp
import app.cash.redwood.ui.Margin
import app.cash.redwood.ui.Px

/**
* Lays out widgets horizontally in a row.
Expand Down Expand Up @@ -88,7 +89,7 @@ public data class Row(
*/
@Property(7)
@Default("null")
val onScroll: ((offset: Double) -> Unit)?,
val onScroll: ((offset: Px) -> Unit)?,

/**
* A slot to add widgets in.
Expand Down Expand Up @@ -160,7 +161,7 @@ public data class Column(
*/
@Property(7)
@Default("null")
val onScroll: ((offset: Double) -> Unit)?,
val onScroll: ((offset: Px) -> Unit)?,

/**
* A slot to add widgets in.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import app.cash.redwood.layout.api.Overflow
import app.cash.redwood.layout.widget.Column
import app.cash.redwood.layout.widget.Row
import app.cash.redwood.ui.Margin
import app.cash.redwood.ui.Px
import app.cash.redwood.ui.dp
import app.cash.redwood.widget.ChangeListener
import app.cash.redwood.widget.Widget
Expand Down Expand Up @@ -617,7 +618,7 @@ abstract class AbstractFlexContainerTest<T : Any> {
}
}

container.scroll(1000.0)
container.scroll(Px(1000.0))

verifySnapshot(container)

Expand All @@ -636,8 +637,8 @@ interface TestFlexContainer<T : Any> :
fun mainAxisAlignment(mainAxisAlignment: MainAxisAlignment)
fun margin(margin: Margin)
fun overflow(overflow: Overflow)
fun onScroll(onScroll: ((Double) -> Unit)?)
fun scroll(offset: Double)
fun onScroll(onScroll: ((Px) -> Unit)?)
fun scroll(offset: Px)
fun add(widget: Widget<T>)
fun addAt(index: Int, widget: Widget<T>)
fun removeAt(index: Int)
Expand Down
8 changes: 4 additions & 4 deletions redwood-layout-testing/api/redwood-layout-testing.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class app.cash.redwood.layout.testing/BoxValue : app.cash.redwood.testing/
}

final class app.cash.redwood.layout.testing/ColumnValue : app.cash.redwood.testing/WidgetValue { // app.cash.redwood.layout.testing/ColumnValue|null[0]
constructor <init>(app.cash.redwood/Modifier = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.ui/Margin = ..., app.cash.redwood.layout.api/Overflow = ..., app.cash.redwood.layout.api/CrossAxisAlignment = ..., app.cash.redwood.layout.api/MainAxisAlignment = ..., kotlin/Function1<kotlin/Double, kotlin/Unit>? = ..., kotlin.collections/List<app.cash.redwood.testing/WidgetValue> = ...) // app.cash.redwood.layout.testing/ColumnValue.<init>|<init>(app.cash.redwood.Modifier;app.cash.redwood.layout.api.Constraint;app.cash.redwood.layout.api.Constraint;app.cash.redwood.ui.Margin;app.cash.redwood.layout.api.Overflow;app.cash.redwood.layout.api.CrossAxisAlignment;app.cash.redwood.layout.api.MainAxisAlignment;kotlin.Function1<kotlin.Double,kotlin.Unit>?;kotlin.collections.List<app.cash.redwood.testing.WidgetValue>){}[0]
constructor <init>(app.cash.redwood/Modifier = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.ui/Margin = ..., app.cash.redwood.layout.api/Overflow = ..., app.cash.redwood.layout.api/CrossAxisAlignment = ..., app.cash.redwood.layout.api/MainAxisAlignment = ..., kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>? = ..., kotlin.collections/List<app.cash.redwood.testing/WidgetValue> = ...) // app.cash.redwood.layout.testing/ColumnValue.<init>|<init>(app.cash.redwood.Modifier;app.cash.redwood.layout.api.Constraint;app.cash.redwood.layout.api.Constraint;app.cash.redwood.ui.Margin;app.cash.redwood.layout.api.Overflow;app.cash.redwood.layout.api.CrossAxisAlignment;app.cash.redwood.layout.api.MainAxisAlignment;kotlin.Function1<app.cash.redwood.ui.Px,kotlin.Unit>?;kotlin.collections.List<app.cash.redwood.testing.WidgetValue>){}[0]

final val children // app.cash.redwood.layout.testing/ColumnValue.children|{}children[0]
final fun <get-children>(): kotlin.collections/List<app.cash.redwood.testing/WidgetValue> // app.cash.redwood.layout.testing/ColumnValue.children.<get-children>|<get-children>(){}[0]
Expand All @@ -49,7 +49,7 @@ final class app.cash.redwood.layout.testing/ColumnValue : app.cash.redwood.testi
final val modifier // app.cash.redwood.layout.testing/ColumnValue.modifier|{}modifier[0]
final fun <get-modifier>(): app.cash.redwood/Modifier // app.cash.redwood.layout.testing/ColumnValue.modifier.<get-modifier>|<get-modifier>(){}[0]
final val onScroll // app.cash.redwood.layout.testing/ColumnValue.onScroll|{}onScroll[0]
final fun <get-onScroll>(): kotlin/Function1<kotlin/Double, kotlin/Unit>? // app.cash.redwood.layout.testing/ColumnValue.onScroll.<get-onScroll>|<get-onScroll>(){}[0]
final fun <get-onScroll>(): kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>? // app.cash.redwood.layout.testing/ColumnValue.onScroll.<get-onScroll>|<get-onScroll>(){}[0]
final val overflow // app.cash.redwood.layout.testing/ColumnValue.overflow|{}overflow[0]
final fun <get-overflow>(): app.cash.redwood.layout.api/Overflow // app.cash.redwood.layout.testing/ColumnValue.overflow.<get-overflow>|<get-overflow>(){}[0]
final val verticalAlignment // app.cash.redwood.layout.testing/ColumnValue.verticalAlignment|{}verticalAlignment[0]
Expand All @@ -74,7 +74,7 @@ final class app.cash.redwood.layout.testing/RedwoodLayoutTestingWidgetFactory :
}

final class app.cash.redwood.layout.testing/RowValue : app.cash.redwood.testing/WidgetValue { // app.cash.redwood.layout.testing/RowValue|null[0]
constructor <init>(app.cash.redwood/Modifier = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.ui/Margin = ..., app.cash.redwood.layout.api/Overflow = ..., app.cash.redwood.layout.api/MainAxisAlignment = ..., app.cash.redwood.layout.api/CrossAxisAlignment = ..., kotlin/Function1<kotlin/Double, kotlin/Unit>? = ..., kotlin.collections/List<app.cash.redwood.testing/WidgetValue> = ...) // app.cash.redwood.layout.testing/RowValue.<init>|<init>(app.cash.redwood.Modifier;app.cash.redwood.layout.api.Constraint;app.cash.redwood.layout.api.Constraint;app.cash.redwood.ui.Margin;app.cash.redwood.layout.api.Overflow;app.cash.redwood.layout.api.MainAxisAlignment;app.cash.redwood.layout.api.CrossAxisAlignment;kotlin.Function1<kotlin.Double,kotlin.Unit>?;kotlin.collections.List<app.cash.redwood.testing.WidgetValue>){}[0]
constructor <init>(app.cash.redwood/Modifier = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.layout.api/Constraint = ..., app.cash.redwood.ui/Margin = ..., app.cash.redwood.layout.api/Overflow = ..., app.cash.redwood.layout.api/MainAxisAlignment = ..., app.cash.redwood.layout.api/CrossAxisAlignment = ..., kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>? = ..., kotlin.collections/List<app.cash.redwood.testing/WidgetValue> = ...) // app.cash.redwood.layout.testing/RowValue.<init>|<init>(app.cash.redwood.Modifier;app.cash.redwood.layout.api.Constraint;app.cash.redwood.layout.api.Constraint;app.cash.redwood.ui.Margin;app.cash.redwood.layout.api.Overflow;app.cash.redwood.layout.api.MainAxisAlignment;app.cash.redwood.layout.api.CrossAxisAlignment;kotlin.Function1<app.cash.redwood.ui.Px,kotlin.Unit>?;kotlin.collections.List<app.cash.redwood.testing.WidgetValue>){}[0]

final val children // app.cash.redwood.layout.testing/RowValue.children|{}children[0]
final fun <get-children>(): kotlin.collections/List<app.cash.redwood.testing/WidgetValue> // app.cash.redwood.layout.testing/RowValue.children.<get-children>|<get-children>(){}[0]
Expand All @@ -89,7 +89,7 @@ final class app.cash.redwood.layout.testing/RowValue : app.cash.redwood.testing/
final val modifier // app.cash.redwood.layout.testing/RowValue.modifier|{}modifier[0]
final fun <get-modifier>(): app.cash.redwood/Modifier // app.cash.redwood.layout.testing/RowValue.modifier.<get-modifier>|<get-modifier>(){}[0]
final val onScroll // app.cash.redwood.layout.testing/RowValue.onScroll|{}onScroll[0]
final fun <get-onScroll>(): kotlin/Function1<kotlin/Double, kotlin/Unit>? // app.cash.redwood.layout.testing/RowValue.onScroll.<get-onScroll>|<get-onScroll>(){}[0]
final fun <get-onScroll>(): kotlin/Function1<app.cash.redwood.ui/Px, kotlin/Unit>? // app.cash.redwood.layout.testing/RowValue.onScroll.<get-onScroll>|<get-onScroll>(){}[0]
final val overflow // app.cash.redwood.layout.testing/RowValue.overflow|{}overflow[0]
final fun <get-overflow>(): app.cash.redwood.layout.api/Overflow // app.cash.redwood.layout.testing/RowValue.overflow.<get-overflow>|<get-overflow>(){}[0]
final val verticalAlignment // app.cash.redwood.layout.testing/RowValue.verticalAlignment|{}verticalAlignment[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import app.cash.redwood.layout.api.Constraint
import app.cash.redwood.layout.api.Overflow
import app.cash.redwood.ui.Default
import app.cash.redwood.ui.Density
import app.cash.redwood.ui.Px
import app.cash.redwood.widget.ChangeListener
import app.cash.redwood.widget.UIViewChildren
import app.cash.redwood.yoga.FlexDirection
Expand Down Expand Up @@ -74,7 +75,7 @@ internal class UIViewFlexContainer(
yogaView.scrollEnabled = overflow == Overflow.Scroll
}

override fun onScroll(onScroll: ((Double) -> Unit)?) {
override fun onScroll(onScroll: ((Px) -> Unit)?) {
yogaView.onScroll = onScroll
}

Expand Down
Loading