# DifferentialMotionFlingTarget

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

*** ** * ** ***


```
public interface DifferentialMotionFlingTarget
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract float` | `https://developer.android.com/reference/androidx/core/view/DifferentialMotionFlingTarget#getScaledScrollFactor()()` Returns the scaled scroll factor to be used for differential motions. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/core/view/DifferentialMotionFlingTarget#startDifferentialMotionFling(float)(float velocity)` Start flinging on the target View by a given velocity. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/view/DifferentialMotionFlingTarget#stopDifferentialMotionFling()()` Stop any ongoing fling on the target View that is caused by a differential motion. |

## Public methods

### getScaledScrollFactor

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

```
abstract float getScaledScrollFactor()
```

Returns the scaled scroll factor to be used for differential motions. This is the value that the raw `https://developer.android.com/reference/android/view/MotionEvent.html` values should be multiplied with to get pixels.

This usually is one of the values provided by `https://developer.android.com/reference/androidx/core/view/ViewConfigurationCompat`. It is up to the client to choose and provide any value as per its internal configuration.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/ViewConfigurationCompat#getScaledHorizontalScrollFactor(android.view.ViewConfiguration,android.content.Context)` |   |
| `https://developer.android.com/reference/androidx/core/view/ViewConfigurationCompat#getScaledVerticalScrollFactor(android.view.ViewConfiguration,android.content.Context)` |   |

### startDifferentialMotionFling

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

```
abstract boolean startDifferentialMotionFling(float velocity)
```

Start flinging on the target View by a given velocity.

| Parameters |
|---|---|
| `float velocity` | the fling velocity, in pixels/second. |

| Returns |
|---|---|
| `boolean` | `true` if fling was successfully initiated, `false` otherwise. |

### stopDifferentialMotionFling

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

```
abstract void stopDifferentialMotionFling()
```

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