measure

open fun measure(outSize: Size, widthSpec: Int, heightSpec: Int, @Nullable reMeasureEventHandler: EventHandler<ReMeasureEvent>)

A component mounting a RecyclerView can use this method to determine its size. A Recycler that scrolls horizontally will leave the width unconstrained and will measure its children with a sizeSpec for the height matching the heightSpec passed to this method.

If padding is defined on the parent component it should be subtracted from the parent size specs before passing them to this method.

Currently we can't support the equivalent of MATCH_PARENT on the scrollDirection (so for example we don't support MATCH_PARENT on width in an horizontal RecyclerView). This is mainly because we don't have the equivalent of LayoutParams in components. We can extend the api of the binder in the future to provide some more layout hints in order to support this.

Parameters

outSize

will be populated with the measured dimensions for this Binder.

widthSpec

the widthSpec to be used to measure the RecyclerView.

heightSpec

the heightSpec to be used to measure the RecyclerView.

reMeasureEventHandler

the EventHandler to invoke in order to trigger a re-measure.