# MockView

Summary:[Ctors](https://developer.android.com/reference/android/support/constraint/utils/MockView#pubctors)\|[Methods](https://developer.android.com/reference/android/support/constraint/utils/MockView#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/constraint/utils/MockView#inhmethods)  

# MockView

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The Constraint Layout support library has been superseded by the[AndroidX Constraint Layout library](https://developer.android.com/reference/androidx/constraintlayout/classes), which is part of[Jetpack](https://developer.android.com/jetpack). The`MockView`class has been superseded by[`androidx.constraintlayout.utils.widget.MockView`](https://developer.android.com/reference/androidx/constraintlayout/utils/widget/MockView). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX.

`
public


class
MockView
`  
`


``

extends View


``


`

|---|---|-------------------------------------------|
| java.lang.Object                                |||
| ↳ | View                                         ||
|   | ↳ | android.support.constraint.utils.MockView |

<br />

*** ** * ** ***

A view that is useful for prototyping layouts.**Added in 2.0**

Basic view that can draw a label (by default the view id), along with diagonals. Useful as a temporary mock view while building up a UI.

<br />

## Summary

|                                                                                        ### Public constructors                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[MockView](https://developer.android.com/reference/android/support/constraint/utils/MockView#MockView(Context))`(Context context) `                                                              |
| ` `[MockView](https://developer.android.com/reference/android/support/constraint/utils/MockView#MockView(Context,%20AttributeSet))`(Context context, AttributeSet attrs) `                          |
| ` `[MockView](https://developer.android.com/reference/android/support/constraint/utils/MockView#MockView(Context,%20AttributeSet,%20int))`(Context context, AttributeSet attrs, int defStyleAttr) ` |

|                                                            ### Public methods                                                            ||
|---------|---------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onDraw](https://developer.android.com/reference/android/support/constraint/utils/MockView#onDraw(Canvas))`(Canvas canvas) ` |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### MockView

```
public MockView (Context context)
```

<br />

<br />

|         Parameters          ||
|-----------|------------------|
| `context` | `Context` <br /> |

### MockView

```
public MockView (Context context, 
                AttributeSet attrs)
```

<br />

<br />

|            Parameters            ||
|-----------|-----------------------|
| `context` | `Context` <br />      |
| `attrs`   | `AttributeSet` <br /> |

### MockView

```
public MockView (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)
```

<br />

<br />

|              Parameters               ||
|----------------|-----------------------|
| `context`      | `Context` <br />      |
| `attrs`        | `AttributeSet` <br /> |
| `defStyleAttr` | `int` <br />          |

## Public methods

### onDraw

```
public void onDraw (Canvas canvas)
```

<br />

<br />

|        Parameters         ||
|----------|-----------------|
| `canvas` | `Canvas` <br /> |