# ViewPager.LayoutParams

# ViewPager.LayoutParams

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

*** ** * ** ***

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

<br />

```
class ViewPager.LayoutParams : ViewGroup.LayoutParams
```

<br />

|---|---|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                        |||
| ↳ | [android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html)                                ||
|   | ↳ | [androidx.viewpager.widget.ViewPager.LayoutParams](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager.LayoutParams) |

*** ** * ** ***

Layout parameters that should be supplied for views added to a ViewPager.

## Summary

|                                                                                                                                                                             ### Public constructors                                                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager.LayoutParams#LayoutParams())`()`                                                                                                                                                                                                                                              |
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager.LayoutParams#LayoutParams(android.content.Context,android.util.AttributeSet))`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`, attrs: `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)`?)` |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [gravity](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager.LayoutParams#gravity()) Gravity setting for use on decor views only: Where to position the view page within the overall ViewPager container; constants are defined in[android.view.Gravity](https://developer.android.com/reference/android/view/Gravity.html). |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isDecor](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager.LayoutParams#isDecor()) true if this view is a decoration on the pager itself and not a view supplied by the adapter.                                                                                                                                           |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Inherited Constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------| | `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [FILL_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#FILL_PARENT())` = -1` **This property is deprecated.** | | `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [MATCH_PARENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#MATCH_PARENT())` = -1`                                | | `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [WRAP_CONTENT](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#WRAP_CONTENT())` = -2`                                | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [resolveLayoutDirection](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#resolveLayoutDirection(int))`(layoutDirection: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)`                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [setBaseAttributes](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#setBaseAttributes(android.content.res.TypedArray, int, int))`(a: `[TypedArray](https://developer.android.com/reference/android/content/res/TypedArray.html)`!, widthAttr: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, heightAttr: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[android.view.ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html) |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                           | [height](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#height())                                       | | [LayoutAnimationController.AnimationParameters](https://developer.android.com/reference/android/view/animation/LayoutAnimationController.AnimationParameters.html)`!` | [layoutAnimationParameters](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#layoutAnimationParameters()) | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                           | [width](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html#width())                                         | |

## Public constructors

### LayoutParams

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

```
LayoutParams()
```  

### LayoutParams

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

```
LayoutParams(context: Context, attrs: AttributeSet?)
```  

## Public properties

### gravity

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

```
val gravity: Int
```

Gravity setting for use on decor views only: Where to position the view page within the overall ViewPager container; constants are defined in[android.view.Gravity](https://developer.android.com/reference/android/view/Gravity.html).  

### isDecor

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

```
val isDecor: Boolean
```

true if this view is a decoration on the pager itself and not a view supplied by the adapter.