SandboxedSdkViewUiInfo
public final class SandboxedSdkViewUiInfo
A class representing the UI state of a SandboxedSdkView.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
boolean |
|
static final @NonNull SandboxedSdkViewUiInfo |
fromBundle(@NonNull Bundle bundle) |
final @NonNull List<@NonNull Rect> |
Returns the list of coordinate rectangles, relative to the UI container, that are obstructed. |
final @NonNull Rect |
Returns the portion of the UI container which is not clipped by parent views and is visible on screen. |
final int |
Returns the height of the UI container in pixels. |
final float |
Returns the opacity of the UI container, where available. |
final int |
Returns the width of the UI container in pixels. |
int |
hashCode() |
static final @NonNull Bundle |
toBundle(@NonNull SandboxedSdkViewUiInfo sandboxedSdkViewUiInfo) |
@NonNull String |
toString() |
Public constructors
SandboxedSdkViewUiInfo
public SandboxedSdkViewUiInfo(
int uiContainerWidth,
int uiContainerHeight,
@NonNull Rect onScreenGeometry,
float uiContainerOpacityHint,
@NonNull List<@NonNull Rect> obstructedGeometry
)
Public methods
fromBundle
public static final @NonNull SandboxedSdkViewUiInfo fromBundle(@NonNull Bundle bundle)
getObstructedGeometry
public final @NonNull List<@NonNull Rect> getObstructedGeometry()
Returns the list of coordinate rectangles, relative to the UI container, that are obstructed.
The container may be considered to be obstructed by another UI element if that UI element overlaps with the container, is displayed on top of it, and is not transparent. Ancestor views and children views will not be considered as obstructing the container. If the container's window is placed above the client window, no obstructions will be reported.
The coordinates of each obstruction in this list are relative to the UI container, and measured in pixels. The rectangles may overlap each other.
This value will only be non-empty if SandboxedUiAdapterSignalOptions.OBSTRUCTIONS is set on the SessionObserverFactory associated with the UI container's SandboxedUiAdapter. Otherwise, this will return an empty list irrespective of any obstructions on the container.
getOnScreenGeometry
public final @NonNull Rect getOnScreenGeometry()
Returns the portion of the UI container which is not clipped by parent views and is visible on screen. The coordinates of this Rect are relative to the UI container and measured in pixels.
If none of the UI container is visible on screen, each coordinate in this Rect will be -1.
getUiContainerHeight
public final int getUiContainerHeight()
Returns the height of the UI container in pixels.
getUiContainerOpacityHint
public final float getUiContainerOpacityHint()
Returns the opacity of the UI container, where available.
When available, this is a value from 0 to 1, where 0 means the container is completely transparent and 1 means the container is completely opaque. This value doesn't necessarily reflect the user-visible opacity of the UI container, as shaders and other overlays can affect that.
When the opacity is not available, the value will be -1.
getUiContainerWidth
public final int getUiContainerWidth()
Returns the width of the UI container in pixels.
toBundle
public static final @NonNull Bundle toBundle(@NonNull SandboxedSdkViewUiInfo sandboxedSdkViewUiInfo)