BasePanelEntity


public sealed class BasePanelEntity<RtPanelEntityType extends JxrPlatformAdapter.PanelEntity> extends BaseEntity

Known direct subclasses
PanelEntity

PanelEntity creates a spatial panel in Android XR.

Known indirect subclasses
ActivityPanelEntity

ActivityPanelEntity creates a spatial panel for embedding an Activity in Android XR.


Provides implementations for common Panel functionality.

Summary

Protected constructors

<RtPanelEntityType extends JxrPlatformAdapter.PanelEntity> BasePanelEntity(
    @NonNull RtPanelEntityType rtPanelEntity,
    @NonNull EntityManager entityManager
)

Public methods

final float

Gets the corner radius of this PanelEntity in meters.

final @NonNull Vector3

Gets the number of pixels per meter for this panel.

final @NonNull PixelDimensions

Returns the dimensions of the view underlying this PanelEntity.

@NonNull Dimensions

Returns the spatial size of this Panel in meters.

final void
setCornerRadius(float radius)

Sets the corner radius of the PanelEntity.

final void

Sets the pixel (not Dp) dimensions of the view underlying this PanelEntity.

Inherited methods

From androidx.xr.scenecore.ActivityPose
abstract @NonNull Pose

Returns the activity space pose for this ActivityPose.

abstract @NonNull Pose

Returns a pose relative to this ActivityPose transformed into a pose relative to the destination.

From androidx.xr.scenecore.BaseEntity
void

Sets an Entity to be represented in this coordinate space.

boolean

Adds a Component to this Entity.

void

Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children.

float

Returns the global alpha of this entity computed by multiplying the parent's global alpha to this entity's local alpha.

float

Returns the alpha transparency set for this Entity.

@NonNull List<@NonNull Component>

Retrieves all components attached to this Entity.

@NonNull List<@NonNull T>

Retrieves all Components of the given type T and its sub-types attached to this Entity.

Entity

Returns the parent of this Entity.

@NonNull Pose

Returns the pose for this entity, relative to its parent.

float

Returns the local scale of this entity, not inclusive of the parent's scale.

float

Returns the accumulated scale of this Entity.

boolean
isHidden(boolean includeParents)

Returns the hidden status of this Entity.

void

Remove all components from this Entity.

void

Removes the given Component from this Entity.

void
setAlpha(float alpha)

Sets the alpha transparency of the Entity and its children.

void

Sets alternate text for this entity to be consumed by Accessibility systems.

void
setHidden(boolean hidden)

Sets the local hidden state of this Entity.

void
setParent(Entity parent)

Sets this Entity to be represented in the parent's coordinate space.

void

Sets the pose for this Entity, relative to its parent.

void
setScale(float scale)

Sets the scale of this entity relative to its parent.

void
setSize(@NonNull Dimensions dimensions)

Sets the dimensions in pixels for the Entity.

Protected constructors

BasePanelEntity

protected <RtPanelEntityType extends JxrPlatformAdapter.PanelEntity> BasePanelEntity(
    @NonNull RtPanelEntityType rtPanelEntity,
    @NonNull EntityManager entityManager
)

Public methods

getCornerRadius

Added in 1.0.0-alpha01
public final float getCornerRadius()

Gets the corner radius of this PanelEntity in meters. Has a default value of 0.

getPixelDensity

Added in 1.0.0-alpha01
public final @NonNull Vector3 getPixelDensity()

Gets the number of pixels per meter for this panel. This value reflects changes to scale, including parent scale.

Returns
@NonNull Vector3

Vector3 scale applied to pixels within the Panel. (Z will be 0)

getPixelDimensions

Added in 1.0.0-alpha01
public final @NonNull PixelDimensions getPixelDimensions()

Returns the dimensions of the view underlying this PanelEntity.

Returns
@NonNull PixelDimensions

The current (width, height) of the underlying surface in pixels.

getSize

public @NonNull Dimensions getSize()

Returns the spatial size of this Panel in meters. This includes any scaling applied to this panel by itself or its parents, which might be set via changes to setScale.

Returns
@NonNull Dimensions

Dimensions size of this panel in meters. (Z will be 0)

setCornerRadius

Added in 1.0.0-alpha01
public final void setCornerRadius(float radius)

Sets the corner radius of the PanelEntity.

Parameters
float radius

The radius of the corners, in meters.

Throws
kotlin.IllegalArgumentException

if radius is <= 0.0f.

setPixelDimensions

Added in 1.0.0-alpha01
public final void setPixelDimensions(@NonNull PixelDimensions pxDimensions)

Sets the pixel (not Dp) dimensions of the view underlying this PanelEntity. Calling this might cause the layout of the Panel contents to change. Updating this will not cause the scale or pixel density to change.

Parameters
@NonNull PixelDimensions pxDimensions

The PixelDimensions of the underlying surface to set.