Skip to content

Commit fdc8296

Browse files
committed
Update to XR alpha05 dependencies
1 parent 126752a commit fdc8296

File tree

8 files changed

+39
-38
lines changed

8 files changed

+39
-38
lines changed

xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import androidx.compose.material3.Text
2121
import androidx.compose.material3.TopAppBar
2222
import androidx.compose.runtime.Composable
2323
import androidx.compose.ui.res.stringResource
24-
import androidx.xr.compose.platform.LocalHasXrSpatialFeature
24+
import androidx.xr.compose.platform.LocalSpatialConfiguration
2525
import com.example.android.xrfundamentals.R
2626

2727
@OptIn(ExperimentalMaterial3Api::class)
@@ -30,7 +30,7 @@ import com.example.android.xrfundamentals.R
3030
title = { Text(stringResource(R.string.app_name)) },
3131
actions = {
3232
// Only show the mode toggle if the device supports spatial UI
33-
if (LocalHasXrSpatialFeature.current) {
33+
if (LocalSpatialConfiguration.current.hasXrSpatialFeature) {
3434
ToggleSpaceModeButton()
3535
}
3636
}

xr-fundamentals/part1/gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[versions]
2-
agp = "8.11.0-alpha09"
3-
kotlin = "2.1.20"
2+
agp = "8.13.0-alpha03"
3+
kotlin = "2.2.0"
44
coreKtx = "1.16.0"
55
junit = "4.13.2"
6-
junitVersion = "1.2.1"
7-
espressoCore = "3.6.1"
8-
lifecycleRuntimeKtx = "2.9.0"
6+
junitVersion = "1.3.0"
7+
espressoCore = "3.7.0"
8+
lifecycleRuntimeKtx = "2.9.2"
99
activityCompose = "1.10.1"
10-
composeBom = "2025.05.00"
10+
composeBom = "2025.07.00"
1111
composeMaterialAdaptive = "1.1.0"
12-
xrCompose = "1.0.0-alpha04"
12+
xrCompose = "1.0.0-alpha05"
1313

1414
[libraries]
1515
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }

xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/XRFundamentalsApp.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ fun XRFundamentalsApp(
115115
currentEnvironmentOptionIndex =
116116
(currentEnvironmentOptionIndex + 1) % ENVIRONMENT_OPTIONS.size
117117

118-
session.scene.spatialEnvironment.setSpatialEnvironmentPreference(
118+
session.scene.spatialEnvironment.preferredSpatialEnvironment =
119119
ENVIRONMENT_OPTIONS[currentEnvironmentOptionIndex].toSpatialEnvironmentPreference(
120120
session
121121
)
122-
)
123122
}
124123
}
125124
)

xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/environment/EnvironmentOption.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ import androidx.xr.runtime.Session
2020
import androidx.xr.scenecore.ExrImage
2121
import androidx.xr.scenecore.GltfModel
2222
import androidx.xr.scenecore.SpatialEnvironment.SpatialEnvironmentPreference
23-
import kotlinx.coroutines.guava.await
23+
import kotlin.io.path.Path
2424

