NeedsBgPaddingInfo

Because a LayoutInfo/LayoutManager may rely on padding to generate a child measure specs, and because padding isn't accessible in a thread-safe way, this interface gives a LayoutManager the chance to record the RecyclerView's padding when it's attached.

This is a bit of a hack and is best-effort only -- the primary goal is to prevent accessing View padding off the main thread since it can crash. If RV padding changes after this padding info is set, the bg padding info will NOT be up-to-date. For most usecases, this shouldn't matter.

Functions

Link copied to clipboard
abstract fun setBgPaddingInfo(paddingInfo: Rect)