From 1da1d9d645cd1a8e693981900e04d6bc32287a5c Mon Sep 17 00:00:00 2001 From: Ash <83780687+ashnohe@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:23:31 -0700 Subject: [PATCH 01/27] Add basic WindowInsetsRulers cases (#621) --- .../snippets/layouts/InsetsSnippets.kt | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/InsetsSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/InsetsSnippets.kt index 031d78df..e893e809 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/InsetsSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/InsetsSnippets.kt @@ -31,6 +31,8 @@ import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.asPaddingValues import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.fitInside import androidx.compose.foundation.layout.ime import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.navigationBars @@ -49,9 +51,12 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment.Companion.BottomCenter import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.RectRulers import androidx.compose.ui.layout.WindowInsetsRulers +import androidx.compose.ui.layout.innermostOf import androidx.compose.ui.layout.layout import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Constraints @@ -208,3 +213,53 @@ fun Modifier.alignToSafeDrawing(): Modifier { } } // [END android_compose_insets_rulers] + +// [START android_compose_insets_fit_inside] +@Composable +fun FitInsideDemo(modifier: Modifier) { + Box( + modifier = modifier + .fillMaxSize() + // Or DisplayCutout, Ime, NavigationBars, StatusBar, etc... + .fitInside(WindowInsetsRulers.SafeDrawing.current) + ) +} +// [END android_compose_insets_fit_inside] + +// [START android_compose_insets_rulers_ime] +@Composable +fun FitInsideWithImeDemo(modifier: Modifier) { + Box( + modifier = modifier + .fillMaxSize() + .fitInside( + RectRulers.innermostOf( + WindowInsetsRulers.NavigationBars.current, + WindowInsetsRulers.Ime.current + ) + ) + ) { + TextField( + value = "Demo IME Insets", + onValueChange = {}, + modifier = modifier.align(Alignment.BottomStart).fillMaxWidth() + ) + } +} +// [END android_compose_insets_rulers_ime] + +// [START android_compose_insets_rulers_status_caption_bars] +@Composable +fun FitInsideWithStatusAndCaptionBarDemo(modifier: Modifier) { + Box( + modifier = modifier + .fillMaxSize() + .fitInside( + RectRulers.innermostOf( + WindowInsetsRulers.StatusBars.current, + WindowInsetsRulers.CaptionBar.current + ) + ) + ) +} +// [END android_compose_insets_rulers_status_caption_bars] From 2f246fb3f712172fefe2e1761f3483568348bf90 Mon Sep 17 00:00:00 2001 From: Dereck Bridie Date: Fri, 26 Sep 2025 15:55:09 +0200 Subject: [PATCH 02/27] Update XR snippets to be compatible with the September release versions (#622) --- gradle/libs.versions.toml | 6 +- .../java/com/example/xr/arcore/Anchors.kt | 5 +- .../main/java/com/example/xr/arcore/Hands.kt | 21 +++---- .../main/java/com/example/xr/arcore/Planes.kt | 5 +- .../java/com/example/xr/compose/Orbiter.kt | 10 ++-- .../com/example/xr/compose/SpatialPanel.kt | 15 +++-- .../java/com/example/xr/compose/Volume.kt | 9 +-- .../xr/scenecore/ResizableComponent.kt | 5 +- .../com/example/xr/scenecore/SpatialVideo.kt | 59 +++++++++---------- 9 files changed, 63 insertions(+), 72 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8bab1c79..4330d254 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -28,9 +28,9 @@ androidx-test-junit = "1.3.0" androidx-window = "1.5.0-beta02" androidx-window-core = "1.5.0-beta02" androidx-window-java = "1.5.0-beta02" -androidx-xr-arcore = "1.0.0-alpha05" -androidx-xr-compose = "1.0.0-alpha06" -androidx-xr-scenecore = "1.0.0-alpha06" +androidx-xr-arcore = "1.0.0-alpha06" +androidx-xr-compose = "1.0.0-alpha07" +androidx-xr-scenecore = "1.0.0-alpha07" androidxHiltNavigationCompose = "1.2.0" appcompat = "1.7.1" coil = "2.7.0" diff --git a/xr/src/main/java/com/example/xr/arcore/Anchors.kt b/xr/src/main/java/com/example/xr/arcore/Anchors.kt index 56c7cb8d..ad8ac26a 100644 --- a/xr/src/main/java/com/example/xr/arcore/Anchors.kt +++ b/xr/src/main/java/com/example/xr/arcore/Anchors.kt @@ -21,7 +21,6 @@ import androidx.xr.arcore.AnchorCreateSuccess import androidx.xr.arcore.Trackable import androidx.xr.runtime.Config import androidx.xr.runtime.Session -import androidx.xr.runtime.SessionConfigureConfigurationNotSupported import androidx.xr.runtime.SessionConfigureSuccess import androidx.xr.runtime.math.Pose import androidx.xr.scenecore.AnchorEntity @@ -34,11 +33,9 @@ fun configureAnchoring(session: Session) { anchorPersistence = Config.AnchorPersistenceMode.LOCAL, ) when (val result = session.configure(newConfig)) { - is SessionConfigureConfigurationNotSupported -> - TODO(/* Some combinations of configurations are not valid. Handle this failure case. */) is SessionConfigureSuccess -> TODO(/* Success! */) else -> - TODO(/* A different unhandled exception was thrown. */) + TODO(/* The session could not be configured. See SessionConfigureResult for possible causes. */) } // [END androidxr_arcore_anchoring_configure] } diff --git a/xr/src/main/java/com/example/xr/arcore/Hands.kt b/xr/src/main/java/com/example/xr/arcore/Hands.kt index 1507bed7..3c0fd82f 100644 --- a/xr/src/main/java/com/example/xr/arcore/Hands.kt +++ b/xr/src/main/java/com/example/xr/arcore/Hands.kt @@ -20,10 +20,9 @@ import android.app.Activity import androidx.activity.ComponentActivity import androidx.lifecycle.lifecycleScope import androidx.xr.arcore.Hand +import androidx.xr.arcore.HandJointType import androidx.xr.runtime.Config -import androidx.xr.runtime.HandJointType import androidx.xr.runtime.Session -import androidx.xr.runtime.SessionConfigureConfigurationNotSupported import androidx.xr.runtime.SessionConfigureSuccess import androidx.xr.runtime.math.Pose import androidx.xr.runtime.math.Quaternion @@ -40,11 +39,9 @@ fun ComponentActivity.configureSession(session: Session) { handTracking = Config.HandTrackingMode.BOTH ) when (val result = session.configure(newConfig)) { - is SessionConfigureConfigurationNotSupported -> - TODO(/* Some combinations of configurations are not valid. Handle this failure case. */) is SessionConfigureSuccess -> TODO(/* Success! */) else -> - TODO(/* A different unhandled exception was thrown. */) + TODO(/* The session could not be configured. See SessionConfigureResult for possible causes. */) } // [END androidxr_arcore_hand_configure] } @@ -80,7 +77,7 @@ fun ComponentActivity.renderPlanetAtHandPalm(leftHandState: Hand.State) { val session: Session = null!! val palmEntity: GltfModelEntity = null!! // [START androidxr_arcore_hand_entityAtHandPalm] - val palmPose = leftHandState.handJoints[HandJointType.PALM] ?: return + val palmPose = leftHandState.handJoints[HandJointType.HAND_JOINT_TYPE_PALM] ?: return // the down direction points in the same direction as the palm val angle = Vector3.angleBetween(palmPose.rotation * Vector3.Down, Vector3.Up) @@ -101,7 +98,7 @@ fun ComponentActivity.renderPlanetAtFingerTip(rightHandState: Hand.State) { val indexFingerEntity: GltfModelEntity = null!! // [START androidxr_arcore_hand_entityAtIndexFingerTip] - val tipPose = rightHandState.handJoints[HandJointType.INDEX_TIP] ?: return + val tipPose = rightHandState.handJoints[HandJointType.HAND_JOINT_TYPE_INDEX_TIP] ?: return // the forward direction points towards the finger tip. val angle = Vector3.angleBetween(tipPose.rotation * Vector3.Forward, Vector3.Up) @@ -120,9 +117,9 @@ fun ComponentActivity.renderPlanetAtFingerTip(rightHandState: Hand.State) { private fun detectPinch(session: Session, handState: Hand.State): Boolean { // [START androidxr_arcore_hand_pinch_gesture] - val thumbTip = handState.handJoints[HandJointType.THUMB_TIP] ?: return false + val thumbTip = handState.handJoints[HandJointType.HAND_JOINT_TYPE_THUMB_TIP] ?: return false val thumbTipPose = session.scene.perceptionSpace.transformPoseTo(thumbTip, session.scene.activitySpace) - val indexTip = handState.handJoints[HandJointType.INDEX_TIP] ?: return false + val indexTip = handState.handJoints[HandJointType.HAND_JOINT_TYPE_INDEX_TIP] ?: return false val indexTipPose = session.scene.perceptionSpace.transformPoseTo(indexTip, session.scene.activitySpace) return Vector3.distance(thumbTipPose.translation, indexTipPose.translation) < 0.05 // [END androidxr_arcore_hand_pinch_gesture] @@ -136,8 +133,8 @@ private fun detectStop(session: Session, handState: Hand.State): Boolean { val forward2 = handState.handJoints[joint2]?.forward ?: return false return Vector3.angleBetween(forward1, forward2) < threshold } - return pointingInSameDirection(HandJointType.INDEX_PROXIMAL, HandJointType.INDEX_TIP) && - pointingInSameDirection(HandJointType.MIDDLE_PROXIMAL, HandJointType.MIDDLE_TIP) && - pointingInSameDirection(HandJointType.RING_PROXIMAL, HandJointType.RING_TIP) + return pointingInSameDirection(HandJointType.HAND_JOINT_TYPE_INDEX_PROXIMAL, HandJointType.HAND_JOINT_TYPE_INDEX_TIP) && + pointingInSameDirection(HandJointType.HAND_JOINT_TYPE_MIDDLE_PROXIMAL, HandJointType.HAND_JOINT_TYPE_MIDDLE_TIP) && + pointingInSameDirection(HandJointType.HAND_JOINT_TYPE_RING_PROXIMAL, HandJointType.HAND_JOINT_TYPE_RING_TIP) // [END androidxr_arcore_hand_stop_gesture] } diff --git a/xr/src/main/java/com/example/xr/arcore/Planes.kt b/xr/src/main/java/com/example/xr/arcore/Planes.kt index b5017dcb..828f3785 100644 --- a/xr/src/main/java/com/example/xr/arcore/Planes.kt +++ b/xr/src/main/java/com/example/xr/arcore/Planes.kt @@ -19,7 +19,6 @@ package com.example.xr.arcore import androidx.xr.arcore.Plane import androidx.xr.runtime.Config import androidx.xr.runtime.Session -import androidx.xr.runtime.SessionConfigureConfigurationNotSupported import androidx.xr.runtime.SessionConfigureSuccess import androidx.xr.runtime.math.Pose import androidx.xr.runtime.math.Ray @@ -31,11 +30,9 @@ fun configurePlaneTracking(session: Session) { planeTracking = Config.PlaneTrackingMode.HORIZONTAL_AND_VERTICAL, ) when (val result = session.configure(newConfig)) { - is SessionConfigureConfigurationNotSupported -> - TODO(/* Some combinations of configurations are not valid. Handle this failure case. */) is SessionConfigureSuccess -> TODO(/* Success! */) else -> - TODO(/* A different unhandled exception was thrown. */) + TODO(/* The session could not be configured. See SessionConfigureResult for possible causes. */) } // [END androidxr_arcore_planetracking_configure] } diff --git a/xr/src/main/java/com/example/xr/compose/Orbiter.kt b/xr/src/main/java/com/example/xr/compose/Orbiter.kt index f01c4cd1..8b89e4c6 100644 --- a/xr/src/main/java/com/example/xr/compose/Orbiter.kt +++ b/xr/src/main/java/com/example/xr/compose/Orbiter.kt @@ -40,13 +40,13 @@ import androidx.xr.compose.spatial.ContentEdge import androidx.xr.compose.spatial.Orbiter import androidx.xr.compose.spatial.OrbiterOffsetType import androidx.xr.compose.spatial.Subspace +import androidx.xr.compose.subspace.MovePolicy +import androidx.xr.compose.subspace.ResizePolicy import androidx.xr.compose.subspace.SpatialPanel import androidx.xr.compose.subspace.SpatialRow import androidx.xr.compose.subspace.layout.SpatialRoundedCornerShape import androidx.xr.compose.subspace.layout.SubspaceModifier import androidx.xr.compose.subspace.layout.height -import androidx.xr.compose.subspace.layout.movable -import androidx.xr.compose.subspace.layout.resizable import androidx.xr.compose.subspace.layout.width import com.example.xr.R @@ -57,9 +57,9 @@ private fun OrbiterExampleSubspace() { SpatialPanel( SubspaceModifier .height(824.dp) - .width(1400.dp) - .movable() - .resizable() + .width(1400.dp), + dragPolicy = MovePolicy(), + resizePolicy = ResizePolicy(), ) { SpatialPanelContent() OrbiterExample() diff --git a/xr/src/main/java/com/example/xr/compose/SpatialPanel.kt b/xr/src/main/java/com/example/xr/compose/SpatialPanel.kt index c3a3a58e..2b75a426 100644 --- a/xr/src/main/java/com/example/xr/compose/SpatialPanel.kt +++ b/xr/src/main/java/com/example/xr/compose/SpatialPanel.kt @@ -29,11 +29,11 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.xr.compose.platform.LocalSpatialCapabilities import androidx.xr.compose.spatial.Subspace +import androidx.xr.compose.subspace.MovePolicy +import androidx.xr.compose.subspace.ResizePolicy import androidx.xr.compose.subspace.SpatialPanel import androidx.xr.compose.subspace.layout.SubspaceModifier import androidx.xr.compose.subspace.layout.height -import androidx.xr.compose.subspace.layout.movable -import androidx.xr.compose.subspace.layout.resizable import androidx.xr.compose.subspace.layout.width @Composable @@ -43,9 +43,9 @@ private fun SpatialPanelExample() { SpatialPanel( SubspaceModifier .height(824.dp) - .width(1400.dp) - .movable() - .resizable() + .width(1400.dp), + dragPolicy = MovePolicy(), + resizePolicy = ResizePolicy(), ) { SpatialPanelContent() } @@ -81,9 +81,8 @@ private fun ContentInSpatialPanel() { if (LocalSpatialCapabilities.current.isSpatialUiEnabled) { Subspace { SpatialPanel( - SubspaceModifier - .resizable(true) - .movable(true) + dragPolicy = MovePolicy(), + resizePolicy = ResizePolicy(), ) { AppContent() } diff --git a/xr/src/main/java/com/example/xr/compose/Volume.kt b/xr/src/main/java/com/example/xr/compose/Volume.kt index cce37ca8..587cc301 100644 --- a/xr/src/main/java/com/example/xr/compose/Volume.kt +++ b/xr/src/main/java/com/example/xr/compose/Volume.kt @@ -28,13 +28,13 @@ import androidx.compose.ui.unit.sp import androidx.xr.compose.platform.LocalSession import androidx.xr.compose.spatial.Subspace import androidx.xr.compose.subspace.ExperimentalSubspaceVolumeApi +import androidx.xr.compose.subspace.MovePolicy +import androidx.xr.compose.subspace.ResizePolicy import androidx.xr.compose.subspace.SpatialPanel import androidx.xr.compose.subspace.Volume import androidx.xr.compose.subspace.layout.SubspaceModifier import androidx.xr.compose.subspace.layout.height -import androidx.xr.compose.subspace.layout.movable import androidx.xr.compose.subspace.layout.offset -import androidx.xr.compose.subspace.layout.resizable import androidx.xr.compose.subspace.layout.scale import androidx.xr.compose.subspace.layout.width import kotlinx.coroutines.launch @@ -44,8 +44,9 @@ private fun VolumeExample() { // [START androidxr_compose_Volume] Subspace { SpatialPanel( - SubspaceModifier.height(1500.dp).width(1500.dp) - .resizable().movable() + SubspaceModifier.height(1500.dp).width(1500.dp), + dragPolicy = MovePolicy(), + resizePolicy = ResizePolicy(), ) { ObjectInAVolume(true) Box( diff --git a/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt b/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt index 28b70027..e4136ea7 100644 --- a/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt +++ b/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt @@ -17,6 +17,7 @@ package com.example.xr.scenecore import androidx.xr.runtime.Session +import androidx.xr.runtime.math.FloatSize2d import androidx.xr.runtime.math.FloatSize3d import androidx.xr.scenecore.ResizableComponent import androidx.xr.scenecore.ResizeEvent @@ -32,11 +33,11 @@ private fun resizableComponentExample( val resizableComponent = ResizableComponent.create(session) { event -> if (event.resizeState == ResizeEvent.ResizeState.RESIZE_STATE_END) { // update the Entity to reflect the new size - surfaceEntity.canvasShape = SurfaceEntity.CanvasShape.Quad(event.newSize.width, event.newSize.height) + surfaceEntity.shape = SurfaceEntity.Shape.Quad(FloatSize2d(event.newSize.width, event.newSize.height)) } } resizableComponent.minimumEntitySize = FloatSize3d(177f, 100f, 1f) - resizableComponent.fixedAspectRatio = 16f / 9f // Specify a 16:9 aspect ratio + resizableComponent.isFixedAspectRatioEnabled = true // Maintain a fixed aspect ratio when resizing surfaceEntity.addComponent(resizableComponent) // [END androidxr_scenecore_resizableComponentExample] diff --git a/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt b/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt index ec733bb6..85f1dfa0 100644 --- a/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt +++ b/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt @@ -24,11 +24,11 @@ import androidx.media3.common.C import androidx.media3.common.MediaItem import androidx.media3.exoplayer.ExoPlayer import androidx.xr.runtime.Session +import androidx.xr.runtime.math.FloatSize2d import androidx.xr.runtime.math.Pose import androidx.xr.runtime.math.Vector3 import androidx.xr.scenecore.SurfaceEntity import androidx.xr.scenecore.Texture -import androidx.xr.scenecore.TextureSampler import androidx.xr.scenecore.scene import java.nio.file.Paths import kotlinx.coroutines.launch @@ -36,10 +36,10 @@ import kotlinx.coroutines.launch private fun ComponentActivity.surfaceEntityCreate(xrSession: Session) { // [START androidxr_scenecore_surfaceEntityCreate] val stereoSurfaceEntity = SurfaceEntity.create( - xrSession, - SurfaceEntity.StereoMode.SIDE_BY_SIDE, - Pose(Vector3(0.0f, 0.0f, -1.5f)), - SurfaceEntity.CanvasShape.Quad(1.0f, 1.0f) + session = xrSession, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, + pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), + shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)) ) val videoUri = Uri.Builder() .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) @@ -60,13 +60,13 @@ private fun ComponentActivity.surfaceEntityCreateSbs(xrSession: Session) { // Set up the surface for playing a 180° video on a hemisphere. val hemisphereStereoSurfaceEntity = SurfaceEntity.create( - xrSession, - SurfaceEntity.StereoMode.SIDE_BY_SIDE, - xrSession.scene.spatialUser.head?.transformPoseTo( + session = xrSession, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, + pose = xrSession.scene.spatialUser.head?.transformPoseTo( Pose.Identity, xrSession.scene.activitySpace )!!, - SurfaceEntity.CanvasShape.Vr180Hemisphere(1.0f), + shape = SurfaceEntity.Shape.Hemisphere(1.0f), ) // ... and use the surface for playing the media. // [END androidxr_scenecore_surfaceEntityCreateSbs] @@ -77,13 +77,13 @@ private fun ComponentActivity.surfaceEntityCreateTb(xrSession: Session) { // Set up the surface for playing a 360° video on a sphere. val sphereStereoSurfaceEntity = SurfaceEntity.create( - xrSession, - SurfaceEntity.StereoMode.TOP_BOTTOM, - xrSession.scene.spatialUser.head?.transformPoseTo( + session = xrSession, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_TOP_BOTTOM, + pose = xrSession.scene.spatialUser.head?.transformPoseTo( Pose.Identity, xrSession.scene.activitySpace )!!, - SurfaceEntity.CanvasShape.Vr360Sphere(1.0f), + shape = SurfaceEntity.Shape.Sphere(1.0f), ) // ... and use the surface for playing the media. // [END androidxr_scenecore_surfaceEntityCreateTb] @@ -93,10 +93,10 @@ private fun ComponentActivity.surfaceEntityCreateMVHEVC(xrSession: Session) { // [START androidxr_scenecore_surfaceEntityCreateMVHEVC] // Create the SurfaceEntity with the StereoMode corresponding to the MV-HEVC content val stereoSurfaceEntity = SurfaceEntity.create( - xrSession, - SurfaceEntity.StereoMode.MULTIVIEW_LEFT_PRIMARY, - Pose(Vector3(0.0f, 0.0f, -1.5f)), - SurfaceEntity.CanvasShape.Quad(1.0f, 1.0f) + session = xrSession, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_MULTIVIEW_LEFT_PRIMARY, + pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), + shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)) ) val videoUri = Uri.Builder() .scheme(ContentResolver.SCHEME_ANDROID_RESOURCE) @@ -123,10 +123,10 @@ private fun ComponentActivity.surfaceEntityCreateDRM(xrSession: Session) { // Create the SurfaceEntity with the PROTECTED content security level. val protectedSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.SIDE_BY_SIDE, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), - canvasShape = SurfaceEntity.CanvasShape.Quad(1.0f, 1.0f), - contentSecurityLevel = SurfaceEntity.ContentSecurityLevel.PROTECTED + shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)), + surfaceProtection = SurfaceEntity.SurfaceProtection.SURFACE_PROTECTION_PROTECTED ) // Build a MediaItem with the necessary DRM configuration. @@ -156,20 +156,20 @@ private fun ComponentActivity.surfaceEntityHDR(xrSession: Session) { // Define the color properties for your HDR video. These values should be specific // to your content. val hdrMetadata = SurfaceEntity.ContentColorMetadata( - colorSpace = SurfaceEntity.ContentColorMetadata.ColorSpace.BT2020, - colorTransfer = SurfaceEntity.ContentColorMetadata.ColorTransfer.ST2084, // PQ - colorRange = SurfaceEntity.ContentColorMetadata.ColorRange.LIMITED, - maxCLL = 1000 // Example: 1000 nits + colorSpace = SurfaceEntity.ContentColorMetadata.ColorSpace.COLOR_SPACE_BT2020, + colorTransfer = SurfaceEntity.ContentColorMetadata.ColorTransfer.COLOR_TRANSFER_ST2084, // PQ + colorRange = SurfaceEntity.ContentColorMetadata.ColorRange.COLOR_RANGE_LIMITED, + maxContentLightLevel = 1000 // Example: 1000 nits ) // Create a SurfaceEntity, passing the HDR metadata at creation time. val hdrSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.MONO, + stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_MONO, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), - canvasShape = SurfaceEntity.CanvasShape.Quad(1.0f, 1.0f), - contentColorMetadata = hdrMetadata + shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)), ) + hdrSurfaceEntity.contentColorMetadata = hdrMetadata // Initialize ExoPlayer and set the surface. val exoPlayer = ExoPlayer.Builder(this).build() @@ -195,8 +195,8 @@ private fun surfaceEntityEdgeFeathering(xrSession: Session) { ) // Feather the edges of the surface. - surfaceEntity.edgeFeather = - SurfaceEntity.EdgeFeatheringParams.SmoothFeather(0.1f, 0.1f) + surfaceEntity.edgeFeatheringParams = + SurfaceEntity.EdgeFeatheringParams.RectangleFeather(0.1f, 0.1f) // [END androidxr_scenecore_surfaceEntityEdgeFeathering] } @@ -214,7 +214,6 @@ private fun surfaceEntityAlphaMasking(xrSession: Session, activity: ComponentAct Texture.create( xrSession, Paths.get("textures", "alpha_mask.png"), - TextureSampler.create() ) // Apply the alpha mask. From c2e40eecf3f9cb5a57ab4bffa42993bbb54742b7 Mon Sep 17 00:00:00 2001 From: Dereck Bridie Date: Fri, 26 Sep 2025 19:01:47 +0200 Subject: [PATCH 03/27] Upgrade to Gradle wrapper version 9.1.0 (#627) --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37f853b1..2e111328 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ 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.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 27c462ce7811288e941a5432beccd63b02db80c9 Mon Sep 17 00:00:00 2001 From: Dereck Bridie Date: Fri, 26 Sep 2025 19:24:53 +0200 Subject: [PATCH 04/27] Upgrade to Spotless 7 (#628) --- .github/workflows/apply_spotless.yml | 2 +- bluetoothle/src/main/AndroidManifest.xml | 17 +++- .../src/main/res/layout/activity_main.xml | 17 +++- bluetoothle/src/main/res/values/strings.xml | 16 ++++ build.gradle.kts | 83 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 15 ++++ .../src/main/res/values/strings.xml | 26 +++--- .../src/main/res/values/themes.xml | 18 +++- compose/snippets/lint.xml | 19 ++++- compose/snippets/src/main/AndroidManifest.xml | 31 ++++--- .../example/compose/snippets/ui/theme/Type.kt | 2 +- .../drawable-v24/ic_launcher_foreground.xml | 32 +++---- .../drawable/baseline_directions_bus_24.xml | 30 +++---- .../drawable/baseline_shopping_cart_24.xml | 30 +++---- .../src/main/res/drawable/button_outline.xml | 32 +++---- .../src/main/res/drawable/fast_forward.xml | 16 ++++ .../main/res/drawable/fast_forward_filled.xml | 16 ++++ .../src/main/res/drawable/fast_rewind.xml | 16 ++++ .../main/res/drawable/fast_rewind_filled.xml | 16 ++++ .../src/main/res/drawable/favorite.xml | 16 ++++ .../src/main/res/drawable/favorite_filled.xml | 16 ++++ .../res/drawable/ic_hourglass_animated.xml | 20 ++--- .../res/drawable/ic_launcher_background.xml | 29 ++++--- .../src/main/res/drawable/ic_logo.xml | 30 +++---- .../src/main/res/drawable/ic_moon_24.xml | 16 ++++ .../src/main/res/drawable/ic_sun_24.xml | 16 ++++ .../src/main/res/layout/activity_example.xml | 31 ++++--- .../src/main/res/layout/example_layout.xml | 31 ++++--- .../src/main/res/layout/example_view.xml | 29 ++++--- .../src/main/res/layout/fragment_example.xml | 31 ++++--- .../interop_layout_preview_composable.xml | 31 ++++--- .../migration_strategy_existing_screens.xml | 31 ++++--- .../layout/migration_strategy_xml_example.xml | 31 ++++--- .../src/main/res/layout/my_container_view.xml | 32 +++---- .../main/res/layout/my_fragment_layout.xml | 31 ++++--- ...chinput_gestures_nested_scroll_interop.xml | 31 ++++--- .../res/mipmap-anydpi-v26/ic_launcher.xml | 31 ++++--- .../mipmap-anydpi-v26/ic_launcher_round.xml | 31 ++++--- .../src/main/res/values-es/strings.xml | 32 +++---- .../snippets/src/main/res/values/colors.xml | 31 ++++--- .../snippets/src/main/res/values/dimens.xml | 31 ++++--- compose/snippets/src/main/res/values/ids.xml | 31 ++++--- .../snippets/src/main/res/values/strings.xml | 32 +++---- .../snippets/src/main/res/values/themes.xml | 31 ++++--- .../src/main/res/xml/my_app_widget_info.xml | 32 +++---- gradle/init.gradle.kts | 52 ------------ gradle/libs.versions.toml | 3 + .../src/main/AndroidManifest.xml | 27 +++--- .../drawable-v24/ic_launcher_foreground.xml | 18 +++- .../res/drawable/ic_launcher_background.xml | 15 ++++ .../src/main/res/layout-v34/xmlsnippets.xml | 29 ++++--- .../res/mipmap-anydpi-v26/ic_launcher.xml | 17 +++- .../mipmap-anydpi-v26/ic_launcher_round.xml | 17 +++- .../src/main/res/values/colors.xml | 17 +++- .../src/main/res/values/strings.xml | 18 +++- .../src/main/res/values/themes.xml | 17 +++- .../src/main/res/xml/provider.xml | 15 ++++ .../src/main/res/xml/provider_settings.xml | 15 ++++ kmp/androidApp/src/main/AndroidManifest.xml | 17 +++- .../src/androidMain/AndroidManifest.xml | 17 +++- kotlin/src/main/AndroidManifest.xml | 15 ++++ misc/src/main/AndroidManifest.xml | 15 ++++ .../ActivityEmbeddingKotlinSnippets.kt | 4 +- .../com/example/snippets/ui/theme/Type.kt | 2 +- .../res/drawable/ic_launcher_background.xml | 15 ++++ .../res/drawable/ic_launcher_foreground.xml | 18 +++- misc/src/main/res/layout/activity_main.xml | 16 +++- .../res/mipmap-anydpi-v26/ic_launcher.xml | 17 +++- .../mipmap-anydpi-v26/ic_launcher_round.xml | 17 +++- misc/src/main/res/values/colors.xml | 15 ++++ misc/src/main/res/values/strings.xml | 18 +++- misc/src/main/res/values/themes.xml | 17 +++- misc/src/main/res/xml/main_split_config.xml | 18 +++- spotless/copyright.kts | 16 ++++ spotless/copyright.xml | 16 ++++ views/src/main/AndroidManifest.xml | 23 +++-- .../main/res/layout/system_bar_protection.xml | 25 +++--- views/src/main/res/layout/widget_preview.xml | 24 +++--- wear/lint.xml | 19 ++++- wear/src/main/AndroidManifest.xml | 15 ++++ wear/src/main/res/drawable/animated_walk.xml | 4 +- .../main/res/drawable/complication_icon.xml | 16 ++++ .../res/drawable/ic_launcher_background.xml | 15 ++++ .../res/drawable/ic_launcher_foreground.xml | 18 +++- wear/src/main/res/drawable/ic_walk.xml | 16 ++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 17 +++- .../mipmap-anydpi-v26/ic_launcher_round.xml | 17 +++- wear/src/main/res/values/strings.xml | 18 +++- xr/src/main/AndroidManifest.xml | 17 +++- .../com/example/xr/scenecore/GltfEntity.kt | 2 +- .../com/example/xr/scenecore/SpatialAudio.kt | 2 +- xr/src/main/res/layout/example_fragment.xml | 17 +++- xr/src/main/res/values/dimens.xml | 17 +++- 93 files changed, 1373 insertions(+), 590 deletions(-) delete mode 100644 gradle/init.gradle.kts create mode 100644 spotless/copyright.kts create mode 100644 spotless/copyright.xml diff --git a/.github/workflows/apply_spotless.yml b/.github/workflows/apply_spotless.yml index d69f817b..3727da63 100644 --- a/.github/workflows/apply_spotless.yml +++ b/.github/workflows/apply_spotless.yml @@ -42,7 +42,7 @@ jobs: java-version: '17' - name: Run spotlessApply - run: ./gradlew spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace + run: ./gradlew spotlessApply --stacktrace - name: Auto-commit if spotlessApply has changes uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/bluetoothle/src/main/AndroidManifest.xml b/bluetoothle/src/main/AndroidManifest.xml index d15b213e..b4286557 100644 --- a/bluetoothle/src/main/AndroidManifest.xml +++ b/bluetoothle/src/main/AndroidManifest.xml @@ -1,4 +1,19 @@ + @@ -24,4 +39,4 @@ - \ No newline at end of file + diff --git a/bluetoothle/src/main/res/layout/activity_main.xml b/bluetoothle/src/main/res/layout/activity_main.xml index b692bf4a..b46563be 100644 --- a/bluetoothle/src/main/res/layout/activity_main.xml +++ b/bluetoothle/src/main/res/layout/activity_main.xml @@ -1,4 +1,19 @@ + - \ No newline at end of file + diff --git a/bluetoothle/src/main/res/values/strings.xml b/bluetoothle/src/main/res/values/strings.xml index 7abc06d3..fa7796f2 100644 --- a/bluetoothle/src/main/res/values/strings.xml +++ b/bluetoothle/src/main/res/values/strings.xml @@ -1 +1,17 @@ + + diff --git a/build.gradle.kts b/build.gradle.kts index 899385a1..bafd85c4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,6 +13,89 @@ plugins { alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.android.kotlin.multiplatform.library) apply false alias(libs.plugins.android.lint) apply false + alias(libs.plugins.spotless) apply false +} + +subprojects { + apply(plugin = "com.diffplug.spotless") + extensions.configure { + kotlin { + target("**/*.kt") + targetExclude("**/build/**/*.kt") + + val disabledRules = arrayOf( + // These rules were introduced in ktlint 0.46.0 and should not be + // enabled without further discussion. They are disabled for now. + // See: https://github.com/pinterest/ktlint/releases/tag/0.46.0 + "filename", + "annotation", + "annotation-spacing", + "argument-list-wrapping", + "double-colon-spacing", + "enum-entry-name-case", + "multiline-if-else", + "no-empty-first-line-in-method-block", + "package-name", + "trailing-comma", + "spacing-around-angle-brackets", + "spacing-between-declarations-with-annotations", + "spacing-between-declarations-with-comments", + "unary-op-spacing", + "no-trailing-spaces", + "max-line-length", + // Disabled rules that were introduced or changed between 0.46.0 ~ 1.50.0 + "class-signature", + "trailing-comma-on-call-site", + "trailing-comma-on-declaration-site", + "comment-wrapping", + "function-literal", + "function-signature", + "function-expression-body", + "function-start-of-body-spacing", + "multiline-expression-wrapping", + ) + + ktlint(libs.versions.ktlint.get()).editorConfigOverride( + mapOf( + "android" to "true", + "ktlint_code_style" to "android_studio", + "ij_kotlin_allow_trailing_comma" to "true", + ) + disabledRules.map { Pair("ktlint_standard_$it", "disabled") } + ) + + // ktlint 7.0.0 introduces lints, which existing snippets do not satisfy + val kotlinSuppressLints = arrayOf( + "standard:function-naming", + "standard:property-naming", + "standard:class-naming", + "standard:max-line-length", + "standard:comment-wrapping", + "standard:import-ordering", + "standard:filename", + "standard:backing-property-naming", + ) + for (lint in kotlinSuppressLints) { + suppressLintsFor { + step = "ktlint" + shortCode = lint + } + } + + licenseHeaderFile(rootProject.file("spotless/copyright.kt")) + } + kotlinGradle { + target("**/*.kts") + targetExclude("**/build/**/*.kts") + // Look for the first line that doesn't have a block comment (assumed to be the license) + licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)") + } + format("xml") { + target("**/*.xml") + targetExclude("**/build/**/*.xml") + // Look for the root tag or a tag that is a snippet + licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[a-zA-Z])|( + Copyright 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> RecomposeHighlighter diff --git a/compose/recomposehighlighter/src/main/res/values/themes.xml b/compose/recomposehighlighter/src/main/res/values/themes.xml index 918929c1..f9427943 100644 --- a/compose/recomposehighlighter/src/main/res/values/themes.xml +++ b/compose/recomposehighlighter/src/main/res/values/themes.xml @@ -1,5 +1,21 @@ + + - \ No newline at end of file + diff --git a/compose/snippets/lint.xml b/compose/snippets/lint.xml index 778dd98f..9ec5c342 100644 --- a/compose/snippets/lint.xml +++ b/compose/snippets/lint.xml @@ -1,6 +1,21 @@ - + + - \ No newline at end of file + diff --git a/compose/snippets/src/main/AndroidManifest.xml b/compose/snippets/src/main/AndroidManifest.xml index 4ec4d9b7..5c0f57b2 100644 --- a/compose/snippets/src/main/AndroidManifest.xml +++ b/compose/snippets/src/main/AndroidManifest.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> @@ -70,4 +69,4 @@ - \ No newline at end of file + diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/ui/theme/Type.kt b/compose/snippets/src/main/java/com/example/compose/snippets/ui/theme/Type.kt index acf007bf..ab604e85 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/ui/theme/Type.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/ui/theme/Type.kt @@ -46,5 +46,5 @@ val Typography = Typography( lineHeight = 16.sp, letterSpacing = 0.5.sp ) - */ + */ ) diff --git a/compose/snippets/src/main/res/drawable-v24/ic_launcher_foreground.xml b/compose/snippets/src/main/res/drawable-v24/ic_launcher_foreground.xml index 2f975848..0f6026a4 100644 --- a/compose/snippets/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/compose/snippets/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -1,19 +1,19 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/drawable/baseline_directions_bus_24.xml b/compose/snippets/src/main/res/drawable/baseline_directions_bus_24.xml index 2de5d0a8..745eab18 100644 --- a/compose/snippets/src/main/res/drawable/baseline_directions_bus_24.xml +++ b/compose/snippets/src/main/res/drawable/baseline_directions_bus_24.xml @@ -1,19 +1,19 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/compose/snippets/src/main/res/drawable/baseline_shopping_cart_24.xml b/compose/snippets/src/main/res/drawable/baseline_shopping_cart_24.xml index 817fb053..15368afa 100644 --- a/compose/snippets/src/main/res/drawable/baseline_shopping_cart_24.xml +++ b/compose/snippets/src/main/res/drawable/baseline_shopping_cart_24.xml @@ -1,19 +1,19 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/compose/snippets/src/main/res/drawable/button_outline.xml b/compose/snippets/src/main/res/drawable/button_outline.xml index f4eb0229..790fd2eb 100644 --- a/compose/snippets/src/main/res/drawable/button_outline.xml +++ b/compose/snippets/src/main/res/drawable/button_outline.xml @@ -1,22 +1,22 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/drawable/fast_forward.xml b/compose/snippets/src/main/res/drawable/fast_forward.xml index d49dffbf..95cdea9c 100644 --- a/compose/snippets/src/main/res/drawable/fast_forward.xml +++ b/compose/snippets/src/main/res/drawable/fast_forward.xml @@ -1,3 +1,19 @@ + + + + + + + diff --git a/compose/snippets/src/main/res/drawable/ic_launcher_background.xml b/compose/snippets/src/main/res/drawable/ic_launcher_background.xml index 4c2360d2..2edadf92 100644 --- a/compose/snippets/src/main/res/drawable/ic_launcher_background.xml +++ b/compose/snippets/src/main/res/drawable/ic_launcher_background.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/compose/snippets/src/main/res/drawable/ic_moon_24.xml b/compose/snippets/src/main/res/drawable/ic_moon_24.xml index 527559f3..b1c551d5 100644 --- a/compose/snippets/src/main/res/drawable/ic_moon_24.xml +++ b/compose/snippets/src/main/res/drawable/ic_moon_24.xml @@ -1,3 +1,19 @@ + + diff --git a/compose/snippets/src/main/res/drawable/ic_sun_24.xml b/compose/snippets/src/main/res/drawable/ic_sun_24.xml index a63c6400..4bac89d3 100644 --- a/compose/snippets/src/main/res/drawable/ic_sun_24.xml +++ b/compose/snippets/src/main/res/drawable/ic_sun_24.xml @@ -1,3 +1,19 @@ + + diff --git a/compose/snippets/src/main/res/layout/activity_example.xml b/compose/snippets/src/main/res/layout/activity_example.xml index be37892a..b85c61cf 100644 --- a/compose/snippets/src/main/res/layout/activity_example.xml +++ b/compose/snippets/src/main/res/layout/activity_example.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/example_layout.xml b/compose/snippets/src/main/res/layout/example_layout.xml index d77d3154..91e49c04 100644 --- a/compose/snippets/src/main/res/layout/example_layout.xml +++ b/compose/snippets/src/main/res/layout/example_layout.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/example_view.xml b/compose/snippets/src/main/res/layout/example_view.xml index 77fff6e8..86bdacae 100644 --- a/compose/snippets/src/main/res/layout/example_view.xml +++ b/compose/snippets/src/main/res/layout/example_view.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> diff --git a/compose/snippets/src/main/res/layout/fragment_example.xml b/compose/snippets/src/main/res/layout/fragment_example.xml index fd65463e..d5517e3c 100644 --- a/compose/snippets/src/main/res/layout/fragment_example.xml +++ b/compose/snippets/src/main/res/layout/fragment_example.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/interop_layout_preview_composable.xml b/compose/snippets/src/main/res/layout/interop_layout_preview_composable.xml index bb28c568..b3a672cb 100644 --- a/compose/snippets/src/main/res/layout/interop_layout_preview_composable.xml +++ b/compose/snippets/src/main/res/layout/interop_layout_preview_composable.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/migration_strategy_existing_screens.xml b/compose/snippets/src/main/res/layout/migration_strategy_existing_screens.xml index 2ef7e2dc..a7bd893b 100644 --- a/compose/snippets/src/main/res/layout/migration_strategy_existing_screens.xml +++ b/compose/snippets/src/main/res/layout/migration_strategy_existing_screens.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/migration_strategy_xml_example.xml b/compose/snippets/src/main/res/layout/migration_strategy_xml_example.xml index ac462f26..e5ed1b28 100644 --- a/compose/snippets/src/main/res/layout/migration_strategy_xml_example.xml +++ b/compose/snippets/src/main/res/layout/migration_strategy_xml_example.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/my_container_view.xml b/compose/snippets/src/main/res/layout/my_container_view.xml index 4d0ecb39..cec8feed 100644 --- a/compose/snippets/src/main/res/layout/my_container_view.xml +++ b/compose/snippets/src/main/res/layout/my_container_view.xml @@ -1,21 +1,21 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/my_fragment_layout.xml b/compose/snippets/src/main/res/layout/my_fragment_layout.xml index d2428b77..3b0ec276 100644 --- a/compose/snippets/src/main/res/layout/my_fragment_layout.xml +++ b/compose/snippets/src/main/res/layout/my_fragment_layout.xml @@ -1,24 +1,23 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/layout/touchinput_gestures_nested_scroll_interop.xml b/compose/snippets/src/main/res/layout/touchinput_gestures_nested_scroll_interop.xml index bbc6128e..229f37a1 100644 --- a/compose/snippets/src/main/res/layout/touchinput_gestures_nested_scroll_interop.xml +++ b/compose/snippets/src/main/res/layout/touchinput_gestures_nested_scroll_interop.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 0b0b5355..05f11b4d 100644 --- a/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,22 +1,21 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 0b0b5355..05f11b4d 100644 --- a/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/compose/snippets/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,22 +1,21 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values-es/strings.xml b/compose/snippets/src/main/res/values-es/strings.xml index 3ba327f4..7287beb3 100644 --- a/compose/snippets/src/main/res/values-es/strings.xml +++ b/compose/snippets/src/main/res/values-es/strings.xml @@ -1,19 +1,19 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> snippets Golden Retriever in fall leaves @@ -53,4 +53,4 @@ Compras Perfil Esto es sólo un texto de marcador de posición. - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values/colors.xml b/compose/snippets/src/main/res/values/colors.xml index 0205675f..55242e03 100644 --- a/compose/snippets/src/main/res/values/colors.xml +++ b/compose/snippets/src/main/res/values/colors.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> #FFBB86FC #FF6200EE @@ -25,4 +24,4 @@ #FFFFFFFF #FFF #FFF - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values/dimens.xml b/compose/snippets/src/main/res/values/dimens.xml index d8dec063..99c6f584 100644 --- a/compose/snippets/src/main/res/values/dimens.xml +++ b/compose/snippets/src/main/res/values/dimens.xml @@ -1,20 +1,19 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> 8dp - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values/ids.xml b/compose/snippets/src/main/res/values/ids.xml index f97cf8a5..6cc94fcf 100644 --- a/compose/snippets/src/main/res/values/ids.xml +++ b/compose/snippets/src/main/res/values/ids.xml @@ -1,23 +1,22 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values/strings.xml b/compose/snippets/src/main/res/values/strings.xml index 02254e29..d4b9a63a 100644 --- a/compose/snippets/src/main/res/values/strings.xml +++ b/compose/snippets/src/main/res/values/strings.xml @@ -1,19 +1,19 @@ + + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> snippets Golden Retriever in fall leaves @@ -55,4 +55,4 @@ This is just a placeholder. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. - \ No newline at end of file + diff --git a/compose/snippets/src/main/res/values/themes.xml b/compose/snippets/src/main/res/values/themes.xml index 3d9f463c..9e731855 100644 --- a/compose/snippets/src/main/res/values/themes.xml +++ b/compose/snippets/src/main/res/values/themes.xml @@ -1,21 +1,20 @@ + Copyright 2023 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-->