2525
data class EnvironmentOption(val name: String, val skyboxPath: String?, val geometryPath: String?) {
2626
suspend fun toSpatialEnvironmentPreference(session: Session): SpatialEnvironmentPreference? {
2727
if (skyboxPath == null && geometryPath == null) {
2828
return null
2929
} else {
3030
val skybox = skyboxPath?.let {
31-
ExrImage.create(session, it).await()
31+
ExrImage.createFromZip(session, Path(it))
3232
}
3333

3434
val geometry = geometryPath?.let {
35-
GltfModel.create(session, it).await()
35+
GltfModel.create(session, Path(it))
3636
}
3737

3838
return SpatialEnvironmentPreference(skybox, geometry)

xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/EnvironmentSelectionOrbiter.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.res.painterResource
2727
import androidx.compose.ui.tooling.preview.Preview
2828
import androidx.compose.ui.unit.dp
29-
import androidx.xr.compose.spatial.EdgeOffset
29+
import androidx.xr.compose.spatial.ContentEdge
3030
import androidx.xr.compose.spatial.Orbiter
31-
import androidx.xr.compose.spatial.OrbiterEdge
31+
import androidx.xr.compose.spatial.OrbiterOffsetType
3232
import androidx.xr.compose.subspace.layout.SpatialRoundedCornerShape
3333
import com.example.android.xrfundamentals.R
3434

@@ -38,9 +38,10 @@ fun EnvironmentSelectionOrbiter(
3838
onClick: () -> Unit = {},
3939
) {
4040
Orbiter(
41-
position = OrbiterEdge.Top,
41+
position = ContentEdge.Top,
4242
alignment = Alignment.Start,
43-
offset = EdgeOffset.inner(16.dp),
43+
offset = 16.dp,
44+
offsetType = OrbiterOffsetType.InnerEdge,
4445
shape = SpatialRoundedCornerShape(
4546
CornerSize(100)
4647
)

xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import androidx.compose.runtime.Composable
2424
import androidx.compose.ui.Alignment
2525
import androidx.compose.ui.res.stringResource
2626
import androidx.compose.ui.unit.dp
27-
import androidx.xr.compose.platform.LocalHasXrSpatialFeature
28-
import androidx.xr.compose.spatial.EdgeOffset
27+
import androidx.xr.compose.platform.LocalSpatialConfiguration
28+
import androidx.xr.compose.spatial.ContentEdge
2929
import androidx.xr.compose.spatial.Orbiter
30-
import androidx.xr.compose.spatial.OrbiterEdge
30+
import androidx.xr.compose.spatial.OrbiterOffsetType
3131
import androidx.xr.compose.subspace.layout.SpatialRoundedCornerShape
3232
import com.example.android.xrfundamentals.R
3333

@@ -38,11 +38,12 @@ fun XRFundamentalsTopAppBar() {
3838
title = { Text(stringResource(R.string.app_name)) },
3939
actions = {
4040
// Only show the mode toggle if the device supports spatial UI
41-
if (LocalHasXrSpatialFeature.current) {
41+
if (LocalSpatialConfiguration.current.hasXrSpatialFeature) {
4242
Orbiter(
43-
position = OrbiterEdge.Top,
43+
position = ContentEdge.Top,
4444
alignment = Alignment.End,
45-
offset = EdgeOffset.inner(16.dp),
45+
offset = 16.dp,
46+
offsetType = OrbiterOffsetType.InnerEdge,
4647
shape = SpatialRoundedCornerShape(
4748
CornerSize(percent = 100)
4849
),

xr-fundamentals/part2/gradle/libs.versions.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[versions]
2-
agp = "8.11.0-alpha09"
3-
kotlin = "2.1.20"
2+
agp = "8.13.0-alpha03"
3+
kotlin = "2.2.0"
44
coreKtx = "1.16.0"
55
junit = "4.13.2"
6-
junitVersion = "1.2.1"
7-
espressoCore = "3.6.1"
8-
lifecycleRuntimeKtx = "2.9.0"
6+
junitVersion = "1.3.0"
7+
espressoCore = "3.7.0"
8+
lifecycleRuntimeKtx = "2.9.2"
99
activityCompose = "1.10.1"
10-
composeBom = "2025.05.00"
10+
composeBom = "2025.07.00"
1111
composeMaterialAdaptive = "1.1.0"
12-
xrCompose = "1.0.0-alpha04"
13-
xrSceneCore = "1.0.0-alpha04"
12+
xrCompose = "1.0.0-alpha05"
13+
xrSceneCore = "1.0.0-alpha05"
1414
kotlinxCoroutinesGuava = "1.10.2"
1515

1616
[libraries]

xr-fundamentals/start/gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[versions]
2-
agp = "8.11.0-alpha09"
3-
kotlin = "2.1.20"
2+
agp = "8.13.0-alpha03"
3+
kotlin = "2.2.0"
44
coreKtx = "1.16.0"
55
junit = "4.13.2"
6-
junitVersion = "1.2.1"
7-
espressoCore = "3.6.1"
8-
lifecycleRuntimeKtx = "2.9.0"
6+
junitVersion = "1.3.0"
7+
espressoCore = "3.7.0"
8+
lifecycleRuntimeKtx = "2.9.2"
99
activityCompose = "1.10.1"
10-
composeBom = "2025.05.00"
10+
composeBom = "2025.07.00"
1111
composeMaterialAdaptive = "1.1.0"
1212

1313
[libraries]

0 commit comments

Comments
 (0)