LayoutOps
LayoutOps copied to clipboard
Codable Layout Attributes
Added Codable LayoutAttribute enum value types.
You can now encode / decode these attributes. Also added auxiliary to use these value types as well:
/// Value types
public enum LayoutAttribute {
case fill(Fill)
case hFill(HFill)
case vFill(VFill)
case center(Center)
case hCenter(HCenter)
case vCenter(VCenter)
case alignTop(AlignTop)
case alignStart(AlignStart)
case alignBottom(AlignBottom)
case alignEnd(AlignEnd)
case unknown
}
view.lx.center(
Center(start: 0.0, top: 0.0, end: 0.0, bottom: 0.0)
)
view.lx.fill(
Fill(start: 0.0, top: 0.0, end: 0.0, bottom: 0.0)
)
view.lx.hFill(
HCenter(start: 0.0, end: 0.0)
)
view.lx.vFill(
VCenter(top: 0.0, bottom: 0.0)
)
// and so on.
Oh wow, that's really interesting, need to take a deep look. I am really impressed how much effort you put into my lib
I see you added new demo app. But I haven't found an example of usage new APIs inside of demo app? Is something supposed to be there? What is the purpose of having attributes to conform Hashable? Could you describe what is the goal to add serialization for layoutOps?
I can imagine adding serialization to nodes concept. So we can load ui descriptions from web or from local files
Ah just coming back to this now @psharanda I'm utilizing LayoutOps to serialize layout info as a means of rendering view components using simple value types across different platforms. Will write a more thorough response and implementation details shortly! By the way love the work you've put into this framework 👍