다음을 통해 공유


InputDevice.ViewBehavior.ShouldSmoothScroll(Int32, Int32) Method

Definition

Returns whether a view should smooth scroll when scrolling due to a MotionEvent generated by the input device.

[Android.Runtime.Register("shouldSmoothScroll", "(II)Z", "", ApiSince=35)]
public bool ShouldSmoothScroll (int axis, int source);
[<Android.Runtime.Register("shouldSmoothScroll", "(II)Z", "", ApiSince=35)>]
member this.ShouldSmoothScroll : int * int -> bool

Parameters

axis
Int32

the MotionEvent axis whose value is used to get the scroll extent.

source
Int32

the InputDevice source from which the MotionEvent that triggers the scroll came.

Returns

true if smooth scrolling should be used for the scroll, or false if smooth scrolling is not necessary, or if the provided axis and source combination is not available for the input device.

Attributes

Remarks

Returns whether a view should smooth scroll when scrolling due to a MotionEvent generated by the input device.

Smooth scroll in this case refers to a scroll that animates the transition between the starting and ending positions of the scroll. When this method returns true, views should try to animate a scroll generated by this device at the given axis and with the given source to produce a good scroll user experience. If this method returns false, animating scrolls is not necessary.

If the input device does not have a MotionRange with the provided axis and source, this method returns false.

Java documentation for android.view.InputDevice.ViewBehavior.shouldSmoothScroll(int, int).

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