Udostępnij za pośrednictwem


MotionPredictor.Predict(Int64) Method

Definition

Get a predicted event for the gesture that has been provided to #record.

[Android.Runtime.Register("predict", "(J)Landroid/view/MotionEvent;", "", ApiSince=34)]
public Android.Views.MotionEvent? Predict (long predictionTimeNanos);
[<Android.Runtime.Register("predict", "(J)Landroid/view/MotionEvent;", "", ApiSince=34)>]
member this.Predict : int64 -> Android.Views.MotionEvent

Parameters

predictionTimeNanos
Int64

The time that the prediction should target, in the android.os.SystemClock#uptimeMillis time base, but in nanoseconds.

Returns

The predicted motion event, or null if predictions are not supported, or not possible for the current gesture. Be sure to check the historical data in addition to the latest (MotionEvent#getX getX(), MotionEvent#getY getY()) coordinates for smooth prediction curves.

Attributes

Remarks

Get a predicted event for the gesture that has been provided to #record. Predictions may not reach the requested timestamp if the confidence in the prediction results is low.

Java documentation for android.view.MotionPredictor.predict(long).

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