# BaseCardView.LayoutParams

# BaseCardView.LayoutParams

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

*** ** * ** ***

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

<br />

```
class BaseCardView.LayoutParams : FrameLayout.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)                                          ||||
|   | ↳ | [android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html)                           |||
|   |   | ↳ | [android.widget.FrameLayout.LayoutParams](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams.html)                            ||
|   |   |   | ↳ | [androidx.leanback.widget.BaseCardView.LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams) |

*** ** * ** ***

Per-child layout information associated with BaseCardView.

## Summary

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [VIEW_TYPE_EXTRA](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#VIEW_TYPE_EXTRA())` = 2` |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [VIEW_TYPE_INFO](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#VIEW_TYPE_INFO())` = 1`   |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [VIEW_TYPE_MAIN](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#VIEW_TYPE_MAIN())` = 0`   |

|                                                                                                                                                                           ### Public constructors                                                                                                                                                                            |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#LayoutParams(android.view.ViewGroup.LayoutParams))`(p: `[ViewGroup.LayoutParams](https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html)`!)`                                                                                      |
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#LayoutParams(androidx.leanback.widget.BaseCardView.LayoutParams))`(source: `[BaseCardView.LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams)`!)` Copy constructor.                            |
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#LayoutParams(android.content.Context,android.util.AttributeSet))`(c: `[Context](https://developer.android.com/reference/android/content/Context.html)`!, attrs: `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)`!)` |
| [LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#LayoutParams(int,int))`(width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)`                                                       |

|                            ### Public properties                            |
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | `@`[ViewDebug.ExportedProperty](https://developer.android.com/reference/android/view/ViewDebug.ExportedProperty.html)`(category = "layout", mapping = [@`[ViewDebug.IntToString](https://developer.android.com/reference/android/view/ViewDebug.IntToString.html)`(from = 0, to = "MAIN"), @`[ViewDebug.IntToString](https://developer.android.com/reference/android/view/ViewDebug.IntToString.html)`(from = 1, to = "INFO"), @`[ViewDebug.IntToString](https://developer.android.com/reference/android/view/ViewDebug.IntToString.html)`(from = 2, to = "EXTRA")])` [viewType](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams#viewType()) Card component type for the view associated with these LayoutParams. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ### Inherited Constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[android.widget.FrameLayout.LayoutParams](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams.html) |-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------| | `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [UNSPECIFIED_GRAVITY](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams.html#UNSPECIFIED_GRAVITY())` = -1` |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 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) | [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)`)` |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| From[android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [getLayoutDirection](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getLayoutDirection())`()`                                                                                                                                                                                                                                                                                                                                                       | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [getMarginEnd](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginEnd())`()`                                                                                                                                                                                                                                                                                                                                                                   | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [getMarginStart](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#getMarginStart())`()`                                                                                                                                                                                                                                                                                                                                                               | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isMarginRelative](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#isMarginRelative())`()`                                                                                                                                                                                                                                                                                                                                                           | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [resolveLayoutDirection](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.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)       | [setLayoutDirection](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setLayoutDirection(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)       | [setMarginEnd](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginEnd(int))`(end: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)`                                                                                                                                                                                                                                                                              | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [setMarginStart](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMarginStart(int))`(start: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)`                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [setMargins](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMargins(int, int, int, int))`(left: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, top: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, right: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, bottom: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[android.widget.FrameLayout.LayoutParams](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams.html) |-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [gravity](https://developer.android.com/reference/android/widget/FrameLayout.LayoutParams.html#gravity()) |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 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())                                         | |
| From[android.view.ViewGroup.MarginLayoutParams](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html) |-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [bottomMargin](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#bottomMargin()) | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [leftMargin](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#leftMargin())     | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [rightMargin](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#rightMargin())   | | [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [topMargin](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#topMargin())       |                                                                                                                                                                                                                                     |

## Constants

### VIEW_TYPE_EXTRA

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

```
const val VIEW_TYPE_EXTRA = 2: Int
```  

### VIEW_TYPE_INFO

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

```
const val VIEW_TYPE_INFO = 1: Int
```  

### VIEW_TYPE_MAIN

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

```
const val VIEW_TYPE_MAIN = 0: Int
```  

## Public constructors

### LayoutParams

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

```
LayoutParams(p: ViewGroup.LayoutParams!)
```  

### LayoutParams

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

```
LayoutParams(source: BaseCardView.LayoutParams!)
```

Copy constructor. Clones the width, height, and View Type of the source.  

|                                                                 Parameters                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| `source: `[BaseCardView.LayoutParams](https://developer.android.com/reference/kotlin/androidx/leanback/widget/BaseCardView.LayoutParams)`!` | The layout params to copy from. |

### LayoutParams

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

```
LayoutParams(c: Context!, attrs: AttributeSet!)
```  

### LayoutParams

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

```
LayoutParams(width: Int, height: Int)
```  

## Public properties

### viewType

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

```
@ViewDebug.ExportedProperty(category = "layout", mapping = [@ViewDebug.IntToString(from = 0, to = "MAIN"), @ViewDebug.IntToString(from = 1, to = "INFO"), @ViewDebug.IntToString(from = 2, to = "EXTRA")])
val viewType: Int
```

Card component type for the view associated with these LayoutParams.