Skip to content

Commit d7de2a6

Browse files
authored
Merge branch 'main' into feature/xr/wrap-up
2 parents 5270b44 + 70e3cd7 commit d7de2a6

File tree

32 files changed

+712
-288
lines changed

32 files changed

+712
-288
lines changed

.google/packaging.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (C) 2025 The Android Open Source Project
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# GOOGLE SAMPLE PACKAGING DATA
16+
#
17+
# This file is used by Google as part of our samples packaging process.
18+
# End users may safely ignore this file. It has no relevance to other systems.
19+
---
20+
status: PUBLISHED
21+
technologies: [Android, AI, XR, JetpackCompose]
22+
categories:
23+
- Jetpack
24+
- Artificial Intelligence
25+
- Machine Learning
26+
- Jetpack Compose Layouts
27+
- Wear OS
28+
- Android XR
29+
languages: [Kotlin]
30+
solutions:
31+
- Mobile
32+
- XR
33+
- Wear
34+
github: android/androidify
35+
level: INTERMEDIATE
36+
apiRefs:
37+
- android:androidx.compose.Composable
38+
license: apache2

app/src/main/res/values/wear.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2025 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
https://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@array/android_wear_capabilities">
18+
<string-array name="android_wear_capabilities">
19+
<item>androidify_phone</item>
20+
</string-array>
21+
</resources>

core/testing/src/main/java/com/android/developers/testing/repository/FakeWatchFaceInstallationRepository.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ class FakeWatchFaceInstallationRepository : WatchFaceInstallationRepository {
7575
_watchFaceInstallationStatus.value = WatchFaceInstallationStatus.NotStarted
7676
}
7777

78+
override suspend fun prepareForTransfer() {
79+
transferId = generateTransferId()
80+
_watchFaceInstallationStatus.value = WatchFaceInstallationStatus.Preparing
81+
}
82+
7883
private fun generateTransferId() = UUID.randomUUID().toString().take(8)
7984

8085
public fun setWatchAsConnected() {

feature/results/src/androidTest/java/com/android/developers/androidify/results/ResultsScreenTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ class ResultsScreenTest {
190190
val configProvider = ConfigProvider(TestRemoteConfigDataSource(false))
191191
val viewModel = ResultsViewModel(testUri, originalImageUrl = testUri, null, configProvider)
192192

193-
194193
composeTestRule.setContent {
195194
// Disable animation
196195
SharedElementContextPreview {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.android.developers.androidify.customize
17+
18+
import androidx.compose.runtime.Composable
19+
import androidx.xr.compose.platform.LocalSpatialCapabilities
20+
import com.android.developers.androidify.util.isAtLeastMedium
21+
22+
enum class CustomizeExportLayoutType {
23+
Compact,
24+
Medium,
25+
Spatial,
26+
}
27+
28+
@Composable
29+
fun calculateLayoutType(enableXr: Boolean = false): CustomizeExportLayoutType {
30+
return when {
31+
LocalSpatialCapabilities.current.isSpatialUiEnabled && enableXr -> CustomizeExportLayoutType.Spatial
32+
isAtLeastMedium() -> CustomizeExportLayoutType.Medium
33+
else -> CustomizeExportLayoutType.Compact
34+
}
35+
}

0 commit comments

Comments
 (0)