# ViewOutlineProvider

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Fields](https://developer.android.com/reference/android/view/ViewOutlineProvider#lfields)\|[Ctors](https://developer.android.com/reference/android/view/ViewOutlineProvider#pubctors)\|[Methods](https://developer.android.com/reference/android/view/ViewOutlineProvider#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/ViewOutlineProvider#inhmethods)  

# ViewOutlineProvider

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/ViewOutlineProvider "View this page in Kotlin")\|Java

`
public


abstract
class
ViewOutlineProvider
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|----------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.ViewOutlineProvider |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [RemoteViews.RemoteViewOutlineProvider](https://developer.android.com/reference/android/widget/RemoteViews.RemoteViewOutlineProvider) |---------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [RemoteViews.RemoteViewOutlineProvider](https://developer.android.com/reference/android/widget/RemoteViews.RemoteViewOutlineProvider) | OutlineProvider for a view with a radius set by[RemoteViews.setViewOutlinePreferredRadius(int, float, int)](https://developer.android.com/reference/android/widget/RemoteViews#setViewOutlinePreferredRadius(int,%20float,%20int)). | |

<br />

*** ** * ** ***

Interface by which a View builds its[Outline](https://developer.android.com/reference/android/graphics/Outline), used for shadow casting and clipping.

## Summary

|                                                                                                                                                                                                     ### Fields                                                                                                                                                                                                      ||
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[ViewOutlineProvider](https://developer.android.com/reference/android/view/ViewOutlineProvider) | [BACKGROUND](https://developer.android.com/reference/android/view/ViewOutlineProvider#BACKGROUND) Default outline provider for Views, which queries the Outline from the View's background, or generates a 0 alpha, rectangular Outline the size of the View if a background isn't present. |
| ` public static final `[ViewOutlineProvider](https://developer.android.com/reference/android/view/ViewOutlineProvider) | [BOUNDS](https://developer.android.com/reference/android/view/ViewOutlineProvider#BOUNDS) Maintains the outline of the View to match its rectangular bounds, at`1.0f`alpha.                                                                                                                 |
| ` public static final `[ViewOutlineProvider](https://developer.android.com/reference/android/view/ViewOutlineProvider) | [PADDED_BOUNDS](https://developer.android.com/reference/android/view/ViewOutlineProvider#PADDED_BOUNDS) Maintains the outline of the View to match its rectangular padded bounds, at`1.0f`alpha.                                                                                            |

|                                                     ### Public constructors                                                      ||
|-------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ViewOutlineProvider](https://developer.android.com/reference/android/view/ViewOutlineProvider#ViewOutlineProvider())`() ` |

|                                                                                                                                                                                      ### Public methods                                                                                                                                                                                       ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[getOutline](https://developer.android.com/reference/android/view/ViewOutlineProvider#getOutline(android.view.View,%20android.graphics.Outline))`(`[View](https://developer.android.com/reference/android/view/View)` view, `[Outline](https://developer.android.com/reference/android/graphics/Outline)` outline) ` Called to get the provider to populate the Outline. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Fields

### BACKGROUND

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final ViewOutlineProvider BACKGROUND
```

Default outline provider for Views, which queries the Outline from the View's background, or generates a 0 alpha, rectangular Outline the size of the View if a background isn't present.

<br />

**See also:**

- [Drawable.getOutline(Outline)](https://developer.android.com/reference/android/graphics/drawable/Drawable#getOutline(android.graphics.Outline))  

### BOUNDS

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final ViewOutlineProvider BOUNDS
```

Maintains the outline of the View to match its rectangular bounds, at`1.0f`alpha. This can be used to enable Views that are opaque but lacking a background cast a shadow.

<br />

### PADDED_BOUNDS

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final ViewOutlineProvider PADDED_BOUNDS
```

Maintains the outline of the View to match its rectangular padded bounds, at`1.0f`alpha. This can be used to enable Views that are opaque but lacking a background cast a shadow.

<br />

## Public constructors

### ViewOutlineProvider

```
public ViewOutlineProvider ()
```

<br />

<br />

## Public methods

### getOutline

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void getOutline (View view, 
                Outline outline)
```

Called to get the provider to populate the Outline. This method will be called by a View when its owned Drawables are invalidated, when the View's size changes, or if[View.invalidateOutline()](https://developer.android.com/reference/android/view/View#invalidateOutline())is called explicitly. The input outline is empty and has an alpha of`1.0f`.

<br />

|                           Parameters                            ||
|-----------|------------------------------------------------------|
| `view`    | `View`: The view building the outline. <br />        |
| `outline` | `Outline`: The empty outline to be populated. <br /> |