Passing default nil value for maxWidth and maxHeight while creating SizeLayout from LOKSizeLayout.
LOKSizeLayoutBuilder sets INFINITY as default value for maxWidth and maxHeight.
In LOKSizeLayout, these values are used to create SizeLayout and SizeLayout decides
its alignment using these values if alignment property is not set by caller.
In above case, vertical and horizontal values of alignment will be set to .center.
But for SizeLayout, default value for maxWidth and maxHeight is nil so vertical and
horizontal values of alignment will be set to .fill.
So to keep same behavior in LOKSizeLayout, we have to pass nil value for maxWidth and maxHeight when these values are not finite.
Passing default nil value for
maxWidth
andmaxHeight
while creatingSizeLayout
fromLOKSizeLayout
.LOKSizeLayoutBuilder
setsINFINITY
as default value formaxWidth
andmaxHeight
.LOKSizeLayout
, these values are used to createSizeLayout
andSizeLayout
decides its alignment using these values ifalignment
property is not set by caller..center
.SizeLayout
, default value formaxWidth
andmaxHeight
is nil so vertical and horizontal values of alignment will be set to .fill.LOKSizeLayout
, we have to pass nil value for maxWidth and maxHeight when these values are not finite.