# CurvingLayoutCallback

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

*** ** * ** ***

<br />

```
class CurvingLayoutCallback : WearableLinearLayoutManager.LayoutCallback
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback](https://developer.android.com/reference/kotlin/androidx/wear/widget/WearableLinearLayoutManager.LayoutCallback) ||
|   | ↳ | [androidx.wear.widget.CurvingLayoutCallback](https://developer.android.com/reference/kotlin/androidx/wear/widget/CurvingLayoutCallback) |

*** ** * ** ***

An implementation of the `https://developer.android.com/reference/kotlin/androidx/wear/widget/WearableLinearLayoutManager.LayoutCallback` aligning the children of the associated `https://developer.android.com/reference/kotlin/androidx/wear/widget/WearableRecyclerView` along a pre-defined vertical curve.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/widget/CurvingLayoutCallback#CurvingLayoutCallback(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/widget/CurvingLayoutCallback#adjustAnchorOffsetXY(android.view.View,float[])(child: https://developer.android.com/reference/android/view/View.html!, anchorOffsetXY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!)` Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/widget/CurvingLayoutCallback#onLayoutFinished(android.view.View,androidx.recyclerview.widget.RecyclerView)(child: https://developer.android.com/reference/android/view/View.html!, parent: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView!)` Override this method to implement custom child layout behavior on scroll. |

## Public constructors

### CurvingLayoutCallback

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

```
CurvingLayoutCallback(context: Context!)
```

## Public functions

### adjustAnchorOffsetXY

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

```
fun adjustAnchorOffsetXY(child: View!, anchorOffsetXY: FloatArray<Float>!): Unit
```

Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass. In the override set the new desired anchor coordinates in the provided array. The coordinates should be provided in relation to the child view.

| Parameters |
|---|---|
| `child: https://developer.android.com/reference/android/view/View.html!` | The child view to which the anchor coordinates will apply. |
| `anchorOffsetXY: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!` | The anchor coordinates for the provided child view, by default set to a pre-defined constant on the horizontal axis and half of the child height on the vertical axis (vertical center). |

### onLayoutFinished

```
fun onLayoutFinished(child: View!, parent: RecyclerView!): Unit
```

Override this method to implement custom child layout behavior on scroll. It is called at the end of each layout pass of the view (including scrolling) and enables you to modify any property of the child view. Examples include scaling the children based on their distance from the center of the parent, or changing the translation of the children to create an illusion of the path they are moving along.

| Parameters |
|---|---|
| `child: https://developer.android.com/reference/android/view/View.html!` | the current child to be affected. |
| `parent: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView!` | the `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView` parent that this class is attached to. |