# OrientationHelper

# OrientationHelper

Artifact:[androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview)  
[View Source](https://cs.android.com/search?q=file:androidx/recyclerview/widget/OrientationHelper.java+class:androidx.recyclerview.widget.OrientationHelper)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/recyclerview/widget/OrientationHelper "View this page in Java")

<br />

```
abstract class OrientationHelper
```

<br />

*** ** * ** ***

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                                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [createHorizontalHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#createHorizontalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager)) |   |
| [createVerticalHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#createVerticalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager))     |   |

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [HORIZONTAL](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#HORIZONTAL())` = 0` |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [VERTICAL](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#VERTICAL())` = 1`     |

|                                                          ### Public functions                                                           |
|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!`     | [createHorizontalHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#createHorizontalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager))`(layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!)` Creates a horizontal OrientationHelper for the given LayoutManager.                                                                                                                 |
| `java-static `[OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!`     | [createOrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#createOrientationHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager,int))`(` ` layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!,` ` orientation: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Creates an OrientationHelper for the given LayoutManager and orientation. |
| `java-static `[OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!`     | [createVerticalHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#createVerticalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager))`(layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!)` Creates a vertical OrientationHelper for the given LayoutManager.                                                                                                                       |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getDecoratedEnd](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedEnd(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the end of the view including its decoration and margin.                                                                                                                                                                                                                                               |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getDecoratedMeasurement](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedMeasurement(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the space occupied by this View in the current orientation including decorations and margins.                                                                                                                                                                                          |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getDecoratedMeasurementInOther](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedMeasurementInOther(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the space occupied by this View in the perpendicular orientation including decorations and margins.                                                                                                                                                                      |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getDecoratedStart](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedStart(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the start of the view including its decoration and margin.                                                                                                                                                                                                                                         |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getEnd](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getEnd())`()` Returns the end position of the layout without taking padding into account.                                                                                                                                                                                                                                                                                                                                                      |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getEndAfterPadding](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getEndAfterPadding())`()` Returns the end position of the layout after the end padding is removed.                                                                                                                                                                                                                                                                                                                                 |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getEndPadding](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getEndPadding())`()` Returns the padding at the end of the layout.                                                                                                                                                                                                                                                                                                                                                                      |
| [RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!` | [getLayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getLayoutManager())`()` Returns the[LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)that is associated with this OrientationHelper.                                                                                                                                                                                                                            |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getMode())`()` Returns the MeasureSpec mode for the current orientation from the LayoutManager.                                                                                                                                                                                                                                                                                                                                               |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getModeInOther](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getModeInOther())`()` Returns the MeasureSpec mode for the perpendicular orientation from the LayoutManager.                                                                                                                                                                                                                                                                                                                           |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getStartAfterPadding](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getStartAfterPadding())`()` Returns the start position of the layout after the start padding is added.                                                                                                                                                                                                                                                                                                                           |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getTotalSpace](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getTotalSpace())`()` Returns the total space to layout.                                                                                                                                                                                                                                                                                                                                                                                 |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                             | [getTotalSpaceChange](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getTotalSpaceChange())`()` Returns the layout space change between the previous layout pass and current layout pass.                                                                                                                                                                                                                                                                                                              |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getTransformedEndWithDecoration](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getTransformedEndWithDecoration(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the end of the View after its matrix transformations are applied to its layout position.                                                                                                                                                                               |
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                  | [getTransformedStartWithDecoration](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getTransformedStartWithDecoration(android.view.View))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!)` Returns the start of the View after its matrix transformations are applied to its layout position.                                                                                                                                                                         |
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                | [offsetChild](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#offsetChild(android.view.View,int))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`!, offset: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Offsets the child in this orientation.                                                                                                                                                                                      |
| `abstract `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                | [offsetChildren](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#offsetChildren(int))`(amount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Offsets all children's positions by the given amount.                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                           | [onLayoutComplete](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#onLayoutComplete())`()` Call this method after onLayout method is complete if state is NOT pre-layout.                                                                                                                                                                                                                                                                                                                               |

|                                                        ### Protected properties                                                         |
|-----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|
| [RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!` | [mLayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#mLayoutManager()) |

## Constants

### HORIZONTAL

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
const val HORIZONTAL = 0: Int
```  

### VERTICAL

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
const val VERTICAL = 1: Int
```  

## Public functions

### createHorizontalHelper

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
java-static fun createHorizontalHelper(layoutManager: RecyclerView.LayoutManager!): OrientationHelper!
```

Creates a horizontal OrientationHelper for the given LayoutManager.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| `layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!` | The LayoutManager to attach to. |

|                                                        Returns                                                        |
|-----------------------------------------------------------------------------------------------------------------------|-------------------------|
| [OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!` | A new OrientationHelper |

### createOrientationHelper

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
java-static fun createOrientationHelper(
    layoutManager: RecyclerView.LayoutManager!,
    orientation: Int
): OrientationHelper!
```

Creates an OrientationHelper for the given LayoutManager and orientation.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!` | LayoutManager to attach to                                                                                                                                                                                                                                                   |
| `orientation: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                               | Desired orientation. Should be[HORIZONTAL](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#HORIZONTAL())or[VERTICAL](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#VERTICAL()) |

|                                                        Returns                                                        |
|-----------------------------------------------------------------------------------------------------------------------|-------------------------|
| [OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!` | A new OrientationHelper |

### createVerticalHelper

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
java-static fun createVerticalHelper(layoutManager: RecyclerView.LayoutManager!): OrientationHelper!
```

Creates a vertical OrientationHelper for the given LayoutManager.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| `layoutManager: `[RecyclerView.LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)`!` | The LayoutManager to attach to. |

|                                                        Returns                                                        |
|-----------------------------------------------------------------------------------------------------------------------|-------------------------|
| [OrientationHelper](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper)`!` | A new OrientationHelper |

### getDecoratedEnd

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getDecoratedEnd(view: View!): Int
```

Returns the end of the view including its decoration and margin.

For example, for the horizontal helper, if a View's right is at pixel 200, has 2px right decoration and 3px right margin, returned value will be 205.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|---------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view element to check |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The last pixel of the element |

|                                                                        See also                                                                         |
|---------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getDecoratedStart](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedStart(android.view.View)) |   |

### getDecoratedMeasurement

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getDecoratedMeasurement(view: View!): Int
```

Returns the space occupied by this View in the current orientation including decorations and margins.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|---------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view element to check |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Total space occupied by this view |

|                                                                                     See also                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getDecoratedMeasurementInOther](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedMeasurementInOther(android.view.View)) |   |

### getDecoratedMeasurementInOther

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getDecoratedMeasurementInOther(view: View!): Int
```

Returns the space occupied by this View in the perpendicular orientation including decorations and margins.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|---------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view element to check |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Total space occupied by this view in the perpendicular orientation to current one |

|                                                                              See also                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getDecoratedMeasurement](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedMeasurement(android.view.View)) |   |

### getDecoratedStart

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getDecoratedStart(view: View!): Int
```

Returns the start of the view including its decoration and margin.

For example, for the horizontal helper, if a View's left is at pixel 20, has 2px left decoration and 3px left margin, returned value will be 15px.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|---------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view element to check |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|--------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The first pixel of the element |

|                                                                      See also                                                                       |
|-----------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getDecoratedEnd](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getDecoratedEnd(android.view.View)) |   |

### getEnd

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getEnd(): Int
```

Returns the end position of the layout without taking padding into account.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The end boundary for this layout without considering padding. |

### getEndAfterPadding

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getEndAfterPadding(): Int
```

Returns the end position of the layout after the end padding is removed.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The end boundary for this layout. |

### getEndPadding

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getEndPadding(): Int
```

Returns the padding at the end of the layout. For horizontal helper, this is the right padding and for vertical helper, this is the bottom padding. This method does not check whether the layout is RTL or not.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The padding at the end of the layout. |

### getLayoutManager

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
fun getLayoutManager(): RecyclerView.LayoutManager!
```

Returns the[LayoutManager](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager)that is associated with this OrientationHelper.  

### getMode

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getMode(): Int
```

Returns the MeasureSpec mode for the current orientation from the LayoutManager.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|--------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The current measure spec mode. |

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [View.MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec.html)                                          |   |
| [getWidthMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getWidthMode())   |   |
| [getHeightMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getHeightMode()) |   |

### getModeInOther

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getModeInOther(): Int
```

Returns the MeasureSpec mode for the perpendicular orientation from the LayoutManager.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|--------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The current measure spec mode. |

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [View.MeasureSpec](https://developer.android.com/reference/android/view/View.MeasureSpec.html)                                          |   |
| [getWidthMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getWidthMode())   |   |
| [getHeightMode](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getHeightMode()) |   |

### getStartAfterPadding

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getStartAfterPadding(): Int
```

Returns the start position of the layout after the start padding is added.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The very first pixel we can draw. |

### getTotalSpace

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getTotalSpace(): Int
```

Returns the total space to layout. This number is the difference between[getEndAfterPadding](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getEndAfterPadding())and[getStartAfterPadding](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#getStartAfterPadding()).  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|--------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Total space to layout children |

### getTotalSpaceChange

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
fun getTotalSpaceChange(): Int
```

Returns the layout space change between the previous layout pass and current layout pass.

Make sure you call[onLayoutComplete](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#onLayoutComplete())at the end of your LayoutManager's[onLayoutChildren](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler,androidx.recyclerview.widget.RecyclerView.State))method.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The difference between the current total space and previous layout's total space. |

|                                                               See also                                                               |
|--------------------------------------------------------------------------------------------------------------------------------------|---|
| [onLayoutComplete](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/OrientationHelper#onLayoutComplete()) |   |

### getTransformedEndWithDecoration

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getTransformedEndWithDecoration(view: View!): Int
```

Returns the end of the View after its matrix transformations are applied to its layout position.

This method is useful when trying to detect the visible edge of a View.

It includes the decorations but does not include the margins.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|-------------------------------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view whose transformed end will be returned |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The end of the View after its decor insets and transformation matrix is applied to its position |

|                                                                                                    See also                                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getTransformedBoundingBox](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getTransformedBoundingBox(android.view.View,boolean,android.graphics.Rect)) |   |

### getTransformedStartWithDecoration

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun getTransformedStartWithDecoration(view: View!): Int
```

Returns the start of the View after its matrix transformations are applied to its layout position.

This method is useful when trying to detect the visible edge of a View.

It includes the decorations but does not include the margins.  

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|---------------------------------------------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!` | The view whose transformed start will be returned |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The start of the View after its decor insets and transformation matrix is applied to its position |

|                                                                                                    See also                                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getTransformedBoundingBox](https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView.LayoutManager#getTransformedBoundingBox(android.view.View,boolean,android.graphics.Rect)) |   |

### offsetChild

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun offsetChild(view: View!, offset: Int): Unit
```

Offsets the child in this orientation.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|----------------|
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`!`     | View to offset |
| `offset: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | offset amount  |

### offsetChildren

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
abstract fun offsetChildren(amount: Int): Unit
```

Offsets all children's positions by the given amount.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|------------------------------------------------|
| `amount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Value to add to each child's layout parameters |

### onLayoutComplete

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
fun onLayoutComplete(): Unit
```

Call this method after onLayout method is complete if state is NOT pre-layout. This method records information like layout bounds that might be useful in the next layout calculations.  

## Protected properties

### mLayoutManager

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)  

```
protected val mLayoutManager: RecyclerView.LayoutManager!
```