Skip to content

Commit 8fb2abd

Browse files
authored
Merge branch 'main' into nav3
2 parents 2004c79 + 2e71c4f commit 8fb2abd

10 files changed

Lines changed: 92 additions & 37 deletions

File tree

.github/workflows/apply_spotless.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030

3131
steps:
3232
- name: Checkout Repository
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v6
3434
with:
3535
token: ${{ secrets.PAT || github.token }}
3636
fetch-depth: 0
3737

3838
- name: set up Java 17
39-
uses: actions/setup-java@v4
39+
uses: actions/setup-java@v5
4040
with:
4141
distribution: 'zulu'
4242
java-version: '17'

.github/workflows/build-ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
xcode-version: latest-stable
4040

4141
- name: Checkout
42-
uses: actions/checkout@v5
42+
uses: actions/checkout@v6
4343

4444
- name: Build iOS app
4545
uses: mxcl/xcodebuild@v3

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
timeout-minutes: 30
3030

3131
steps:
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v6
3333
with:
3434
token: ${{ secrets.PAT || github.token }}
3535
- name: set up Java 25
36-
uses: actions/setup-java@v4
36+
uses: actions/setup-java@v5
3737
with:
3838
distribution: 'zulu'
3939
java-version: '25'

.github/workflows/sync_main_latest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Syncing branches
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v4
14+
uses: actions/checkout@v6
1515

1616
- name: Set git config user
1717
run: git config user.email "compose-devrel-github-bot@google.com" && git config user.name "compose-devrel-github-bot"
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Create pull request
2323
id: cpr
24-
uses: peter-evans/create-pull-request@v7
24+
uses: peter-evans/create-pull-request@v8
2525
with:
2626
token: ${{ secrets.PAT }}
2727
commit-message: 🤖 Sync main to latest

.github/workflows/update_deps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111
- name: set up JDK 17
12-
uses: actions/setup-java@v4
12+
uses: actions/setup-java@v5
1313
with:
1414
java-version: 17
1515
distribution: 'zulu'
@@ -19,7 +19,7 @@ jobs:
1919
run: ./gradlew versionCatalogUpdate
2020
- name: Create pull request
2121
id: cpr
22-
uses: peter-evans/create-pull-request@v7
22+
uses: peter-evans/create-pull-request@v8
2323
with:
2424
token: ${{ secrets.PAT }}
2525
commit-message: 🤖 Update Dependencies

compose/snippets/src/main/java/com/example/compose/snippets/sideeffects/SideEffectsSnippets.kt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import androidx.compose.runtime.remember
4343
import androidx.compose.runtime.rememberCoroutineScope
4444
import androidx.compose.runtime.rememberUpdatedState
4545
import androidx.compose.runtime.setValue
46+
import androidx.compose.runtime.snapshotFlow
4647
import androidx.compose.ui.Modifier
4748
import androidx.lifecycle.Lifecycle
4849
import androidx.lifecycle.LifecycleEventObserver
@@ -52,6 +53,9 @@ import com.example.compose.snippets.interop.FirebaseAnalytics
5253
import com.example.compose.snippets.interop.User
5354
import com.example.compose.snippets.kotlin.Message
5455
import kotlinx.coroutines.delay
56+
import kotlinx.coroutines.flow.distinctUntilChanged
57+
import kotlinx.coroutines.flow.filter
58+
import kotlinx.coroutines.flow.map
5559
import kotlinx.coroutines.isActive
5660
import kotlinx.coroutines.launch
5761

