Class ViewUtil
Provides helper methods for work with View instances.
Inherited Members
Namespace:
Assembly: .dll
Syntax
public final class ViewUtil
Constructors
ViewUtil()
Declaration
public ViewUtil()
Methods
getBoundsRelativeTo(View view, View relativeTo, Rect bounds)
Gets the bounds of the View relative to other View element.
Declaration
public static boolean getBoundsRelativeTo(View view, View relativeTo, Rect bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| android.view.View | relativeTo | The other View instance to which the view is related. |
| android.graphics.Rect | bounds | The bounds of the View relative to other IHitTestable element, which is calculated in this method. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |
getBoundsRelativeTo(View view, View relativeTo, RectF bounds)
Gets the bounds of the View relative to other View element.
Declaration
public static boolean getBoundsRelativeTo(View view, View relativeTo, RectF bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| android.view.View | relativeTo | The other View instance to which the view is related. |
| android.graphics.RectF | bounds | The bounds of the View relative to other IHitTestable element, which is calculated in this method. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |
getBoundsRelativeTo(View view, IHitTestable relativeTo, Rect bounds)
Gets the bounds of the View relative to other IHitTestable element.
Declaration
public static boolean getBoundsRelativeTo(View view, IHitTestable relativeTo, Rect bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| IHitTestable | relativeTo | The other IHitTestable instance to which the view is related. |
| android.graphics.Rect | bounds | The bounds of the View relative to other IHitTestable element, which is calculated in this method. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |
getBoundsRelativeTo(View view, IHitTestable relativeTo, RectF bounds)
Gets the bounds of the View relative to other IHitTestable element.
Declaration
public static boolean getBoundsRelativeTo(View view, IHitTestable relativeTo, RectF bounds)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| IHitTestable | relativeTo | The other IHitTestable instance to which the view is related. |
| android.graphics.RectF | bounds | The bounds of the View relative to other IHitTestable element, which is calculated in this method. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |
isPointWithinBounds(View view, float x, float y)
Returns true if the point is within the bounds of the View.
Declaration
public static boolean isPointWithinBounds(View view, float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance, which bound will be used to check. |
| float | x | The x coordinate of the point to check. |
| float | y | The y coordinate of the point to check. |
Returns
| Type | Description |
|---|---|
| boolean | True if the point within bounds. Otherwise - false. |
isPointWithinBounds(View viewToCheck, float x, float y, View relativeTo)
Returns true if the point specified relative to other View element is within the bounds of the View.
Declaration
public static boolean isPointWithinBounds(View viewToCheck, float x, float y, View relativeTo)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | viewToCheck | The View instance, which bound will be used to check. |
| float | x | The x coordinate of the point to check. |
| float | y | The y coordinate of the point to check. |
| android.view.View | relativeTo | The other View instance to which the viewToCheck is related. |
Returns
| Type | Description |
|---|---|
| boolean | True if the point within bounds. Otherwise - false. |
isPointWithinBounds(View viewToCheck, float x, float y, IHitTestable relativeTo)
Returns true if the point specified relative to other IHitTestable element is within the bounds of the View.
Declaration
public static boolean isPointWithinBounds(View viewToCheck, float x, float y, IHitTestable relativeTo)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | viewToCheck | The View instance, which bound will be used to check. |
| float | x | The x coordinate of the point to check. |
| float | y | The y coordinate of the point to check. |
| IHitTestable | relativeTo | The other IHitTestable instance to which the viewToCheck is related. |
Returns
| Type | Description |
|---|---|
| boolean | True if the point within bounds. Otherwise - false. |
translatePoint(View view, PointF point, View relativeTo)
Translates points relative to other View element.
Declaration
public static boolean translatePoint(View view, PointF point, View relativeTo)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| android.graphics.PointF | point | The point which should be transformed. |
| android.view.View | relativeTo | The other View instance to use when transforming the point. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |
translatePoint(View view, PointF point, IHitTestable relativeTo)
Translates points relative to other IHitTestable element.
Declaration
public static boolean translatePoint(View view, PointF point, IHitTestable relativeTo)
Parameters
| Type | Name | Description |
|---|---|---|
| android.view.View | view | The View instance. |
| android.graphics.PointF | point | The point which should be transformed. |
| IHitTestable | relativeTo | The other IHitTestable instance to use when transforming the point. |
Returns
| Type | Description |
|---|---|
| boolean | True if the operation was successful. Otherwise - false. |