|
| 1 | +/* |
| 2 | + * Copyright 2025 The Android Open Source Project |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.example.xr.compose |
| 18 | + |
| 19 | +import androidx.compose.runtime.Composable |
| 20 | +import androidx.compose.ui.unit.dp |
| 21 | +import androidx.xr.compose.subspace.SpatialPanel |
| 22 | +import androidx.xr.compose.subspace.SpatialRow |
| 23 | +import androidx.xr.compose.subspace.layout.SubspaceModifier |
| 24 | +import androidx.xr.compose.subspace.layout.height |
| 25 | +import androidx.xr.compose.subspace.layout.width |
| 26 | + |
| 27 | +@Composable |
| 28 | +private fun SpatialRowExample() { |
| 29 | + // [START androidxr_compose_SpatialRowExample] |
| 30 | + SpatialRow(curveRadius = 825.dp) { |
| 31 | + SpatialPanel( |
| 32 | + SubspaceModifier |
| 33 | + .width(384.dp) |
| 34 | + .height(592.dp) |
| 35 | + ) { |
| 36 | + StartSupportingPanelContent() |
| 37 | + } |
| 38 | + SpatialPanel( |
| 39 | + SubspaceModifier |
| 40 | + .height(824.dp) |
| 41 | + .width(1400.dp) |
| 42 | + ) { |
| 43 | + App() |
| 44 | + } |
| 45 | + SpatialPanel( |
| 46 | + SubspaceModifier |
| 47 | + .width(288.dp) |
| 48 | + .height(480.dp) |
| 49 | + ) { |
| 50 | + EndSupportingPanelContent() |
| 51 | + } |
| 52 | + } |
| 53 | + // [END androidxr_compose_SpatialRowExample] |
| 54 | +} |
| 55 | + |
| 56 | +@Composable |
| 57 | +private fun App() { } |
| 58 | + |
| 59 | +@Composable |
| 60 | +private fun EndSupportingPanelContent() { } |
| 61 | + |
| 62 | +@Composable |
| 63 | +private fun StartSupportingPanelContent() { } |
0 commit comments