@@ -263,3 +267,54 @@ fun DerivedStateOfWrongUsage() {
263267
val fullNameCorrect = "$firstName $lastName" // This is correct
264268
// [END android_compose_side_effects_derivedstateof_wrong]
265269
}
270+
271+
@Composable
272+
private fun SnapshotFlowExample() {
273+
// [START android_compose_side_effects_snapshotflow]
274+
val listState = rememberLazyListState()
275+
276+
LazyColumn(state = listState) {
277+
// ...
278+
}
279+
280+
LaunchedEffect(listState) {
281+
snapshotFlow { listState.firstVisibleItemIndex }
282+
.map { index -> index > 0 }
283+
.distinctUntilChanged()
284+
.filter { it == true }
285+
.collect {
286+
MyAnalyticsService.sendScrolledPastFirstItemEvent()
287+
}
288+
}
289+
// [END android_compose_side_effects_snapshotflow]
290+
}
291+
292+
private object MyAnalyticsService {
293+
fun sendScrolledPastFirstItemEvent() {}
294+
}
295+
296+
private object RestartingEffectsSnippet {
297+
// [START android_compose_side_effects_restarting_effects]
298+
@Composable
299+
fun HomeScreen(
300+
lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current,
301+
onStart: () -> Unit, // Send the 'started' analytics event
302+
onStop: () -> Unit // Send the 'stopped' analytics event
303+
) {
304+
// These values never change in Composition
305+
val currentOnStart by rememberUpdatedState(onStart)
306+
val currentOnStop by rememberUpdatedState(onStop)
307+
308+
DisposableEffect(lifecycleOwner) {
309+
val observer = LifecycleEventObserver { _, event ->
310+
/* ... */
311+
}
312+
313+
lifecycleOwner.lifecycle.addObserver(observer)
314+
onDispose {
315+
lifecycleOwner.lifecycle.removeObserver(observer)
316+
}
317+
}
318+
}
319+
// [END android_compose_side_effects_restarting_effects]
320+
}

