Skip to content

Commit f53cdc2

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions/checkout-5
2 parents b81fa97 + 7a0ebbe commit f53cdc2

File tree

13 files changed

+382
-41
lines changed

13 files changed

+382
-41
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/touchinput/focus/FocusSnippets.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ private fun RequestFocus2() {
297297
private fun Capture() {
298298
var text by remember { mutableStateOf("") }
299299
// [START android_compose_touchinput_focus_capture]
300-
val textField = FocusRequester()
300+
val textField = remember { FocusRequester() }
301301

302302
TextField(
303303
value = text,

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1212
# org.gradle.parallel=true
1313
#Mon May 22 14:59:56 BST 2023
14-
org.gradle.jvmargs=-Xmx2048m
14+
org.gradle.jvmargs=-Xmx4g
1515

1616
# Turn on parallel compilation, caching and on-demand configuration
1717
org.gradle.configureondemand=true

gradle/libs.versions.toml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,78 @@
22
accompanist = "0.36.0"
33
activityKtx = "1.10.1"
44
android-googleid = "1.1.1"
5-
androidGradlePlugin = "8.10.1"
5+
androidGradlePlugin = "8.12.1"
66
androidx-activity-compose = "1.10.1"
77
androidx-appcompat = "1.7.0"
8-
androidx-compose-bom = "2025.06.01"
8+
androidx-compose-bom = "2025.08.00"
99
androidx-compose-ui-test = "1.7.0-alpha08"
10-
androidx-compose-ui-test-junit4-accessibility = "1.9.0-beta01"
10+
androidx-compose-ui-test-junit4-accessibility = "1.10.0-alpha01"
1111
androidx-constraintlayout = "2.2.1"
1212
androidx-constraintlayout-compose = "1.1.1"
1313
androidx-coordinator-layout = "1.3.0"
14-
androidx-corektx = "1.16.0"
14+
androidx-corektx = "1.17.0"
1515
androidx-credentials = "1.5.0"
1616
androidx-credentials-play-services-auth = "1.5.0"
1717
androidx-emoji2-views = "1.5.0"
18-
androidx-fragment-ktx = "1.8.8"
18+
androidx-fragment-ktx = "1.8.9"
1919
androidx-glance-appwidget = "1.1.1"
20-
androidx-lifecycle-compose = "2.9.1"
21-
androidx-lifecycle-runtime-compose = "2.9.1"
22-
androidx-navigation = "2.9.0"
20+
androidx-lifecycle-compose = "2.9.2"
21+
androidx-lifecycle-runtime-compose = "2.9.2"
22+
androidx-navigation = "2.9.3"
2323
androidx-paging = "3.3.6"
2424
androidx-startup-runtime = "1.2.0"
25-
androidx-test = "1.6.1"
26-
androidx-test-espresso = "3.6.1"
27-
androidx-test-junit = "1.2.1"
28-
androidx-window = "1.5.0-alpha02"
29-
androidx-window-core = "1.5.0-alpha02"
30-
androidx-window-java = "1.5.0-alpha02"
25+
androidx-test = "1.7.0"
26+
androidx-test-espresso = "3.7.0"
27+
androidx-test-junit = "1.3.0"
28+
androidx-window = "1.5.0-beta02"
29+
androidx-window-core = "1.5.0-beta02"
30+
androidx-window-java = "1.5.0-beta02"
3131
androidx-xr-arcore = "1.0.0-alpha05"
32-
androidx-xr-scenecore = "1.0.0-alpha05"
33-
androidx-xr-compose = "1.0.0-alpha05"
32+
androidx-xr-compose = "1.0.0-alpha06"
33+
androidx-xr-scenecore = "1.0.0-alpha06"
3434
androidxHiltNavigationCompose = "1.2.0"
3535
appcompat = "1.7.1"
3636
coil = "2.7.0"
3737
# @keep
38-
compileSdk = "35"
39-
compose-latest = "1.8.3"
38+
compileSdk = "36"
39+
compose-latest = "1.9.0"
4040
composeUiTooling = "1.4.1"
4141
coreSplashscreen = "1.0.1"
4242
coroutines = "1.10.2"
4343
glide = "1.0.0-beta01"
4444
google-maps = "19.2.0"
4545
gradle-versions = "0.52.0"
4646
guava = "33.4.8-jre"
47-
hilt = "2.56.2"
48-
horologist = "0.7.14-beta"
47+
hilt = "2.57"
48+
horologist = "0.8.1-alpha"
4949
junit = "4.13.2"
50-
kotlin = "2.2.0"
50+
kotlin = "2.2.10"
5151
kotlinCoroutinesOkhttp = "1.0"
5252
kotlinxCoroutinesGuava = "1.10.2"
53-
kotlinxSerializationJson = "1.8.1"
54-
ksp = "2.1.21-2.0.2"
55-
lifecycleService = "2.9.1"
56-
maps-compose = "6.6.0"
57-
material = "1.14.0-alpha02"
53+
kotlinxSerializationJson = "1.9.0"
54+
ksp = "2.2.10-2.0.2"
55+
lifecycleService = "2.9.2"
56+
maps-compose = "6.7.2"
57+
material = "1.14.0-alpha03"
5858
material3-adaptive = "1.1.0"
5959
material3-adaptive-navigation-suite = "1.3.2"
6060
media3 = "1.8.0"
6161
# @keep
6262
minSdk = "35"
63-
okHttp = "4.12.0"
63+
okHttp = "5.1.0"
6464
playServicesWearable = "19.0.0"
6565
protolayout = "1.3.0"
6666
recyclerview = "1.4.0"
6767
targetSdk = "35"
6868
tiles = "1.5.0"
6969
tracing = "1.3.0"
70-
validatorPush = "1.0.0-alpha03"
70+
validatorPush = "1.0.0-alpha06"
7171
version-catalog-update = "1.0.0"
72+
watchfaceComplicationsDataSourceKtx = "1.2.1"
7273
wear = "1.3.0"
73-
wearComposeFoundation = "1.5.0-beta04"
74-
wearComposeMaterial = "1.5.0-beta04"
75-
wearComposeMaterial3 = "1.5.0-beta04"
74+
wearComposeFoundation = "1.5.0-rc02"
75+
wearComposeMaterial = "1.5.0-rc02"
76+
wearComposeMaterial3 = "1.5.0-rc02"
7677
wearOngoing = "1.0.0"
7778
wearToolingPreview = "1.0.0"
7879
webkit = "1.14.0"
@@ -144,21 +145,22 @@ androidx-startup-runtime = { module = "androidx.startup:startup-runtime", versio
144145
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
145146
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
146147
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-junit" }
147-
androidx-test-runner = "androidx.test:runner:1.6.2"
148+
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
148149
androidx-tiles = { module = "androidx.wear.tiles:tiles", version.ref = "tiles" }
149150
androidx-tiles-renderer = { module = "androidx.wear.tiles:tiles-renderer", version.ref = "tiles" }
150151
androidx-tiles-testing = { module = "androidx.wear.tiles:tiles-testing", version.ref = "tiles" }
151152
androidx-tiles-tooling = { module = "androidx.wear.tiles:tiles-tooling", version.ref = "tiles" }
152153
androidx-tiles-tooling-preview = { module = "androidx.wear.tiles:tiles-tooling-preview", version.ref = "tiles" }
153-
androidx-tracing = { group = "androidx.tracing", name = "tracing", version.ref = "tracing" }
154+
androidx-tracing = { module = "androidx.tracing:tracing", version.ref = "tracing" }
155+
androidx-watchface-complications-data-source-ktx = { module = "androidx.wear.watchface:watchface-complications-data-source-ktx", version.ref = "watchfaceComplicationsDataSourceKtx" }
154156
androidx-wear = { module = "androidx.wear:wear", version.ref = "wear" }
155157
androidx-wear-ongoing = { module = "androidx.wear:wear-ongoing", version.ref = "wearOngoing" }
156158
androidx-wear-tooling-preview = { module = "androidx.wear:wear-tooling-preview", version.ref = "wearToolingPreview" }
157159
androidx-webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" }
158160
androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" }
159161
androidx-window-core = { module = "androidx.window:window-core", version.ref = "androidx-window-core" }
160162
androidx-window-java = { module = "androidx.window:window-java", version.ref = "androidx-window-java" }
161-
androidx-work-runtime-ktx = "androidx.work:work-runtime-ktx:2.10.2"
163+
androidx-work-runtime-ktx = "androidx.work:work-runtime-ktx:2.10.3"
162164
androidx-xr-arcore = { module = "androidx.xr.arcore:arcore", version.ref = "androidx-xr-arcore" }
163165
androidx-xr-compose = { module = "androidx.xr.compose:compose", version.ref = "androidx-xr-compose" }
164166
androidx-xr-scenecore = { module = "androidx.xr.scenecore:scenecore", version.ref = "androidx-xr-scenecore" }
@@ -194,7 +196,7 @@ android-library = { id = "com.android.library", version.ref = "androidGradlePlug
194196
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
195197
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
196198
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
197-
kotlin-android = "org.jetbrains.kotlin.android:2.2.0"
199+
kotlin-android = "org.jetbrains.kotlin.android:2.2.10"
198200
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
199201
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
200202
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pluginManagement {
77
mavenCentral()
88
}
99
}
10+
plugins {
11+
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
12+
}
1013
dependencyResolutionManagement {
1114
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
1215
repositories {

wear/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ dependencies {
8585
implementation(libs.horologist.compose.layout)
8686
implementation(libs.horologist.compose.material)
8787
implementation(libs.androidx.material.icons.core)
88+
implementation(libs.androidx.watchface.complications.data.source.ktx)
89+
8890
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
8991
debugImplementation(libs.androidx.compose.ui.tooling)
9092
debugImplementation(libs.androidx.compose.ui.tooling.preview)

wear/src/main/AndroidManifest.xml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,68 @@
201201
android:value="For Ongoing Activity"/>
202202
</service>
203203

204+
<!-- [START android_wear_complication_manifest] -->
205+
<service
206+
android:name=".snippets.complication.MyComplicationDataSourceService"
207+
android:exported="true"
208+
android:label="@string/my_complication_service_label"
209+
android:icon="@drawable/complication_icon"
210+
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
211+
<intent-filter>
212+
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST" />
213+
</intent-filter>
214+
215+
<!-- Supported types should be comma-separated, for example: "SHORT_TEXT,SMALL_IMAGE" -->
216+
<meta-data
217+
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
218+
android:value="SHORT_TEXT" />
219+
<meta-data
220+
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
221+
android:value="300" />
222+
223+
<!-- Optionally, specify a configuration activity, where the user can configure your complication. -->
224+
<meta-data
225+
android:name="android.support.wearable.complications.PROVIDER_CONFIG_ACTION"
226+
android:value="MY_CONFIG_ACTION" />
227+
228+
</service>
229+
<!-- [END android_wear_complication_manifest] -->
230+
231+
<!-- [START android_wear_timeline_complication_manifest] -->
232+
<service
233+
android:name=".snippets.complication.MyTimelineComplicationDataSourceService"
234+
android:exported="true"
235+
android:label="@string/my_complication_timeline_service_label"
236+
android:icon="@drawable/complication_icon"
237+
android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
238+
<intent-filter>
239+
<action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST" />
240+
</intent-filter>
241+
242+
<meta-data
243+
android:name="android.support.wearable.complications.SUPPORTED_TYPES"
244+
android:value="SHORT_TEXT" />
245+
<meta-data
246+
android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS"
247+
android:value="300" />
248+
</service>
249+
<!-- [END android_wear_timeline_complication_manifest] -->
250+
251+
<activity
252+
android:name=".snippets.complication.ConfigurationActivity"
253+
android:label="@string/configuration_activity_label"
254+
android:exported="true"
255+
android:taskAffinity=""
256+
android:theme="@android:style/Theme.DeviceDefault">
257+
<!-- [START android_wear_complication_intent_filter] -->
258+
<intent-filter>
259+
<action android:name="MY_CONFIG_ACTION" />
260+
<category android:name="android.support.wearable.complications.category.PROVIDER_CONFIG" />
261+
<category android:name="android.intent.category.DEFAULT" />
262+
</intent-filter>
263+
<!-- [END android_wear_complication_intent_filter] -->
264+
</activity>
265+
204266
</application>
205267

206-
</manifest>
268+
</manifest>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.wear.snippets.complication
18+
19+
import android.os.Bundle
20+
import androidx.activity.ComponentActivity
21+
import androidx.activity.compose.setContent
22+
import androidx.compose.foundation.layout.Arrangement
23+
import androidx.compose.foundation.layout.Column
24+
import androidx.compose.foundation.layout.Spacer
25+
import androidx.compose.foundation.layout.fillMaxSize
26+
import androidx.compose.foundation.layout.height
27+
import androidx.compose.runtime.Composable
28+
import androidx.compose.ui.Alignment
29+
import androidx.compose.ui.Modifier
30+
import androidx.compose.ui.unit.dp
31+
import androidx.wear.compose.material3.Button
32+
import androidx.wear.compose.material3.Text
33+
import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion.EXTRA_CONFIG_COMPLICATION_ID
34+
import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion.EXTRA_CONFIG_COMPLICATION_TYPE
35+
import androidx.wear.watchface.complications.datasource.ComplicationDataSourceService.Companion.EXTRA_CONFIG_DATA_SOURCE_COMPONENT
36+
37+
class ConfigurationActivity : ComponentActivity() {
38+
override fun onCreate(savedInstanceState: Bundle?) {
39+
super.onCreate(savedInstanceState)
40+
// [START android_wear_complication_configuration_intent]
41+
// Keys defined on ComplicationDataSourceService
42+
val id = intent.getIntExtra(EXTRA_CONFIG_COMPLICATION_ID, -1)
43+
val type = intent.getIntExtra(EXTRA_CONFIG_COMPLICATION_TYPE, -1)
44+
val source = intent.getStringExtra(EXTRA_CONFIG_DATA_SOURCE_COMPONENT)
45+
// [END android_wear_complication_configuration_intent]
46+
setContent {
47+
ComplicationConfig(
48+
id = id,
49+
type = type,
50+
source = source
51+
)
52+
}
53+
}
54+
55+
@Composable
56+
fun ComplicationConfig(
57+
modifier: Modifier = Modifier,
58+
id: Int,
59+
type: Int,
60+
source: String?
61+
) {
62+
Column(
63+
modifier = Modifier.fillMaxSize(),
64+
verticalArrangement = Arrangement.SpaceEvenly,
65+
horizontalAlignment = Alignment.CenterHorizontally
66+
) {
67+
Text("ID: $id")
68+
Text("Type: $type")
69+
Text("Source: $source")
70+
Spacer(modifier = Modifier.height(4.dp))
71+
Button(onClick = {
72+
// [START android_wear_complication_configuration_finish]
73+
setResult(RESULT_OK) // Or RESULT_CANCELED to cancel configuration
74+
finish()
75+
// [END android_wear_complication_configuration_finish]
76+
}) {
77+
Text("Done!")
78+
}
79+
}
80+
}
81+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.example.wear.snippets.complication
18+
19+
import androidx.wear.watchface.complications.data.ComplicationData
20+
import androidx.wear.watchface.complications.data.ComplicationType
21+
import androidx.wear.watchface.complications.data.PlainComplicationText
22+
import androidx.wear.watchface.complications.data.ShortTextComplicationData
23+
import androidx.wear.watchface.complications.datasource.ComplicationRequest
24+
import androidx.wear.watchface.complications.datasource.SuspendingComplicationDataSourceService
25+
26+
// [START android_wear_complication]
27+
class MyComplicationDataSourceService : SuspendingComplicationDataSourceService() {
28+
override suspend fun onComplicationRequest(request: ComplicationRequest): ComplicationData? {
29+
// Retrieve the latest info for inclusion in the data.
30+
val text = getLatestData()
31+
return shortTextComplicationData(text)
32+
}
33+
34+
override fun getPreviewData(type: ComplicationType): ComplicationData? {
35+
return shortTextComplicationData("Event 1")
36+
}
37+
38+
private fun shortTextComplicationData(text: String) =
39+
ShortTextComplicationData.Builder(
40+
text = PlainComplicationText.Builder(text).build(),
41+
contentDescription = PlainComplicationText.Builder(text).build()
42+
)
43+
// Add further optional details here such as icon, tap action, and title.
44+
.build()
45+
46+
// [START_EXCLUDE]
47+
private fun getLatestData() = "Test"
48+
// [END_EXCLUDE]
49+
}
50+
// [END android_wear_complication]

0 commit comments

Comments
 (0)