# EdgeEffectCompat

# EdgeEffectCompat

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

*** ** * ** ***

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


```
class EdgeEffectCompat
```

<br />

*** ** * ** ***

Helper for accessing [EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html). This class is used to access [EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) on platform versions that support it. When running on older platforms it will result in no-ops. It should be used by views that wish to use the standard Android visual effects at the edges of scrolling containers.

## Summary

|                                                                                                                                                                                                                                                                         ### Public constructors                                                                                                                                                                                                                                                                          |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ~~[EdgeEffectCompat](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#EdgeEffectCompat(android.content.Context))~~`(context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!)` **This function is deprecated.** Use [EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) constructor directly or [create](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#create(android.content.Context,android.util.AttributeSet)). <br /> |

|                                        ### Public functions                                        |
|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) | [create](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#create(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)`?)` Constructs and returns a new EdgeEffect themed using the given context, allowing support for the view attributes.                                                                                     |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[draw](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#draw(android.graphics.Canvas))~~`(canvas: `[Canvas](https://developer.android.com/reference/android/graphics/Canvas.html)`!)` **This function is deprecated.** Use [draw](https://developer.android.com/reference/android/widget/EdgeEffect.html#draw(android.graphics.Canvas)) directly. <br />                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                      | ~~[finish](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#finish())~~`()` **This function is deprecated.** Use [finish](https://developer.android.com/reference/android/widget/EdgeEffect.html#finish()) directly. <br />                                                                                                                                                                                                                                                                                                |
| `java-static `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)      | [getDistance](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#getDistance(android.widget.EdgeEffect))`(edgeEffect: `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html)`)` Returns the pull distance needed to be released to remove the showing effect.                                                                                                                                                                                                                                 |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[isFinished](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#isFinished())~~`()` **This function is deprecated.** Use [isFinished](https://developer.android.com/reference/android/widget/EdgeEffect.html#isFinished()) directly. <br />                                                                                                                                                                                                                                                                                |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[onAbsorb](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onAbsorb(int))~~`(velocity: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.** Use [onAbsorb](https://developer.android.com/reference/android/widget/EdgeEffect.html#onAbsorb(int)) directly. <br />                                                                                                                                                                                           |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float))~~`(deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` **This function is deprecated.** Use [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(android.widget.EdgeEffect,float,float)). <br />                                                                                                                                                 |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float,float))~~`(deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` **This function is deprecated.** Use [onPull](https://developer.android.com/reference/android/widget/EdgeEffect.html#onPull(float)) directly. <br />                                                                               |
| `java-static `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)        | [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(android.widget.EdgeEffect,float,float))`(edgeEffect: `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html)`, deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`, displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` A view should call this when content is pulled away from an edge by the user.                            |
| `java-static `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)      | [onPullDistance](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPullDistance(android.widget.EdgeEffect,float,float))`(` ` edgeEffect: `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html)`,` ` deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`,` ` displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) `)` A view should call this when content is pulled away from an edge by the user. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                | ~~[onRelease](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onRelease())~~`()` **This function is deprecated.** Use [onRelease](https://developer.android.com/reference/android/widget/EdgeEffect.html#onRelease()) directly. <br />                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                      | ~~[setSize](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#setSize(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)`)` **This function is deprecated.** Use [setSize](https://developer.android.com/reference/android/widget/EdgeEffect.html#setSize(int, int)) directly. <br />                                                                                                  |

## Public constructors

### EdgeEffectCompat

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

```
[EdgeEffectCompat](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#EdgeEffectCompat(android.content.Context))(context: Context!)
```
| **This function is deprecated.**   
|
| Use [EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) constructor directly or [create](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#create(android.content.Context,android.util.AttributeSet)).

Construct a new EdgeEffect themed using the given context.

Note: On platform versions that do not support EdgeEffect, all operations on the newly constructed object will be mocked/no-ops.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|---------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)`!` | Context to use for theming the effect |

## Public functions

### create

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

```
java-static fun create(context: Context, attrs: AttributeSet?): EdgeEffect
```

Constructs and returns a new EdgeEffect themed using the given context, allowing support for the view attributes.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| `context: `[Context](https://developer.android.com/reference/android/content/Context.html)         | Context to use for theming the effect                    |
| `attrs: `[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet.html)`?` | The attributes of the XML tag that is inflating the view |

### draw

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

```
fun [draw](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#draw(android.graphics.Canvas))(canvas: Canvas!): Boolean
```
| **This function is deprecated.**   
|
| Use [draw](https://developer.android.com/reference/android/widget/EdgeEffect.html#draw(android.graphics.Canvas)) directly.

Draw into the provided canvas. Assumes that the canvas has been rotated accordingly and the size has been set. The effect will be drawn the full width of X=0 to X=width, beginning from Y=0 and extending to some factor \<1.f of height.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|---------------------|
| `canvas: `[Canvas](https://developer.android.com/reference/android/graphics/Canvas.html)`!` | Canvas to draw into |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if drawing should continue beyond this frame to continue the animation |

### finish

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

```
fun [finish](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#finish())(): Unit
```
| **This function is deprecated.**   
|
| Use [finish](https://developer.android.com/reference/android/widget/EdgeEffect.html#finish()) directly.

Immediately finish the current animation. After this call [isFinished](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#isFinished()) will return true.  

### getDistance

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

```
java-static fun getDistance(edgeEffect: EdgeEffect): Float
```

Returns the pull distance needed to be released to remove the showing effect. It is determined by the [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float,float))`deltaDistance` and any animating values, including from [onAbsorb](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onAbsorb(int)) and [onRelease](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onRelease()). This can be used in conjunction with [onPullDistance](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPullDistance(android.widget.EdgeEffect,float,float)) to release the currently showing effect. On API level 30 and earlier, this will return 0.  

|                                     Returns                                     |
|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The pull distance that must be released to remove the showing effect or 0 for API level 30 and earlier. |

### isFinished

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

```
fun [isFinished](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#isFinished())(): Boolean
```
| **This function is deprecated.**   
|
| Use [isFinished](https://developer.android.com/reference/android/widget/EdgeEffect.html#isFinished()) directly.

Reports if this EdgeEffectCompat's animation is finished. If this method returns false after a call to [draw](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#draw(android.graphics.Canvas)) the host widget should schedule another drawing pass to continue the animation.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if animation is finished, false if drawing should continue on the next frame. |

### onAbsorb

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

```
fun [onAbsorb](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onAbsorb(int))(velocity: Int): Boolean
```
| **This function is deprecated.**   
|
| Use [onAbsorb](https://developer.android.com/reference/android/widget/EdgeEffect.html#onAbsorb(int)) directly.

Call when the effect absorbs an impact at the given velocity. Used when a fling reaches the scroll boundary.

When using a [Scroller](https://developer.android.com/reference/android/widget/Scroller.html) or [OverScroller](https://developer.android.com/reference/android/widget/OverScroller.html), the method `getCurrVelocity` will provide a reasonable approximation to use here.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|------------------------------------------|
| `velocity: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Velocity at impact in pixels per second. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the host view should invalidate, false if it should not. |

### onPull

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

```
fun [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float))(deltaDistance: Float): Boolean
```
| **This function is deprecated.**   
|
| Use [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(android.widget.EdgeEffect,float,float)).

A view should call this when content is pulled away from an edge by the user. This will update the state of the current visual effect and its associated animation. The host view should always [invalidate](https://developer.android.com/reference/android/view/View.html#invalidate()) if this method returns true and draw the results accordingly.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Change in distance since the last call. Values may be 0 (no change) to 1.f (full length of the view) or negative values to express change back toward the edge reached to initiate the effect. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the host view should call invalidate, false if it should not. |

### onPull

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

```
fun [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float,float))(deltaDistance: Float, displacement: Float): Boolean
```
| **This function is deprecated.**   
|
| Use [onPull](https://developer.android.com/reference/android/widget/EdgeEffect.html#onPull(float)) directly.

A view should call this when content is pulled away from an edge by the user. This will update the state of the current visual effect and its associated animation. The host view should always [invalidate](https://developer.android.com/reference/android/view/View.html#invalidate()) if this method returns true and draw the results accordingly. Views using [EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) should favor [onPull](https://developer.android.com/reference/android/widget/EdgeEffect.html#onPull(float, float)) when the displacement of the pull point is known.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | Change in distance since the last call. Values may be 0 (no change) to 1.f (full length of the view) or negative values to express change back toward the edge reached to initiate the effect. |
| `displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)  | The displacement from the starting side of the effect of the point initiating the pull. In the case of touch this is the finger position. Values may be from 0-1.                              |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the host view should call invalidate, false if it should not. |

### onPull

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

```
java-static fun onPull(edgeEffect: EdgeEffect, deltaDistance: Float, displacement: Float): Unit
```

A view should call this when content is pulled away from an edge by the user. This will update the state of the current visual effect and its associated animation. The host view should always [invalidate](https://developer.android.com/reference/android/view/View.html#invalidate()) after call this method and draw the results accordingly.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `edgeEffect: `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) | The EdgeEffect that is attached to the view that is getting pulled away from an edge by the user.                                                                                              |
| `deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | Change in distance since the last call. Values may be 0 (no change) to 1.f (full length of the view) or negative values to express change back toward the edge reached to initiate the effect. |
| `displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The displacement from the starting side of the effect of the point initiating the pull. In the case of touch this is the finger position. Values may be from 0-1.                              |

|                                               See also                                                |
|-------------------------------------------------------------------------------------------------------|---|
| [onPull](https://developer.android.com/reference/android/widget/EdgeEffect.html#onPull(float, float)) |   |

### onPullDistance

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

```
java-static fun onPullDistance(
    edgeEffect: EdgeEffect,
    deltaDistance: Float,
    displacement: Float
): Float
```

A view should call this when content is pulled away from an edge by the user. This will update the state of the current visual effect and its associated animation. The host view should always [invalidate](https://developer.android.com/reference/android/view/View.html#invalidate()) after this and draw the results accordingly. This works similarly to [onPull](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onPull(float,float)), but returns the amount of `deltaDistance` that has been consumed. For API level 31 and above, if the [getDistance](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#getDistance(android.widget.EdgeEffect)) is currently 0 and `deltaDistance` is negative, this function will return 0 and the drawn value will remain unchanged. For API level 30 and below, this will consume all of the provided value and return `deltaDistance`. This method can be used to reverse the effect from a pull or absorb and partially consume some of a motion:  

```kotlin
    if (deltaY < 0 && EdgeEffectCompat.getDistance(edgeEffect) != 0) {
        float displacement = x / getWidth();
        float dist = deltaY / getHeight();
        float consumed = EdgeEffectCompat.onPullDistance(edgeEffect, dist, displacement);
        deltaY -= consumed * getHeight();
        if (edgeEffect.getDistance() == 0f) edgeEffect.onRelease();
    }
```  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `edgeEffect: `[EdgeEffect](https://developer.android.com/reference/android/widget/EdgeEffect.html) | EdgeEffect to use.                                                                                                                                                                             |
| `deltaDistance: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)   | Change in distance since the last call. Values may be 0 (no change) to 1.f (full length of the view) or negative values to express change back toward the edge reached to initiate the effect. |
| `displacement: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)    | The displacement from the starting side of the effect of the point initiating the pull. In the case of touch this is the finger position. Values may be from 0-1.                              |

|                                     Returns                                     |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The amount of `deltaDistance` that was consumed, a number between 0 and `deltaDistance`. |

### onRelease

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

```
fun [onRelease](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#onRelease())(): Boolean
```
| **This function is deprecated.**   
|
| Use [onRelease](https://developer.android.com/reference/android/widget/EdgeEffect.html#onRelease()) directly.

Call when the object is released after being pulled. This will begin the "decay" phase of the effect. After calling this method the host view should [invalidate](https://developer.android.com/reference/android/view/View.html#invalidate()) if this method returns true and thereby draw the results accordingly.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the host view should invalidate, false if it should not. |

### setSize

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

```
fun [setSize](https://developer.android.com/reference/kotlin/androidx/core/widget/EdgeEffectCompat#setSize(int,int))(width: Int, height: Int): Unit
```
| **This function is deprecated.**   
|
| Use [setSize](https://developer.android.com/reference/android/widget/EdgeEffect.html#setSize(int, int)) directly.

Set the size of this edge effect in pixels.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|-------------------------|
| `width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | Effect width in pixels  |
| `height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Effect height in pixels |