OrientationHelper

abstract class OrientationHelper(source)

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

Properties

Link copied to clipboard
val HORIZONTAL: Int = 0
Link copied to clipboard
val VERTICAL: Int = 1

Functions

Link copied to clipboard
Creates a horizontal OrientationHelper for the given LayoutManager.
Link copied to clipboard
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
abstract fun getDecoratedEnd(view: View): Int
Returns the end of the view including its decoration and margin.
Link copied to clipboard
abstract fun getDecoratedMeasurement(view: View): Int
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
abstract fun getDecoratedStart(view: View): Int
Returns the start of the view including its decoration and margin.
Link copied to clipboard
abstract fun getEnd(): Int
Returns the end position of the layout without taking padding into account.
Link copied to clipboard
abstract fun getEndAfterPadding(): Int
Returns the end position of the layout after the end padding is removed.
Link copied to clipboard
abstract fun getEndPadding(): Int
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
abstract fun getMode(): Int
Returns the MeasureSpec mode for the current orientation from the LayoutManager.
Link copied to clipboard
abstract fun getModeInOther(): Int
Returns the MeasureSpec mode for the perpendicular orientation from the LayoutManager.
Link copied to clipboard
abstract fun getStartAfterPadding(): Int
Returns the start position of the layout after the start padding is added.
Link copied to clipboard
abstract fun getTotalSpace(): Int
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
abstract fun offsetChild(view: View, offset: Int)
Offsets the child in this orientation.
Link copied to clipboard
abstract fun offsetChildren(amount: Int)
Offsets all children's positions by the given amount.
Link copied to clipboard
open fun onLayoutComplete()
Call this method after onLayout method is complete if state is NOT pre-layout.