measureChildWithMargins

open fun measureChildWithMargins(@NonNull child: View, widthUsed: Int, heightUsed: Int)(source)

Measure a child view using standard measurement policy, taking the padding of the parent RecyclerView, any added item decorations and the child margins into account.

If the RecyclerView can be scrolled in either dimension the caller may pass 0 as the widthUsed or heightUsed parameters as they will be irrelevant.

Parameters

child

Child view to measure

widthUsed

Width in pixels currently consumed by other views, if relevant

heightUsed

Height in pixels currently consumed by other views, if relevant