Compartir a través de


VelocityTracker.ComputeCurrentVelocity Method

Definition

Overloads

ComputeCurrentVelocity(Int32)

Equivalent to invoking #computeCurrentVelocity(int, float) with a maximum velocity of Float.

ComputeCurrentVelocity(Int32, Single)

Compute the current velocity based on the points that have been collected.

ComputeCurrentVelocity(Int32)

Equivalent to invoking #computeCurrentVelocity(int, float) with a maximum velocity of Float.

[Android.Runtime.Register("computeCurrentVelocity", "(I)V", "")]
public void ComputeCurrentVelocity (int units);
[<Android.Runtime.Register("computeCurrentVelocity", "(I)V", "")>]
member this.ComputeCurrentVelocity : int -> unit

Parameters

units
Int32
Attributes

Remarks

Equivalent to invoking #computeCurrentVelocity(int, float) with a maximum velocity of Float.MAX_VALUE.

Java documentation for android.view.VelocityTracker.computeCurrentVelocity(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.

See also

  • <xref:Android.Views.VelocityTracker.ComputeCurrentVelocity(System.Int32%2c+System.Single)>

Applies to

ComputeCurrentVelocity(Int32, Single)

Compute the current velocity based on the points that have been collected.

[Android.Runtime.Register("computeCurrentVelocity", "(IF)V", "")]
public void ComputeCurrentVelocity (int units, float maxVelocity);
[<Android.Runtime.Register("computeCurrentVelocity", "(IF)V", "")>]
member this.ComputeCurrentVelocity : int * single -> unit

Parameters

units
Int32

The units you would like the velocity in. A value of 1 provides units per millisecond, 1000 provides units per second, etc. Note that the units referred to here are the same units with which motion is reported. For axes X and Y, the units are pixels.

maxVelocity
Single

The maximum velocity that can be computed by this method. This value must be declared in the same unit as the units parameter. This value must be positive.

Attributes

Remarks

Compute the current velocity based on the points that have been collected. Only call this when you actually want to retrieve velocity information, as it is relatively expensive. You can then retrieve the velocity with #getXVelocity() and #getYVelocity().

Java documentation for android.view.VelocityTracker.computeCurrentVelocity(int, 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