getChildMaskPercentage

@FloatRange(from = 0.0, to = 1.0)
open fun getChildMaskPercentage(maskedSize: Float, unmaskedSize: Float, childMargins: Float): Float

Helper method to calculate a child's mask percentage given its masked size, unmasked size, and margins.

Return

A percentage by which the child should be masked in order to be sized at maskedSize. 0F is fully unmasked and 1F is fully masked.

Parameters

maskedSize

The size this method calculates a mask percentage for

unmaskedSize

The size this child is when fully unmasked (mask == 0F). This should likely be the itemSize passed to the KeylineState.Builder constructor.

childMargins

The total margins at the start+end or top+bottom of this child. By default, these are removed from the returned mask as margins should not change in size as a child's mask changes.