chanjungskim
03/28/2023, 3:29 AMLoney Chou
03/28/2023, 3:40 AMIterable.fold but Modifier version. When you construct a Modifier chain using then or whatever its wrapper like Modifier.size, the element at the front is called outer, while at the back is inner. So foldIn iterates from the first to the last, the other one backwards.Loney Chou
03/28/2023, 3:44 AMModifier
.size
.padding
.background
.foldIn(Unit) { _, element ->
println(element::class.simpleName)
}
will print
SizeElement
PaddingElement
BackgroundElementchanjungskim
03/28/2023, 8:26 AMLoney Chou
03/28/2023, 8:34 AMdewildte
03/28/2023, 7:59 PM