EdgeEffectCompat

SESL Variant Helper for accessing EdgeEffect. This class is used to access EdgeEffect 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.

Constructors

Link copied to clipboard
constructor(context: Context)
Construct a new EdgeEffect themed using the given context.

Functions

Link copied to clipboard
open fun create(@NonNull context: Context, @Nullable attrs: AttributeSet): EdgeEffect
Constructs and returns a new EdgeEffect themed using the given context, allowing support for the view attributes.
Link copied to clipboard
open fun draw(canvas: Canvas): Boolean
Draw into the provided canvas.
Link copied to clipboard
open fun finish()
Immediately finish the current animation.
Link copied to clipboard
open fun getDistance(@NonNull edgeEffect: EdgeEffect): Float
Returns the pull distance needed to be released to remove the showing effect.
Link copied to clipboard
open fun isFinished(): Boolean
Reports if this EdgeEffectCompat's animation is finished.
Link copied to clipboard
open fun onAbsorb(velocity: Int): Boolean
Call when the effect absorbs an impact at the given velocity.
Link copied to clipboard
open fun onPull(deltaDistance: Float): Boolean
open fun onPull(deltaDistance: Float, displacement: Float): Boolean
open fun onPull(@NonNull edgeEffect: EdgeEffect, deltaDistance: Float, displacement: Float)
A view should call this when content is pulled away from an edge by the user.
Link copied to clipboard
open fun onPullDistance(@NonNull edgeEffect: EdgeEffect, deltaDistance: Float, displacement: Float): Float
A view should call this when content is pulled away from an edge by the user.
Link copied to clipboard
open fun onRelease(): Boolean
Call when the object is released after being pulled.
Link copied to clipboard
open fun setSize(width: Int, height: Int)
Set the size of this edge effect in pixels.