Share via


MotionEvent.GetRawY(Int32) Method

Definition

Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event.

[Android.Runtime.Register("getRawY", "(I)F", "", ApiSince=29)]
public float GetRawY (int pointerIndex);
[<Android.Runtime.Register("getRawY", "(I)F", "", ApiSince=29)>]
member this.GetRawY : int -> single

Parameters

pointerIndex
Int32

Index of the pointer for which the Y coordinate is returned. May be a value in the range of 0 (the first pointer that is down) to #getPointerCount() - 1.

Returns

The Y coordinate of the pointer referenced by pointerIndex for this motion event. The unit is pixels. The value may contain a fractional portion for devices that are subpixel precise.

Attributes

Remarks

Returns the Y coordinate of the pointer referenced by pointerIndex for this motion event. The coordinate is in the coordinate space of the device display, irrespective of system decorations and whether or not the system is in multi-window mode. If the app spans multiple screens in a multiple-screen environment, the coordinate space includes all of the spanned screens.

In multi-window mode, the coordinate space extends beyond the bounds of the app window to encompass the entire device screen. For example, if the motion event occurs in the lower window of split-screen mode in portrait orientation, the top edge of the screen&mdash;not the top edge of the window&mdash;is the origin from which the Y coordinate is determined.

In multiple-screen scenarios, the coordinate space can span screens. For example, if the app is spanning both screens of a dual-screen device that's rotated 90 degrees, and the motion event occurs on the lower screen, the Y coordinate is calculated from the top edge of the upper screen to the point of the motion event on the lower screen. When the app is restricted to a single screen in a multiple-screen environment, the coordinate space includes only the screen on which the app is running.

Use #getPointerId(int) to get the pointer identifier for the pointer referenced by pointerIndex.

Java documentation for android.view.MotionEvent.getRawY(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