Description
What problem does this solve or what need does it fill?
Provides a more compact, write-friendly, ergonomic interface
What solution would you like?
@LayoutSpec
public class PlaygroundComponentSpec {
@OnCreateLayout
static Component onCreateLayout(ComponentContext c) {
return Row.create(c)
.child(
Row.create(c)
.widthDip(100)
.heightDip(100))
.child(
Row.create(c)
.widthDip(100)
.heightDip(100)
.marginDip(YogaEdge.HORIZONTAL, 20)
.flexGrow(1))
.child(
Row.create(c)
.widthDip(100)
.heightDip(100))
.widthDip(500)
.heightDip(500)
.alignItems(YogaAlign.FLEX_START)
.paddingDip(YogaEdge.ALL, 20)
.build();
}
}
What alternative(s) have you considered?
Since many anonymous nodes are used, a method of result feedback is needed, such as having the node save a callback function, or a Trait that provides result feedback
Additional context
The sample code comes from the Yoga home page, a Java package called litho. But it can be translated quite directly to Rust code.
Metadata
Metadata
Assignees
Type
Projects
Status
Todo