onPull

open fun onPull(@NonNull edgeEffect: EdgeEffect, deltaDistance: Float, displacement: Float)(source)

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 after call this method and draw the results accordingly.

Parameters

edgeEffect

The EdgeEffect that is attached to the view that is getting pulled away from an edge by the user.

deltaDistance

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

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


open fun onPull(deltaDistance: Float): Boolean(source)

Deprecated

Use onPull.

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 if this method returns true and draw the results accordingly.

Return

true if the host view should call invalidate, false if it should not.

Parameters

deltaDistance

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.


open fun onPull(deltaDistance: Float, displacement: Float): Boolean(source)

Deprecated

Use onPull 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 if this method returns true and draw the results accordingly. Views using EdgeEffect should favor onPull when the displacement of the pull point is known.

Return

true if the host view should call invalidate, false if it should not.

Parameters

deltaDistance

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

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.