IsdkPanelResize component enables resize functionality with automatic handle generation.| Requirement | Details |
|---|---|
Spatial SDK | v0.9.0 or later |
Android Studio | Hedgehog or later |
Knowledge | |
Target device | Meta Quest 3/3S |
ImmersiveActivity.kt, add these imports.import com.meta.spatial.isdk.IsdkPanelResize import com.meta.spatial.core.Vector2 import com.meta.spatial.isdk.ResizeMode
registerPanels(), add the IsdkPanelResize component to ComposeViewPanelRegistration() to make the Compose panel resizable.ComposeViewPanelRegistration(
R.id.options_panel,
composeViewCreator = { _, context ->
ComposeView(context).apply { setContent { OptionsPanel(::playVideo) } }
},
settingsCreator = {
UIPanelSettings(
shape =
QuadShapeOptions(width = OPTIONS_PANEL_WIDTH, height = OPTIONS_PANEL_HEIGHT),
style = PanelStyleOptions(themeResourceId = R.style.PanelAppThemeTransparent),
display = DpPerMeterDisplayOptions(),
)
},
IsdkPanelResize( // Add this line
enabled = true, // Add this line
) // Add this line
),
IsdkPanelResize is enabled, the system automatically adds IsdkPanelGrabHandle, which provides interactive colliders for edges and corners.resizeMode property inside IsdkPanelResize from the previous step.IsdkPanelResize(
enabled = true,
resizeMode = ResizeMode.Relayout, // Add this line
)
resizeMode determines how resizing affects the panel.| Mode | Behavior | Best for |
|---|---|---|
ResizeMode.Simple | Modifies entity scale; content scales proportionally | Static content, images |
ResizeMode.Relayout | Adjusts panel dimensions and re-renders UI at new resolution | Dynamic UI, text, interactive elements |
ResizeMode.None | Handles visible but non-functional; use for custom logic | Custom resize implementations |
ResizeMode.None, the resize handles appear but no automatic resize occurs. Monitor the activeResizeCorner property to track which corner is being manipulated, then implement your own resize logic using an InputListener component.minDimensions and maxDimensions to constrain the panel size (values in meters).IsdkPanelResize(
enabled = true,
resizeMode = ResizeMode.Relayout,
minDimensions = Vector2(0.5f, 0.3f), // Add this line
maxDimensions = Vector2(3.0f, 2.0f), // Add this line
)
preserveAspectRatio to maintain the panel’s width-to-height ratio during resize.IsdkPanelResize(
enabled = true,
resizeMode = ResizeMode.Relayout,
minDimensions = Vector2(0.5f, 0.3f),
maxDimensions = Vector2(3.0f, 2.0f),
preserveAspectRatio = true, // Add this line
)
IsdkGrabbable component.IsdkPanelResize(
enabled = true,
resizeMode = ResizeMode.Relayout,
minDimensions = Vector2(0.5f, 0.3f),
maxDimensions = Vector2(3.0f, 2.0f),
preserveAspectRatio = true,
),
IsdkGrabbable(enabled = true) // Add this line
IsdkPanelResize and IsdkGrabbable components allow users to both move and resize them. The system automatically distinguishes between grab handles (for moving) and resize handles (for resizing).| Issue | Solution |
|---|---|
Resize handles not visible | Verify VRFeature is registered in registerFeatures() |
Resize not working | Check that enabled = true and resizeMode is not None |
Panel resizes beyond bounds | Set minDimensions and maxDimensions constraints |