Skip to content

Commit a3db529

Browse files
authored
Merge branch 'main' into cartland/refactor-composable-naming
2 parents db5f345 + a73d3b4 commit a3db529

File tree

46 files changed

+1390
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1390
-831
lines changed

.github/workflows/apply_spotless.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,7 @@ jobs:
4242
java-version: '17'
4343

4444
- name: Run spotlessApply
45-
run: ./gradlew :compose:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
46-
47-
- name: Run spotlessApply for Wear
48-
run: ./gradlew :wear:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
49-
50-
- name: Run spotlessApply for Misc
51-
run: ./gradlew :misc:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
52-
53-
- name: Run spotlessApply for XR
54-
run: ./gradlew :xr:spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
45+
run: ./gradlew spotlessApply --init-script gradle/init.gradle.kts --no-configuration-cache --stacktrace
5546

5647
- name: Auto-commit if spotlessApply has changes
5748
uses: stefanzweifel/git-auto-commit-action@v5

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/.idea/modules.xml
77
/.idea/workspace.xml
88
.DS_Store
9-
/build
9+
build
1010
/captures
1111
.externalNativeBuild
1212
.idea/*

compose/snippets/src/main/java/com/example/compose/snippets/components/SearchBar.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@ fun CustomizableSearchBar(
178178
onSearch: (String) -> Unit,
179179
searchResults: List<String>,
180180
onResultClick: (String) -> Unit,
181+
modifier: Modifier = Modifier,
181182
// Customization options
182183
placeholder: @Composable () -> Unit = { Text("Search") },
183184
leadingIcon: @Composable (() -> Unit)? = { Icon(Icons.Default.Search, contentDescription = "Search") },
184185
trailingIcon: @Composable (() -> Unit)? = null,
185186
supportingContent: (@Composable (String) -> Unit)? = null,
186187
leadingContent: (@Composable () -> Unit)? = null,
187-
modifier: Modifier = Modifier
188188
) {
189189
// Track expanded state of search bar
190190
var expanded by rememberSaveable { mutableStateOf(false) }

compose/snippets/src/main/java/com/example/compose/snippets/text/StateBasedText.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616

1717
package com.example.compose.snippets.text
18-
19-
import android.text.TextUtils
2018
import androidx.compose.foundation.layout.Column
2119
import androidx.compose.foundation.layout.Spacer
2220
import androidx.compose.foundation.layout.height
@@ -249,7 +247,7 @@ class CustomInputTransformation : InputTransformation {
249247
// [START android_compose_state_text_16]
250248
class DigitOnlyInputTransformation : InputTransformation {
251249
override fun TextFieldBuffer.transformInput() {
252-
if (!TextUtils.isDigitsOnly(asCharSequence())) {
250+
if (!asCharSequence().isDigitsOnly()) {
253251
revertAllChanges()
254252
}
255253
}

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" }

identity/credentialmanager/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ android {
3939
buildFeatures {
4040
compose = true
4141
}
42+
sourceSets {
43+
named("main") {
44+
java {
45+
srcDir("src/main/java")
46+
}
47+
}
48+
}
4249
}
4350

4451
dependencies {
Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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+
117
package com.example.identity.credentialmanager
218

319
import android.app.Activity
@@ -13,39 +29,39 @@ import androidx.credentials.exceptions.GetCredentialException
1329

1430
// This class is mostly copied from https://github.com/android/identity-samples/blob/main/WebView/CredentialManagerWebView/CredentialManagerHandler.kt.
1531
class CredentialManagerHandler(private val activity: Activity) {
16-
private val mCredMan = CredentialManager.create(activity.applicationContext)
17-
private val TAG = "CredentialManagerHandler"
18-
/**
19-
* Encapsulates the create passkey API for credential manager in a less error-prone manner.
20-
*
21-
* @param request a create public key credential request JSON required by [CreatePublicKeyCredentialRequest].
22-
* @return [CreatePublicKeyCredentialResponse] containing the result of the credential creation.
23-
*/
24-
suspend fun createPasskey(request: String): CreatePublicKeyCredentialResponse {
25-
val createRequest = CreatePublicKeyCredentialRequest(request)
26-
try {
27-
return mCredMan.createCredential(activity, createRequest) as CreatePublicKeyCredentialResponse
28-
} catch (e: CreateCredentialException) {
29-
// For error handling use guidance from https://developer.android.com/training/sign-in/passkeys
30-
Log.i(TAG, "Error creating credential: ErrMessage: ${e.errorMessage}, ErrType: ${e.type}")
31-
throw e
32+
private val mCredMan = CredentialManager.create(activity.applicationContext)
33+
private val TAG = "CredentialManagerHandler"
34+
/**
35+
* Encapsulates the create passkey API for credential manager in a less error-prone manner.
36+
*
37+
* @param request a create public key credential request JSON required by [CreatePublicKeyCredentialRequest].
38+
* @return [CreatePublicKeyCredentialResponse] containing the result of the credential creation.
39+
*/
40+
suspend fun createPasskey(request: String): CreatePublicKeyCredentialResponse {
41+
val createRequest = CreatePublicKeyCredentialRequest(request)
42+
try {
43+
return mCredMan.createCredential(activity, createRequest) as CreatePublicKeyCredentialResponse
44+
} catch (e: CreateCredentialException) {
45+
// For error handling use guidance from https://developer.android.com/training/sign-in/passkeys
46+
Log.i(TAG, "Error creating credential: ErrMessage: ${e.errorMessage}, ErrType: ${e.type}")
47+
throw e
48+
}
3249
}
33-
}
3450

35-
/**
36-
* Encapsulates the get passkey API for credential manager in a less error-prone manner.
37-
*
38-
* @param request a get public key credential request JSON required by [GetCredentialRequest].
39-
* @return [GetCredentialResponse] containing the result of the credential retrieval.
40-
*/
41-
suspend fun getPasskey(request: String): GetCredentialResponse {
42-
val getRequest = GetCredentialRequest(listOf(GetPublicKeyCredentialOption(request, null)))
43-
try {
44-
return mCredMan.getCredential(activity, getRequest)
45-
} catch (e: GetCredentialException) {
46-
// For error handling use guidance from https://developer.android.com/training/sign-in/passkeys
47-
Log.i(TAG, "Error retrieving credential: ${e.message}")
48-
throw e
51+
/**
52+
* Encapsulates the get passkey API for credential manager in a less error-prone manner.
53+
*
54+
* @param request a get public key credential request JSON required by [GetCredentialRequest].
55+
* @return [GetCredentialResponse] containing the result of the credential retrieval.
56+
*/
57+
suspend fun getPasskey(request: String): GetCredentialResponse {
58+
val getRequest = GetCredentialRequest(listOf(GetPublicKeyCredentialOption(request, null)))
59+
try {
60+
return mCredMan.getCredential(activity, getRequest)
61+
} catch (e: GetCredentialException) {
62+
// For error handling use guidance from https://developer.android.com/training/sign-in/passkeys
63+
Log.i(TAG, "Error retrieving credential: ${e.message}")
64+
throw e
65+
}
4966
}
50-
}
5167
}

0 commit comments

Comments
 (0)