Language

InputDevice.ViewBehavior.PrimaryDirectionalMotionAxis Property

Definition

Returns the primary directional motion axis for the input device, described as one of the MotionEvent axes.

public Android.Views.Axis PrimaryDirectionalMotionAxis { [Android.Runtime.Register("getPrimaryDirectionalMotionAxis", "()I", "", ApiSince=37)] get; }
[<get: Android.Runtime.Register("getPrimaryDirectionalMotionAxis", "()I", "", ApiSince=37)>]
member this.PrimaryDirectionalMotionAxis : Android.Views.Axis

Property Value

the primary directional motion axis given as one of the MotionEvent.Axis constants.

Attributes

Remarks

Returns the primary directional motion axis for the input device, described as one of the MotionEvent axes.

When specified, the primary directional motion axis is the axis that should be preferred for gesture handling in one dimension, like flings or swipes, even if there are other axes available. For example, a touchpad with a Y axis that is physically much larger than the X axis can specify that the Y axis is the primary directional motion axis, and therefore gestures should be interpreted along the Y axis, even though an X axis also exists.

If the input device does not have a primary directional motion axis, this method will throw an IllegalStateException, so this method should only be called if hasPrimaryDirectionalMotionAxis() returns true.

Android reference for android.view.InputDevice.ViewBehavior.getPrimaryDirectionalMotionAxis.

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