# Debug

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

*** ** * ** ***

<br />

```
class Debug
```

<br />

*** ** * ** ***

Utilities useful for debugging

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#Debug()()` |

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#dumpLayoutParams(android.view.ViewGroup,java.lang.String)(layout: https://developer.android.com/reference/android/view/ViewGroup.html!, str: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#dumpLayoutParams(android.view.ViewGroup.LayoutParams,java.lang.String)(param: https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html!, str: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#dumpPoc(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getActionType(android.view.MotionEvent)(event: https://developer.android.com/reference/android/view/MotionEvent.html!)` Convert a motion event action to a string |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getCallFrom(int)(n: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Get file name and location where this method is called. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getLoc()()` Get file name and location where this method is called. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getLocation()()` Get file name and location where this method is called. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getLocation2()()` Get file name and location where this method is called. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getName(android.view.View)(view: https://developer.android.com/reference/android/view/View.html!)` This provides return the name of a view |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getName(android.content.Context,int[])(context: https://developer.android.com/reference/android/content/Context.html!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` This returns the name of a view given its id |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getName(android.content.Context,int)(context: https://developer.android.com/reference/android/content/Context.html!, id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` This returns the name of a view given its id |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getState(androidx.constraintlayout.motion.widget.MotionLayout,int)(layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionLayout!, stateId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` convert an id number to an id String useful in debugging |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#getState(androidx.constraintlayout.motion.widget.MotionLayout,int,int)(layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionLayout!, stateId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, len: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` convert an id number to an id String useful in debugging |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#logStack(java.lang.String,java.lang.String,int)(tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, msg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, n: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` This logs n elements in the stack |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/Debug#printStack(java.lang.String,int)(msg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, n: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` This logs n elements in the stack |

## Public constructors

### Debug

Added in 2.2.2

```
Debug()
```

## Public functions

### dumpLayoutParams

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

```
java-static fun dumpLayoutParams(layout: ViewGroup!, str: String!): Unit
```

| Parameters |
|---|---|
| `layout: https://developer.android.com/reference/android/view/ViewGroup.html!` |   |
| `str: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### dumpLayoutParams

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

```
java-static fun dumpLayoutParams(param: ViewGroup.LayoutParams!, str: String!): Unit
```

| Parameters |
|---|---|
| `param: https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html!` |   |
| `str: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### dumpPoc

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

```
java-static fun dumpPoc(obj: Any!): Unit
```

| Parameters |
|---|---|
| `obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!` |   |

### getActionType

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

```
java-static fun getActionType(event: MotionEvent!): String!
```

Convert a motion event action to a string

| Parameters |
|---|---|
| `event: https://developer.android.com/reference/android/view/MotionEvent.html!` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### getCallFrom

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

```
java-static fun getCallFrom(n: Int): String!
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | (filename : line_no) |

### getLoc

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

```
java-static fun getLoc(): String!
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | (filename : line_no) |

### getLocation

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

```
java-static fun getLocation(): String!
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | (filename : line_no) |

### getLocation2

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

```
java-static fun getLocation2(): String!
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | (filename : line_no) |

### getName

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

```
java-static fun getName(view: View!): String!
```

This provides return the name of a view

| Parameters |
|---|---|
| `view: https://developer.android.com/reference/android/view/View.html!` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | name of view |

### getName

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

```
java-static fun getName(context: Context!, id: IntArray<Int>!): String!
```

This returns the name of a view given its id

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` |   |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | name of view |

### getName

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

```
java-static fun getName(context: Context!, id: Int): String!
```

This returns the name of a view given its id

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html!` |   |
| `id: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | name of view |

### getState

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

```
java-static fun getState(layout: MotionLayout!, stateId: Int): String!
```

convert an id number to an id String useful in debugging

| Parameters |
|---|---|
| `layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionLayout!` |   |
| `stateId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### getState

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

```
java-static fun getState(layout: MotionLayout!, stateId: Int, len: Int): String!
```

convert an id number to an id String useful in debugging

| Parameters |
|---|---|
| `layout: https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/MotionLayout!` |   |
| `stateId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |
| `len: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | trim if string \>len |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |

### logStack

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

```
java-static fun logStack(tag: String!, msg: String!, n: Int): Unit
```

This logs n elements in the stack

| Parameters |
|---|---|
| `tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `msg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `n: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

### printStack

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

```
java-static fun printStack(msg: String!, n: Int): Unit
```

This logs n elements in the stack

| Parameters |
|---|---|
| `msg: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |
| `n: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |