DifferentialMotionFlingTarget


interface DifferentialMotionFlingTarget


Represents an entity that may be flung by a differential motion or an entity that initiates fling on a target View.

Summary

Public functions

Float

Returns the scaled scroll factor to be used for differential motions.

Boolean

Start flinging on the target View by a given velocity.

Unit

Stop any ongoing fling on the target View that is caused by a differential motion.

Public functions

getScaledScrollFactor

Added in 1.13.0
fun getScaledScrollFactor(): Float

Returns the scaled scroll factor to be used for differential motions. This is the value that the raw MotionEvent values should be multiplied with to get pixels.

This usually is one of the values provided by ViewConfigurationCompat. It is up to the client to choose and provide any value as per its internal configuration.

startDifferentialMotionFling

Added in 1.13.0
fun startDifferentialMotionFling(velocity: Float): Boolean

Start flinging on the target View by a given velocity.

Parameters
velocity: Float

the fling velocity, in pixels/second.

Returns
Boolean

true if fling was successfully initiated, false otherwise.

stopDifferentialMotionFling

Added in 1.13.0
fun stopDifferentialMotionFling(): Unit

Stop any ongoing fling on the target View that is caused by a differential motion.