Share via


View.GetGlobalVisibleRect Method

Definition

Overloads

GetGlobalVisibleRect(Rect, Point)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

GetGlobalVisibleRect(Rect)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

GetGlobalVisibleRect(Rect, Point)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

[Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;Landroid/graphics/Point;)Z", "GetGetGlobalVisibleRect_Landroid_graphics_Rect_Landroid_graphics_Point_Handler")]
public virtual bool GetGlobalVisibleRect (Android.Graphics.Rect? r, Android.Graphics.Point? globalOffset);
[<Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;Landroid/graphics/Point;)Z", "GetGetGlobalVisibleRect_Landroid_graphics_Rect_Landroid_graphics_Point_Handler")>]
abstract member GetGlobalVisibleRect : Android.Graphics.Rect * Android.Graphics.Point -> bool
override this.GetGlobalVisibleRect : Android.Graphics.Rect * Android.Graphics.Point -> bool

Parameters

r
Rect

If the method returns true, contains the coordinates of the visible portion of this view in the coordinate space of the view's root view. If the method returns false, the contents of r are undefined.

globalOffset
Point

If the method returns true, contains the offset of the x and y coordinates of this view from the top left corner of the view's root view. If the method returns false, the contents of globalOffset are undefined. The argument can be null (see #getGlobalVisibleRect(Rect) getGlobalVisibleRect(Rect).

Returns

true if at least part of the view is visible within the root view; false if the view is completely clipped or translated out of the visible area of the root view.

Attributes

Remarks

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view. Sets globalOffset to the offset of the view's x and y coordinates from the coordinate space origin, which is the top left corner of the root view irrespective of screen decorations and system UI elements.

To convert r to coordinates relative to the top left corner of this view (without taking view rotations into account), offset r by the inverse values of globalOffset&mdash;r.offset(-globalOffset.x, -globalOffset.y)&mdash;which is equivalent to calling #getLocalVisibleRect(Rect) getLocalVisibleRect(Rect).

<b>Note:</b> Do not use this method to determine the size of a window in multi-window mode; use WindowManager#getCurrentWindowMetrics().

Java documentation for android.view.View.getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point).

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

GetGlobalVisibleRect(Rect)

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

[Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;)Z", "")]
public bool GetGlobalVisibleRect (Android.Graphics.Rect? r);
[<Android.Runtime.Register("getGlobalVisibleRect", "(Landroid/graphics/Rect;)Z", "")>]
member this.GetGlobalVisibleRect : Android.Graphics.Rect -> bool

Parameters

r
Rect

If the method returns true, contains the coordinates of the visible portion of this view in the coordinate space of the view's root view. If the method returns false, the contents of r are undefined.

Returns

true if at least part of the view is visible within the root view; otherwise false.

Attributes

Remarks

Sets r to the coordinates of the non-clipped area of this view in the coordinate space of the view's root view.

See #getGlobalVisibleRect(Rect, Point) getGlobalVisibleRect(Rect, Point) for more information.

Java documentation for android.view.View.getGlobalVisibleRect(android.graphics.Rect).

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