Compartilhar via


IViewParent.OnNestedPreFling(View, Single, Single) Method

Definition

React to a nested fling before the target view consumes it.

[Android.Runtime.Register("onNestedPreFling", "(Landroid/view/View;FF)Z", "GetOnNestedPreFling_Landroid_view_View_FFHandler:Android.Views.IViewParentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool OnNestedPreFling (Android.Views.View target, float velocityX, float velocityY);
[<Android.Runtime.Register("onNestedPreFling", "(Landroid/view/View;FF)Z", "GetOnNestedPreFling_Landroid_view_View_FFHandler:Android.Views.IViewParentInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnNestedPreFling : Android.Views.View * single * single -> bool

Parameters

target
View

View that initiated the nested scroll

velocityX
Single

Horizontal velocity in pixels per second

velocityY
Single

Vertical velocity in pixels per second

Returns

true if this parent consumed the fling ahead of the target view

Attributes

Remarks

React to a nested fling before the target view consumes it.

This method siginfies that a nested scrolling child has detected a fling with the given velocity along each axis. Generally this means that a touch scroll has ended with a VelocityTracker velocity in the direction of scrolling that meets or exceeds the ViewConfiguration#getScaledMinimumFlingVelocity() minimum fling velocity along a scrollable axis.

If a nested scrolling parent is consuming motion as part of a #onNestedPreScroll(View, int, int, int[]) pre-scroll, it may be appropriate for it to also consume the pre-fling to complete that same motion. By returning true from this method, the parent indicates that the child should not fling its own internal content as well.

Java documentation for android.view.ViewParent.onNestedPreFling(android.view.View, float, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to