datastore/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ dependencies {
106106
// [START android_datastore_proto_task]
107107
protobuf {
108108
protoc {
109-
artifact = "com.google.protobuf:protoc:4.32.1"
109+
artifact = "com.google.protobuf:protoc:4.34.0"
110110
}
111111
generateProtoTasks {
112112
all().forEach { task ->

gradle/libs.versions.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[versions]
22
accompanist = "0.36.0"
3-
activityKtx = "1.12.4"
3+
activityKtx = "1.13.0"
44
android-googleid = "1.2.0"
5-
androidGradlePlugin = "9.0.1"
6-
androidx-activity-compose = "1.12.4"
7-
androidx-appcompat = "1.7.0"
8-
androidx-appfunctions = "1.0.0-alpha07"
9-
androidx-compose-bom = "2026.02.01"
5+
androidGradlePlugin = "9.1.0"
6+
androidx-activity-compose = "1.13.0"
7+
androidx-appcompat = "1.7.1"
8+
androidx-appfunctions = "1.0.0-alpha08"
9+
androidx-compose-bom = "2026.03.00"
1010
androidx-compose-ui-test = "1.7.0-alpha08"
11-
androidx-compose-ui-test-junit4-accessibility = "1.11.0-alpha06"
11+
androidx-compose-ui-test-junit4-accessibility = "1.11.0-beta01"
1212
androidx-constraintlayout = "2.2.1"
1313
androidx-constraintlayout-compose = "1.1.1"
1414
androidx-coordinator-layout = "1.3.0"
15-
androidx-corektx = "1.17.0"
15+
androidx-corektx = "1.18.0"
1616
androidx-credentials = "1.6.0-rc02"
1717
androidx-credentials-play-services-auth = "1.6.0-rc02"
1818
androidx-emoji2-views = "1.6.0"
@@ -23,7 +23,7 @@ androidx-lifecycle-runtime-compose = "2.10.0"
2323
androidx-lifecycle-viewmodel-navigation3 = "2.10.0-beta01"
2424
androidx-navigation = "2.9.7"
2525
androidx-navigation3 = "1.1.0-beta01"
26-
androidx-paging = "3.4.1"
26+
androidx-paging = "3.4.2"
2727
androidx-startup-runtime = "1.2.0"
2828
androidx-test = "1.7.0"
2929
androidx-test-espresso = "3.7.0"
@@ -35,25 +35,25 @@ androidx-work-runtime = "2.11.1"
3535
androidx-xr-arcore = "1.0.0-alpha11"
3636
androidx-xr-arcore-play-services = "1.0.0-alpha11"
3737
androidx-xr-compose = "1.0.0-alpha11"
38-
androidx-xr-glimmer = "1.0.0-alpha07"
38+
androidx-xr-glimmer = "1.0.0-alpha08"
3939
androidx-xr-projected = "1.0.0-alpha05"
4040
androidx-xr-scenecore = "1.0.0-alpha12"
4141
androidxHiltNavigationCompose = "1.3.0"
4242
appcompat = "1.7.1"
4343
coil = "2.7.0"
4444
# @keep
4545
compileSdk = "36"
46-
compose-latest = "1.10.4"
46+
compose-latest = "1.10.5"
4747
composeUiTooling = "1.5.6"
4848
coreSplashscreen = "1.2.0"
4949
coroutines = "1.10.2"
50-
dataStore = "1.2.0"
51-
datastoreCore = "1.2.0"
52-
datastorePreferencesRxjava2 = "1.2.0"
53-
datastorePreferencesRxjava3 = "1.2.0"
50+
dataStore = "1.2.1"
51+
datastoreCore = "1.2.1"
52+
datastorePreferencesRxjava2 = "1.2.1"
53+
datastorePreferencesRxjava3 = "1.2.1"
5454
firebase-bom = "34.10.0"
5555
glide = "1.0.0-beta08"
56-
google-ar-core = "1.52.0"
56+
google-ar-core = "1.53.0"
5757
google-maps = "20.0.0"
5858
gradle-versions = "0.53.0"
5959
guava = "33.5.0-jre"
@@ -68,8 +68,8 @@ kotlinxSerialization = "1.10.0"
6868
ksp = "2.3.6"
6969
ktlint = "1.5.0"
7070
lifecycleService = "2.10.0"
71-
maps-compose = "8.2.0"
72-
material = "1.14.0-alpha09"
71+
maps-compose = "8.2.1"
72+
material = "1.14.0-alpha10"
7373
material3-adaptive = "1.2.0"
7474
material3-adaptive-navigation-suite = "1.4.0"
7575
material3-adaptive-navigation3 = "1.3.0-alpha09"
@@ -88,11 +88,11 @@ recyclerview = "1.4.0"
8888
registryDigitalCredentials = "1.0.0-alpha04"
8989
robolectric = "4.16.1"
9090
roborazzi = "1.59.0"
91-
spotless = "8.2.1"
91+
spotless = "8.3.0"
9292
targetSdk = "36"
9393
tiles = "1.5.0"
9494
tracing = "1.3.0"
95-
tvComposeMaterial3 = "1.1.0-alpha01"
95+
tvComposeMaterial3 = "1.1.0-beta01"
9696
validatorPush = "1.0.0-alpha09"
9797
version-catalog-update = "1.1.0"
9898
watchfaceComplicationsDataSourceKtx = "1.3.0"
@@ -106,7 +106,7 @@ wearPhoneInteractions = "1.1.0"
106106
wearRemoteInteractions = "1.2.0"
107107
wearToolingPreview = "1.0.0"
108108
webkit = "1.15.0"
109-
wfp = "1.0.0-beta01"
109+
wfp = "1.0.0-rc01"
110110

111111
[libraries]
112112
accompanist-adaptive = "com.google.accompanist:accompanist-adaptive:0.37.3"

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

misc/src/main/java/com/example/snippets/ai/AppFunctionsApiSnippets.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NoteFunctions(
3333
*
3434
* @param appFunctionContext The context in which the AppFunction is executed.
3535
*/
36-
@AppFunction(isDescribedByKdoc = true)
36+
@AppFunction(isDescribedByKDoc = true)
3737
suspend fun listNotes(appFunctionContext: AppFunctionContext): List<Note>? {
3838
return noteRepository.appNotes.ifEmpty { null }?.toList()
3939
}
@@ -45,7 +45,7 @@ class NoteFunctions(
4545
* @param title The title of the note.
4646
* @param content The note's content.
4747
*/
48-
@AppFunction(isDescribedByKdoc = true)
48+
@AppFunction(isDescribedByKDoc = true)
4949
suspend fun createNote(
5050
appFunctionContext: AppFunctionContext,
5151
title: String,
@@ -62,7 +62,7 @@ class NoteFunctions(
6262
* @param title The note's title if it should be updated.
6363
* @param content The new content if it should be updated.
6464
*/
65-
@AppFunction(isDescribedByKdoc = true)
65+
@AppFunction(isDescribedByKDoc = true)
6666
suspend fun editNote(
6767
appFunctionContext: AppFunctionContext,
6868
noteId: Int,
@@ -76,7 +76,7 @@ class NoteFunctions(
7676
/**
7777
* A note.
7878
*/
79-
@AppFunctionSerializable(isDescribedByKdoc = true)
79+
@AppFunctionSerializable(isDescribedByKDoc = true)
8080
data class Note(
8181
/** The note's identifier */
8282
val id: Int,

0 commit comments

Comments
 (0)