diff --git a/xr-fundamentals/part1/app/build.gradle.kts b/xr-fundamentals/part1/app/build.gradle.kts
index ee5693c..3b73558 100644
--- a/xr-fundamentals/part1/app/build.gradle.kts
+++ b/xr-fundamentals/part1/app/build.gradle.kts
@@ -16,18 +16,17 @@
plugins {
alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.android.xrfundamentals"
- compileSdk = 36
+ compileSdk = 37
defaultConfig {
applicationId = "com.example.android.xrfundamentals"
minSdk = 34
- targetSdk = 36
+ targetSdk = 37
versionCode = 1
versionName = "1.0"
@@ -47,9 +46,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
- kotlinOptions {
- jvmTarget = "11"
- }
buildFeatures {
compose = true
}
diff --git a/xr-fundamentals/part1/app/src/main/AndroidManifest.xml b/xr-fundamentals/part1/app/src/main/AndroidManifest.xml
index f369b84..b6aaa59 100644
--- a/xr-fundamentals/part1/app/src/main/AndroidManifest.xml
+++ b/xr-fundamentals/part1/app/src/main/AndroidManifest.xml
@@ -19,7 +19,6 @@
Unit,
+ onFullSpaceRequested: () -> Unit,
) {
Scaffold(
- topBar = { XRFundamentalsTopAppBar() }
+ topBar = { XRFundamentalsTopAppBar(onHomeSpaceRequested, onFullSpaceRequested) }
) { innerPadding ->
val modifier = Modifier
.padding(innerPadding)
.fillMaxSize()
-
- if (windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.COMPACT) {
- CompactLayout(
- modifier = modifier,
- primaryContent = {
- PrimaryCard()
- },
- secondaryContent = {
- SecondaryCardList()
- }
- )
- } else {
+ val isExpanded = windowSizeClass.isWidthAtLeastBreakpoint(
+ WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND
+ )
+ if (isExpanded) {
ExpandedLayout(
modifier = modifier,
primaryContent = {
@@ -80,6 +72,16 @@ fun XRFundamentalsApp(
)
}
)
+ } else {
+ CompactLayout(
+ modifier = modifier,
+ primaryContent = {
+ PrimaryCard()
+ },
+ secondaryContent = {
+ SecondaryCardList()
+ }
+ )
}
}
Subspace {
@@ -92,7 +94,7 @@ fun XRFundamentalsApp(
.height(800.dp)
) {
Scaffold(
- topBar = { XRFundamentalsTopAppBar() }
+ topBar = { XRFundamentalsTopAppBar(onHomeSpaceRequested, onFullSpaceRequested) }
) { innerPadding ->
Box(Modifier.padding(innerPadding)) {
PrimaryCard(
@@ -106,8 +108,9 @@ fun XRFundamentalsApp(
SpatialPanel(
modifier = SubspaceModifier
.width(340.dp)
- .height(800.dp),
- dragPolicy = MovePolicy()
+ .height(800.dp)
+ .movable()
+ .resizable(),
) {
Surface {
SecondaryCardList(
diff --git a/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt b/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
similarity index 69%
rename from xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt
rename to xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
index f169237..800b69f 100644
--- a/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt
+++ b/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
@@ -24,33 +24,34 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.xr.compose.platform.LocalSpatialCapabilities
-import androidx.xr.compose.platform.LocalSpatialConfiguration
import com.example.android.xrfundamentals.R
import com.example.android.xrfundamentals.ui.theme.XRFundamentalsTheme
@Composable
-fun ToggleSpaceModeButton(modifier: Modifier = Modifier) {
- val spatialConfiguration = LocalSpatialConfiguration.current
-
+fun ToggleSpaceButton(
+ onHomeSpaceRequested: () -> Unit,
+ onFullSpaceRequested: () -> Unit,
+ modifier: Modifier = Modifier
+) {
if (LocalSpatialCapabilities.current.isSpatialUiEnabled) {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
modifier = modifier,
- contentDescription = "Request Home Space mode",
- iconResource = R.drawable.ic_home_space_mode,
- onClick = { spatialConfiguration.requestHomeSpaceMode() }
+ contentDescription = "Request Home Space",
+ iconResource = R.drawable.ic_home_space,
+ onClick = { onHomeSpaceRequested() }
)
} else {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
modifier = modifier,
- contentDescription = "Request Full Space mode",
- iconResource = R.drawable.ic_full_space_mode,
- onClick = { spatialConfiguration.requestFullSpaceMode() }
+ contentDescription = "Request Full Space",
+ iconResource = R.drawable.ic_full_space,
+ onClick = { onFullSpaceRequested() }
)
}
}
@Composable
-fun ToggleSpaceModeButton(
+fun ToggleSpaceButton(
contentDescription: String,
@DrawableRes iconResource: Int,
onClick: () -> Unit,
@@ -69,11 +70,11 @@ fun ToggleSpaceModeButton(
@Preview
@Composable
-fun ToggleSpaceModeButtonPreview() {
+fun ToggleSpaceButtonPreview() {
XRFundamentalsTheme {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
"Preview",
- R.drawable.ic_full_space_mode,
+ R.drawable.ic_full_space,
onClick = {}
)
}
diff --git a/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt b/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
index 0155401..3c461ee 100644
--- a/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
+++ b/xr-fundamentals/part1/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
@@ -25,13 +25,17 @@ import androidx.xr.compose.platform.LocalSpatialConfiguration
import com.example.android.xrfundamentals.R
@OptIn(ExperimentalMaterial3Api::class)
-@Composable fun XRFundamentalsTopAppBar() {
+@Composable
+fun XRFundamentalsTopAppBar(
+ onHomeSpaceRequested: () -> Unit,
+ onFullSpaceRequested: () -> Unit,
+) {
TopAppBar(
title = { Text(stringResource(R.string.app_name)) },
actions = {
- // Only show the mode toggle if the device supports spatial UI
+ // Only show the space toggle if the device supports spatial UI
if (LocalSpatialConfiguration.current.hasXrSpatialFeature) {
- ToggleSpaceModeButton()
+ ToggleSpaceButton(onHomeSpaceRequested, onFullSpaceRequested)
}
}
)
diff --git a/xr-fundamentals/part1/app/src/main/res/drawable/ic_full_space_mode.xml b/xr-fundamentals/part1/app/src/main/res/drawable/ic_full_space.xml
similarity index 100%
rename from xr-fundamentals/part1/app/src/main/res/drawable/ic_full_space_mode.xml
rename to xr-fundamentals/part1/app/src/main/res/drawable/ic_full_space.xml
diff --git a/xr-fundamentals/part1/app/src/main/res/drawable/ic_home_space_mode.xml b/xr-fundamentals/part1/app/src/main/res/drawable/ic_home_space.xml
similarity index 100%
rename from xr-fundamentals/part1/app/src/main/res/drawable/ic_home_space_mode.xml
rename to xr-fundamentals/part1/app/src/main/res/drawable/ic_home_space.xml
diff --git a/xr-fundamentals/part1/build.gradle.kts b/xr-fundamentals/part1/build.gradle.kts
index c96f8b5..5c5c50b 100644
--- a/xr-fundamentals/part1/build.gradle.kts
+++ b/xr-fundamentals/part1/build.gradle.kts
@@ -17,6 +17,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
- alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
\ No newline at end of file
diff --git a/xr-fundamentals/part1/gradle.properties b/xr-fundamentals/part1/gradle.properties
index 20e2a01..c4a6b75 100644
--- a/xr-fundamentals/part1/gradle.properties
+++ b/xr-fundamentals/part1/gradle.properties
@@ -20,4 +20,12 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
\ No newline at end of file
+android.nonTransitiveRClass=true
+android.defaults.buildfeatures.resvalues=true
+android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
+android.enableAppCompileTimeRClass=false
+android.usesSdkInManifest.disallowed=false
+android.uniquePackageNames=false
+android.dependency.useConstraints=true
+android.r8.strictFullModeForKeepRules=false
+android.r8.optimizedResourceShrinking=false
\ No newline at end of file
diff --git a/xr-fundamentals/part1/gradle/gradle-daemon-jvm.properties b/xr-fundamentals/part1/gradle/gradle-daemon-jvm.properties
new file mode 100644
index 0000000..5c34300
--- /dev/null
+++ b/xr-fundamentals/part1/gradle/gradle-daemon-jvm.properties
@@ -0,0 +1,13 @@
+#This file is generated by updateDaemonJvm
+toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
+toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/04e088f8677de3b384108493cc9481d0/redirect
+toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e55dccbfe27cb97945148c61a39c89c5/redirect
+toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/dbd05c4936d573642f94cd149e1356c8/redirect
+toolchainVendor=JETBRAINS
+toolchainVersion=21
diff --git a/xr-fundamentals/part1/gradle/libs.versions.toml b/xr-fundamentals/part1/gradle/libs.versions.toml
index 782070e..d601f3e 100644
--- a/xr-fundamentals/part1/gradle/libs.versions.toml
+++ b/xr-fundamentals/part1/gradle/libs.versions.toml
@@ -1,15 +1,15 @@
[versions]
-agp = "8.13.0"
-kotlin = "2.2.20"
-coreKtx = "1.17.0"
+agp = "9.2.1"
+kotlin = "2.3.21"
+coreKtx = "1.18.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
-lifecycleRuntimeKtx = "2.9.4"
-activityCompose = "1.11.0"
-composeBom = "2025.10.00"
-composeMaterialAdaptive = "1.1.0"
-xrCompose = "1.0.0-alpha07"
+lifecycleRuntimeKtx = "2.10.0"
+activityCompose = "1.13.0"
+composeBom = "2026.05.00"
+composeMaterialAdaptive = "1.2.0"
+xrCompose = "1.0.0-alpha13"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -31,6 +31,5 @@ androidx-xr-compose = { group = "androidx.xr.compose", name = "compose", version
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
diff --git a/xr-fundamentals/part1/gradle/wrapper/gradle-wrapper.properties b/xr-fundamentals/part1/gradle/wrapper/gradle-wrapper.properties
index 3e49f77..9cdc728 100644
--- a/xr-fundamentals/part1/gradle/wrapper/gradle-wrapper.properties
+++ b/xr-fundamentals/part1/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Nov 21 11:45:08 EST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/xr-fundamentals/part2/app/build.gradle.kts b/xr-fundamentals/part2/app/build.gradle.kts
index 4a4c01c..195d46d 100644
--- a/xr-fundamentals/part2/app/build.gradle.kts
+++ b/xr-fundamentals/part2/app/build.gradle.kts
@@ -16,18 +16,17 @@
plugins {
alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.android.xrfundamentals"
- compileSdk = 36
+ compileSdk = 37
defaultConfig {
applicationId = "com.example.android.xrfundamentals"
minSdk = 34
- targetSdk = 36
+ targetSdk = 37
versionCode = 1
versionName = "1.0"
@@ -47,9 +46,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
- kotlinOptions {
- jvmTarget = "11"
- }
buildFeatures {
compose = true
}
diff --git a/xr-fundamentals/part2/app/src/main/AndroidManifest.xml b/xr-fundamentals/part2/app/src/main/AndroidManifest.xml
index f369b84..b6aaa59 100644
--- a/xr-fundamentals/part2/app/src/main/AndroidManifest.xml
+++ b/xr-fundamentals/part2/app/src/main/AndroidManifest.xml
@@ -19,7 +19,6 @@
Unit,
+ onFullSpaceRequested: () -> Unit,
) {
Scaffold(
- topBar = { XRFundamentalsTopAppBar() }
+ topBar = { XRFundamentalsTopAppBar(onHomeSpaceRequested, onFullSpaceRequested) }
) { innerPadding ->
val modifier = Modifier
.padding(innerPadding)
.fillMaxSize()
- if (windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.COMPACT) {
- CompactLayout(
- modifier = modifier,
- primaryContent = {
- PrimaryCard()
- },
- secondaryContent = {
- SecondaryCardList()
- }
- )
- } else {
+ val isExpanded = windowSizeClass.isWidthAtLeastBreakpoint(
+ WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND
+ )
+
+ if (isExpanded) {
ExpandedLayout(
modifier = modifier,
primaryContent = {
@@ -89,10 +86,20 @@ fun XRFundamentalsApp(
)
}
)
+ } else {
+ CompactLayout(
+ modifier = modifier,
+ primaryContent = {
+ PrimaryCard()
+ },
+ secondaryContent = {
+ SecondaryCardList()
+ }
+ )
}
}
- var currentEnvironmentOptionIndex by remember { mutableStateOf(0) }
+ var currentEnvironmentOptionIndex by remember { mutableIntStateOf(0) }
Subspace {
val session = checkNotNull(LocalSession.current)
val scope = rememberCoroutineScope()
@@ -125,7 +132,7 @@ fun XRFundamentalsApp(
}
Scaffold(
- topBar = { XRFundamentalsTopAppBar() }
+ topBar = { XRFundamentalsTopAppBar(onHomeSpaceRequested, onFullSpaceRequested) }
) { innerPadding ->
Box(Modifier.padding(innerPadding)) {
PrimaryCard(
@@ -140,6 +147,8 @@ fun XRFundamentalsApp(
modifier = SubspaceModifier
.width(340.dp)
.height(800.dp)
+ .movable()
+ .resizable(),
) {
Surface {
SecondaryCardList(
diff --git a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/environment/EnvironmentOption.kt b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/environment/EnvironmentOption.kt
index 01cf7b5..c18ba11 100644
--- a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/environment/EnvironmentOption.kt
+++ b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/environment/EnvironmentOption.kt
@@ -42,5 +42,5 @@ data class EnvironmentOption(val name: String, val skyboxPath: String?, val geom
val ENVIRONMENT_OPTIONS = listOf(
EnvironmentOption("Default", null, null),
- EnvironmentOption("Green Hills", null, "green_hills_ktx2_mipmap.glb")
+ EnvironmentOption("Green Hills", "green_hills_ibl.zip", "green_hills_ktx2_mipmap.glb")
)
\ No newline at end of file
diff --git a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/EnvironmentSelectionOrbiter.kt b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/EnvironmentSelectionOrbiter.kt
index 8376f44..0ffc470 100644
--- a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/EnvironmentSelectionOrbiter.kt
+++ b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/EnvironmentSelectionOrbiter.kt
@@ -32,6 +32,10 @@ import androidx.xr.compose.spatial.OrbiterOffsetType
import androidx.xr.compose.subspace.layout.SpatialRoundedCornerShape
import com.example.android.xrfundamentals.R
+// The Orbiter API is pending additional changes, we recommend suppressing the deprecation notices.
+// See the Jetpack Compose for XR release notes for more details at:
+// https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-alpha13
+@Suppress("DEPRECATION")
@Composable
fun EnvironmentSelectionOrbiter(
modifier: Modifier = Modifier,
diff --git a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
similarity index 69%
rename from xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt
rename to xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
index f169237..800b69f 100644
--- a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceModeButton.kt
+++ b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/ToggleSpaceButton.kt
@@ -24,33 +24,34 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.xr.compose.platform.LocalSpatialCapabilities
-import androidx.xr.compose.platform.LocalSpatialConfiguration
import com.example.android.xrfundamentals.R
import com.example.android.xrfundamentals.ui.theme.XRFundamentalsTheme
@Composable
-fun ToggleSpaceModeButton(modifier: Modifier = Modifier) {
- val spatialConfiguration = LocalSpatialConfiguration.current
-
+fun ToggleSpaceButton(
+ onHomeSpaceRequested: () -> Unit,
+ onFullSpaceRequested: () -> Unit,
+ modifier: Modifier = Modifier
+) {
if (LocalSpatialCapabilities.current.isSpatialUiEnabled) {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
modifier = modifier,
- contentDescription = "Request Home Space mode",
- iconResource = R.drawable.ic_home_space_mode,
- onClick = { spatialConfiguration.requestHomeSpaceMode() }
+ contentDescription = "Request Home Space",
+ iconResource = R.drawable.ic_home_space,
+ onClick = { onHomeSpaceRequested() }
)
} else {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
modifier = modifier,
- contentDescription = "Request Full Space mode",
- iconResource = R.drawable.ic_full_space_mode,
- onClick = { spatialConfiguration.requestFullSpaceMode() }
+ contentDescription = "Request Full Space",
+ iconResource = R.drawable.ic_full_space,
+ onClick = { onFullSpaceRequested() }
)
}
}
@Composable
-fun ToggleSpaceModeButton(
+fun ToggleSpaceButton(
contentDescription: String,
@DrawableRes iconResource: Int,
onClick: () -> Unit,
@@ -69,11 +70,11 @@ fun ToggleSpaceModeButton(
@Preview
@Composable
-fun ToggleSpaceModeButtonPreview() {
+fun ToggleSpaceButtonPreview() {
XRFundamentalsTheme {
- ToggleSpaceModeButton(
+ ToggleSpaceButton(
"Preview",
- R.drawable.ic_full_space_mode,
+ R.drawable.ic_full_space,
onClick = {}
)
}
diff --git a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
index da26877..2850b76 100644
--- a/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
+++ b/xr-fundamentals/part2/app/src/main/java/com/example/android/xrfundamentals/ui/component/XRFundamentalsTopAppBar.kt
@@ -31,13 +31,20 @@ import androidx.xr.compose.spatial.OrbiterOffsetType
import androidx.xr.compose.subspace.layout.SpatialRoundedCornerShape
import com.example.android.xrfundamentals.R
+// The Orbiter API is pending additional changes, we recommend suppressing the deprecation notices.
+// See the Jetpack Compose for XR release notes for more details at:
+// https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-alpha13
+@Suppress("DEPRECATION")
@OptIn(ExperimentalMaterial3Api::class)
@Composable
-fun XRFundamentalsTopAppBar() {
+fun XRFundamentalsTopAppBar(
+ onHomeSpaceRequested: () -> Unit,
+ onFullSpaceRequested: () -> Unit,
+) {
TopAppBar(
title = { Text(stringResource(R.string.app_name)) },
actions = {
- // Only show the mode toggle if the device supports spatial UI
+ // Only show the space toggle if the device supports spatial UI
if (LocalSpatialConfiguration.current.hasXrSpatialFeature) {
Orbiter(
position = ContentEdge.Top,
@@ -48,7 +55,7 @@ fun XRFundamentalsTopAppBar() {
CornerSize(percent = 100)
),
) {
- ToggleSpaceModeButton()
+ ToggleSpaceButton(onHomeSpaceRequested, onFullSpaceRequested)
}
}
}
diff --git a/xr-fundamentals/part2/app/src/main/res/drawable/ic_full_space_mode.xml b/xr-fundamentals/part2/app/src/main/res/drawable/ic_full_space.xml
similarity index 100%
rename from xr-fundamentals/part2/app/src/main/res/drawable/ic_full_space_mode.xml
rename to xr-fundamentals/part2/app/src/main/res/drawable/ic_full_space.xml
diff --git a/xr-fundamentals/part2/app/src/main/res/drawable/ic_home_space_mode.xml b/xr-fundamentals/part2/app/src/main/res/drawable/ic_home_space.xml
similarity index 100%
rename from xr-fundamentals/part2/app/src/main/res/drawable/ic_home_space_mode.xml
rename to xr-fundamentals/part2/app/src/main/res/drawable/ic_home_space.xml
diff --git a/xr-fundamentals/part2/build.gradle.kts b/xr-fundamentals/part2/build.gradle.kts
index c96f8b5..5c5c50b 100644
--- a/xr-fundamentals/part2/build.gradle.kts
+++ b/xr-fundamentals/part2/build.gradle.kts
@@ -17,6 +17,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
- alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
}
\ No newline at end of file
diff --git a/xr-fundamentals/part2/gradle.properties b/xr-fundamentals/part2/gradle.properties
index 20e2a01..afb8afd 100644
--- a/xr-fundamentals/part2/gradle.properties
+++ b/xr-fundamentals/part2/gradle.properties
@@ -20,4 +20,12 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
-android.nonTransitiveRClass=true
\ No newline at end of file
+android.nonTransitiveRClass=true
+android.defaults.buildfeatures.resvalues=true
+android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
+android.enableAppCompileTimeRClass=false
+android.usesSdkInManifest.disallowed=false
+android.uniquePackageNames=false
+android.dependency.useConstraints=true
+android.r8.strictFullModeForKeepRules=false
+android.r8.optimizedResourceShrinking=false
diff --git a/xr-fundamentals/part2/gradle/gradle-daemon-jvm.properties b/xr-fundamentals/part2/gradle/gradle-daemon-jvm.properties
new file mode 100644
index 0000000..5c34300
--- /dev/null
+++ b/xr-fundamentals/part2/gradle/gradle-daemon-jvm.properties
@@ -0,0 +1,13 @@
+#This file is generated by updateDaemonJvm
+toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
+toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/04e088f8677de3b384108493cc9481d0/redirect
+toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
+toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
+toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e55dccbfe27cb97945148c61a39c89c5/redirect
+toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/dbd05c4936d573642f94cd149e1356c8/redirect
+toolchainVendor=JETBRAINS
+toolchainVersion=21
diff --git a/xr-fundamentals/part2/gradle/libs.versions.toml b/xr-fundamentals/part2/gradle/libs.versions.toml
index 7aa1a65..19f4c4b 100644
--- a/xr-fundamentals/part2/gradle/libs.versions.toml
+++ b/xr-fundamentals/part2/gradle/libs.versions.toml
@@ -1,16 +1,16 @@
[versions]
-agp = "8.13.0"
-kotlin = "2.2.20"
-coreKtx = "1.17.0"
+agp = "9.2.1"
+kotlin = "2.3.21"
+coreKtx = "1.18.0"
junit = "4.13.2"
junitVersion = "1.3.0"
espressoCore = "3.7.0"
-lifecycleRuntimeKtx = "2.9.4"
-activityCompose = "1.11.0"
-composeBom = "2025.10.00"
-composeMaterialAdaptive = "1.1.0"
-xrCompose = "1.0.0-alpha07"
-xrSceneCore = "1.0.0-alpha07"
+lifecycleRuntimeKtx = "2.10.0"
+activityCompose = "1.13.0"
+composeBom = "2026.05.00"
+composeMaterialAdaptive = "1.2.0"
+xrCompose = "1.0.0-alpha13"
+xrSceneCore = "1.0.0-alpha14"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -33,6 +33,5 @@ androidx-xr-scenecore = { group = "androidx.xr.scenecore", name = "scenecore", v
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
diff --git a/xr-fundamentals/part2/gradle/wrapper/gradle-wrapper.properties b/xr-fundamentals/part2/gradle/wrapper/gradle-wrapper.properties
index 3e49f77..9cdc728 100644
--- a/xr-fundamentals/part2/gradle/wrapper/gradle-wrapper.properties
+++ b/xr-fundamentals/part2/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Nov 21 11:45:08 EST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/xr-fundamentals/start/app/build.gradle.kts b/xr-fundamentals/start/app/build.gradle.kts
index 030eac2..313ab2c 100644
--- a/xr-fundamentals/start/app/build.gradle.kts
+++ b/xr-fundamentals/start/app/build.gradle.kts
@@ -16,18 +16,17 @@
plugins {
alias(libs.plugins.android.application)
- alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
android {
namespace = "com.example.android.xrfundamentals"
- compileSdk = 36
+ compileSdk = 37
defaultConfig {
applicationId = "com.example.android.xrfundamentals"
minSdk = 34
- targetSdk = 36
+ targetSdk = 37
versionCode = 1
versionName = "1.0"
@@ -47,9 +46,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
- kotlinOptions {
- jvmTarget = "11"
- }
buildFeatures {
compose = true
}
diff --git a/xr-fundamentals/start/app/src/main/AndroidManifest.xml b/xr-fundamentals/start/app/src/main/AndroidManifest.xml
index 6e99ef2..fe6826f 100644
--- a/xr-fundamentals/start/app/src/main/AndroidManifest.xml
+++ b/xr-fundamentals/start/app/src/main/AndroidManifest.xml
@@ -17,7 +17,6 @@