OrientationHelper
Helper class for LayoutManagers to abstract measurements depending on the View's orientation.
It is developed to easily support vertical and horizontal orientations in a LayoutManager but can also be used to abstract calls around view bounds and child measurements with margins and decorations.
See also
Functions
Link copied to clipboard
Creates a horizontal OrientationHelper for the given LayoutManager.
Link copied to clipboard
open fun createOrientationHelper(layoutManager: RecyclerView.LayoutManager, orientation: Int): OrientationHelper
Creates an OrientationHelper for the given LayoutManager and orientation.
Link copied to clipboard
Creates a vertical OrientationHelper for the given LayoutManager.
Link copied to clipboard
Returns the end of the view including its decoration and margin.
Link copied to clipboard
Returns the space occupied by this View in the current orientation including decorations and margins.
Link copied to clipboard
Returns the space occupied by this View in the perpendicular orientation including decorations and margins.
Link copied to clipboard
Returns the start of the view including its decoration and margin.
Link copied to clipboard
Returns the end position of the layout after the end padding is removed.
Link copied to clipboard
Returns the padding at the end of the layout.
Link copied to clipboard
Returns the LayoutManager that is associated with this OrientationHelper.
Link copied to clipboard
Returns the MeasureSpec mode for the perpendicular orientation from the LayoutManager.
Link copied to clipboard
Returns the start position of the layout after the start padding is added.
Link copied to clipboard
Returns the total space to layout.
Link copied to clipboard
Returns the layout space change between the previous layout pass and current layout pass.
Link copied to clipboard
Returns the end of the View after its matrix transformations are applied to its layout position.
Link copied to clipboard
Returns the start of the View after its matrix transformations are applied to its layout position.
Link copied to clipboard
Offsets the child in this orientation.
Link copied to clipboard
Offsets all children's positions by the given amount.
Link copied to clipboard
Call this method after onLayout method is complete if state is NOT pre-layout.