diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72e815a31..1d3c201ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,11 +32,11 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.PAT || github.token }} - - name: set up Java 17 + - name: set up Java 25 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '17' + java-version: '25' - name: Build All run: ./gradlew build --stacktrace - name: Build Watch Face Push validation snippets diff --git a/build.gradle.kts b/build.gradle.kts index cc4d7876a..08912624e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,6 @@ +import org.codehaus.groovy.runtime.DefaultGroovyMethods.step +import org.jetbrains.kotlin.gradle.internal.builtins.StandardNames.FqNames.target + // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { alias(libs.plugins.gradle.versions) @@ -85,7 +88,7 @@ allprojects { } kotlinGradle { target("**/*.kts") - targetExclude("**/build/**/*.kts") + targetExclude("**/build/**/*.kts", "spotless/**/*.kts") // Look for the first line that doesn't have a block comment (assumed to be the license) licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)") } diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/components/AppBar.kt b/compose/snippets/src/main/java/com/example/compose/snippets/components/AppBar.kt index 354efe635..72b4586a0 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/components/AppBar.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/components/AppBar.kt @@ -218,7 +218,7 @@ fun CenterAlignedTopAppBarExample() { topBar = { CenterAlignedTopAppBar( - colors = TopAppBarDefaults.centerAlignedTopAppBarColors( + colors = TopAppBarDefaults.topAppBarColors( containerColor = MaterialTheme.colorScheme.primaryContainer, titleContentColor = MaterialTheme.colorScheme.primary, ), @@ -431,6 +431,7 @@ fun AppBarSelectionActions( } } }, + modifier = modifier ) } // [END android_compose_components_appbarselectionactions] @@ -454,6 +455,7 @@ private fun AppBarMultiSelectionExample( var selectedItems by rememberSaveable { mutableStateOf(setOf()) } Scaffold( + modifier = modifier, topBar = { AppBarSelectionActions(selectedItems) } ) { innerPadding -> LazyColumn(contentPadding = innerPadding) { @@ -517,7 +519,8 @@ fun LazyListMultiSelection( ) { var selectedItems by rememberSaveable { mutableStateOf(setOf()) } - LazyColumn(contentPadding = contentPadding) { + LazyColumn(modifier = modifier, + contentPadding = contentPadding) { itemsIndexed(listItems) { _, index -> val selected = selectedItems.contains(index) ListItemSelectable( diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt b/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt index 692199123..4d59ea4ef 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/components/DatePickers.kt @@ -57,7 +57,7 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Popup -import com.example.compose.snippets.touchinput.userinteractions.MyAppTheme +import com.example.compose.snippets.ui.theme.SnippetsTheme import java.text.SimpleDateFormat import java.util.Date import java.util.Locale @@ -65,7 +65,7 @@ import java.util.Locale @Preview @Composable private fun DatePickerPreview() { - MyAppTheme { + SnippetsTheme { DatePickerExamples() } } diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/components/PullToRefreshBox.kt b/compose/snippets/src/main/java/com/example/compose/snippets/components/PullToRefreshBox.kt index 81280151a..347baa806 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/components/PullToRefreshBox.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/components/PullToRefreshBox.kt @@ -36,7 +36,7 @@ import androidx.compose.material3.pulltorefresh.PullToRefreshDefaults import androidx.compose.material3.pulltorefresh.PullToRefreshDefaults.Indicator import androidx.compose.material3.pulltorefresh.PullToRefreshDefaults.PositionalThreshold import androidx.compose.material3.pulltorefresh.PullToRefreshState -import androidx.compose.material3.pulltorefresh.pullToRefreshIndicator +import androidx.compose.material3.pulltorefresh.pullToRefresh import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -187,11 +187,13 @@ fun MyCustomIndicator( modifier: Modifier = Modifier, ) { Box( - modifier = modifier.pullToRefreshIndicator( + modifier = modifier.pullToRefresh( state = state, isRefreshing = isRefreshing, - containerColor = PullToRefreshDefaults.containerColor, - threshold = PositionalThreshold + threshold = PositionalThreshold, + onRefresh = { + + } ), contentAlignment = Alignment.Center ) { diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/components/Tooltips.kt b/compose/snippets/src/main/java/com/example/compose/snippets/components/Tooltips.kt index 1066d0cfb..9a034e261 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/components/Tooltips.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/components/Tooltips.kt @@ -166,7 +166,6 @@ fun AdvancedRichTooltipExample( } } }, - caretSize = DpSize(32.dp, 16.dp) ) { Text(richTooltipText) } diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/designsystems/Mdc3ThemeSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/designsystems/Mdc3ThemeSnippets.kt deleted file mode 100644 index 5e3e4000f..000000000 --- a/compose/snippets/src/main/java/com/example/compose/snippets/designsystems/Mdc3ThemeSnippets.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2022 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. - */ - -package com.example.compose.snippets.designsystems - -import android.os.Bundle -import androidx.activity.compose.setContent -import androidx.appcompat.app.AppCompatActivity -// [START android_compose_designsystems_interop_mdc3theme] -import com.google.accompanist.themeadapter.material3.Mdc3Theme - -class Mdc3ThemeExample : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - // Use Mdc3Theme instead of M3 MaterialTheme - // Color scheme, typography, and shapes have been read from the - // View-based theme used in this Activity - setContent { - Mdc3Theme { - // Your app-level composable here - } - } - } -} -// [END android_compose_designsystems_interop_mdc3theme] diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/interop/MigrationCommonScenariosSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/interop/MigrationCommonScenariosSnippets.kt index 59ac0129d..fec60d697 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/interop/MigrationCommonScenariosSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/interop/MigrationCommonScenariosSnippets.kt @@ -58,7 +58,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.ComposeView import androidx.compose.ui.unit.dp import androidx.fragment.app.Fragment -import androidx.hilt.navigation.compose.hiltViewModel +import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.lifecycle.ViewModel import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/FlowLayoutSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/FlowLayoutSnippets.kt index 60e795874..8c682a601 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/FlowLayoutSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/FlowLayoutSnippets.kt @@ -21,9 +21,6 @@ import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.ContextualFlowRow -import androidx.compose.foundation.layout.ContextualFlowRowOverflow -import androidx.compose.foundation.layout.ContextualFlowRowOverflowScope import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowColumn import androidx.compose.foundation.layout.FlowRow @@ -33,22 +30,13 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.safeDrawingPadding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.verticalScroll import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material3.FilterChip import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableIntStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color @@ -465,48 +453,6 @@ fun FlowLayout_FractionalSizing() { // [END android_compose_flow_layout_fractional_sizing] } -@OptIn(ExperimentalLayoutApi::class) -@Preview -@Composable -fun ContextualFlowLayoutExample() { - // [START android_compose_layouts_contextual_flow] - val totalCount = 40 - var maxLines by remember { - mutableIntStateOf(2) - } - - val moreOrCollapseIndicator = @Composable { scope: ContextualFlowRowOverflowScope -> - val remainingItems = totalCount - scope.shownItemCount - ChipItem(if (remainingItems == 0) "Less" else "+$remainingItems", onClick = { - if (remainingItems == 0) { - maxLines = 2 - } else { - maxLines += 5 - } - }) - } - ContextualFlowRow( - modifier = Modifier - .safeDrawingPadding() - .fillMaxWidth(1f) - .padding(16.dp) - .wrapContentHeight(align = Alignment.Top) - .verticalScroll(rememberScrollState()), - verticalArrangement = Arrangement.spacedBy(4.dp), - horizontalArrangement = Arrangement.spacedBy(8.dp), - maxLines = maxLines, - overflow = ContextualFlowRowOverflow.expandOrCollapseIndicator( - minRowsToShowCollapse = 4, - expandIndicator = moreOrCollapseIndicator, - collapseIndicator = moreOrCollapseIndicator - ), - itemCount = totalCount - ) { index -> - ChipItem("Item $index") - } - // [END android_compose_layouts_contextual_flow] -} - @OptIn(ExperimentalLayoutApi::class) @Preview @Composable diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/PagerSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/PagerSnippets.kt index 899163367..e09fe456d 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/PagerSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/PagerSnippets.kt @@ -50,8 +50,8 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Button import androidx.compose.material3.Card import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.PrimaryTabRow import androidx.compose.material3.Tab -import androidx.compose.material3.TabRow import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -239,7 +239,7 @@ fun PagerWithTabsExample() { pages.size }) - TabRow( + PrimaryTabRow( // Our selected tab is our current page selectedTabIndex = pagerState.currentPage, ) { diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/resources/ResourcesSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/resources/ResourcesSnippets.kt index 0a2f34a56..f964e352d 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/resources/ResourcesSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/resources/ResourcesSnippets.kt @@ -26,6 +26,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Menu import androidx.compose.material3.Divider +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -109,7 +110,7 @@ fun Colors() { // #FFBB86FC // In your Compose code - Divider(color = colorResource(R.color.purple_200)) + HorizontalDivider(color = colorResource(R.color.purple_200)) // [END android_compose_resources_colors] } diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/state/StateHoistingSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/state/StateHoistingSnippets.kt index 2a4f0c949..2e607fde9 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/state/StateHoistingSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/state/StateHoistingSnippets.kt @@ -18,6 +18,8 @@ package com.example.compose.snippets.state +import android.R.id.message +import androidx.compose.foundation.clickable import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.items @@ -34,7 +36,13 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow +import androidx.compose.ui.Modifier import androidx.compose.ui.text.AnnotatedString +import androidx.compose.ui.text.LinkAnnotation +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.TextLinkStyles +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.withLink import androidx.lifecycle.ViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewModelScope @@ -60,9 +68,11 @@ private object StateHoistingSnippets1 { ) { var showDetails by rememberSaveable { mutableStateOf(false) } // Define the UI element expanded state - ClickableText( + Text( text = AnnotatedString(message.content), - onClick = { showDetails = !showDetails } // Apply simple UI logic + modifier = Modifier.clickable { + showDetails = !showDetails // Apply UI logic + } ) if (showDetails) { diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/touchinput/userinteractions/UserInteractions.kt b/compose/snippets/src/main/java/com/example/compose/snippets/touchinput/userinteractions/UserInteractions.kt index 12de9f923..6b9fa3fda 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/touchinput/userinteractions/UserInteractions.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/touchinput/userinteractions/UserInteractions.kt @@ -37,7 +37,6 @@ import androidx.compose.material.ripple.RippleAlpha import androidx.compose.material.ripple.RippleTheme import androidx.compose.material.ripple.rememberRipple import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.LocalUseFallbackRippleImplementation import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider @@ -240,28 +239,6 @@ private class ScaleIndicationNode( fun App() { } -@OptIn(ExperimentalMaterial3Api::class) -@Composable -private fun LocalUseFallbackRippleImplementationExample() { -// [START android_compose_userinteractions_localusefallbackrippleimplementation] - CompositionLocalProvider(LocalUseFallbackRippleImplementation provides true) { - MaterialTheme { - App() - } - } -// [END android_compose_userinteractions_localusefallbackrippleimplementation] -} - -// [START android_compose_userinteractions_localusefallbackrippleimplementation_app_theme] -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun MyAppTheme(content: @Composable () -> Unit) { - CompositionLocalProvider(LocalUseFallbackRippleImplementation provides true) { - MaterialTheme(content = content) - } -} -// [END android_compose_userinteractions_localusefallbackrippleimplementation_app_theme] - @OptIn(ExperimentalMaterialApi::class) @Composable private fun MyComposableDisabledRippleConfig() { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d02cdf75e..0d03a91a0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,63 +1,63 @@ [versions] accompanist = "0.36.0" -activityKtx = "1.10.1" +activityKtx = "1.11.0" android-googleid = "1.1.1" -androidGradlePlugin = "8.12.1" -androidx-activity-compose = "1.10.1" +androidGradlePlugin = "8.13.0" +androidx-activity-compose = "1.11.0" androidx-appcompat = "1.7.0" -androidx-compose-bom = "2025.08.00" +androidx-compose-bom = "2025.09.01" androidx-compose-ui-test = "1.7.0-alpha08" -androidx-compose-ui-test-junit4-accessibility = "1.10.0-alpha01" +androidx-compose-ui-test-junit4-accessibility = "1.10.0-alpha04" androidx-constraintlayout = "2.2.1" androidx-constraintlayout-compose = "1.1.1" androidx-coordinator-layout = "1.3.0" androidx-corektx = "1.17.0" androidx-credentials = "1.5.0" androidx-credentials-play-services-auth = "1.5.0" -androidx-emoji2-views = "1.5.0" +androidx-emoji2-views = "1.6.0" androidx-fragment-ktx = "1.8.9" androidx-glance-appwidget = "1.1.1" -androidx-lifecycle-compose = "2.9.2" -androidx-lifecycle-runtime-compose = "2.9.2" -androidx-navigation = "2.9.3" +androidx-lifecycle-compose = "2.9.4" +androidx-lifecycle-runtime-compose = "2.9.4" +androidx-navigation = "2.9.5" androidx-paging = "3.3.6" androidx-startup-runtime = "1.2.0" androidx-test = "1.7.0" androidx-test-espresso = "3.7.0" 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-window = "1.5.0" +androidx-window-core = "1.5.0" +androidx-window-java = "1.5.0" 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" +androidxHiltNavigationCompose = "1.3.0" appcompat = "1.7.1" coil = "2.7.0" # @keep compileSdk = "36" -compose-latest = "1.9.0" -composeUiTooling = "1.4.1" +compose-latest = "1.9.2" +composeUiTooling = "1.5.2" coreSplashscreen = "1.0.1" coroutines = "1.10.2" -glide = "1.0.0-beta01" +glide = "1.0.0-beta08" google-maps = "19.2.0" -gradle-versions = "0.52.0" -guava = "33.4.8-jre" -hilt = "2.57" -horologist = "0.8.1-alpha" +gradle-versions = "0.53.0" +guava = "33.5.0-jre" +hilt = "2.57.1" +horologist = "0.8.2-alpha" junit = "4.13.2" ktlint = "1.5.0" -kotlin = "2.2.10" +kotlin = "2.2.20" kotlinCoroutinesOkhttp = "1.0" kotlinxCoroutinesGuava = "1.10.2" kotlinxSerializationJson = "1.9.0" -ksp = "2.2.10-2.0.2" -lifecycleService = "2.9.2" -maps-compose = "6.7.2" -material = "1.14.0-alpha03" +ksp = "2.2.20-2.0.3" +lifecycleService = "2.9.4" +maps-compose = "6.11.0" +material = "1.14.0-alpha04" material3-adaptive = "1.1.0" -material3-adaptive-navigation-suite = "1.3.2" +material3-adaptive-navigation-suite = "1.4.0" media3 = "1.8.0" # @keep minSdk = "35" @@ -65,11 +65,11 @@ okHttp = "5.1.0" playServicesWearable = "19.0.0" protolayout = "1.3.0" recyclerview = "1.4.0" -spotless = "7.0.2" -targetSdk = "35" +spotless = "8.0.0" +targetSdk = "36" tiles = "1.5.0" tracing = "1.3.0" -validatorPush = "1.0.0-alpha06" +validatorPush = "1.0.0-alpha08" version-catalog-update = "1.0.0" watchfaceComplicationsDataSourceKtx = "1.2.1" wear = "1.3.0" @@ -125,9 +125,9 @@ androidx-credentials-play-services-auth = { module = "androidx.credentials:crede androidx-emoji2-views = { module = "androidx.emoji2:emoji2-views", version.ref = "androidx-emoji2-views" } androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment-ktx" } androidx-glance-appwidget = { module = "androidx.glance:glance-appwidget", version.ref = "androidx-glance-appwidget" } +androidx-glance-appwidget-testing = { module = "androidx.glance:glance-appwidget-testing", version.ref = "androidx-glance-appwidget" } androidx-glance-material3 = { module = "androidx.glance:glance-material3", version.ref = "androidx-glance-appwidget" } -androidx-glance-testing = { group = "androidx.glance", name = "glance-testing", version.ref = "androidx-glance-appwidget" } -androidx-glance-appwidget-testing = { group = "androidx.glance", name = "glance-appwidget-testing", version.ref = "androidx-glance-appwidget" } +androidx-glance-testing = { module = "androidx.glance:glance-testing", version.ref = "androidx-glance-appwidget" } androidx-graphics-shapes = "androidx.graphics:graphics-shapes:1.0.1" androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" } androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle-runtime-compose" } @@ -165,7 +165,7 @@ androidx-webkit = { module = "androidx.webkit:webkit", version.ref = "webkit" } androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" } androidx-window-core = { module = "androidx.window:window-core", version.ref = "androidx-window-core" } androidx-window-java = { module = "androidx.window:window-java", version.ref = "androidx-window-java" } -androidx-work-runtime-ktx = "androidx.work:work-runtime-ktx:2.10.3" +androidx-work-runtime-ktx = "androidx.work:work-runtime-ktx:2.10.5" androidx-xr-arcore = { module = "androidx.xr.arcore:arcore", version.ref = "androidx-xr-arcore" } androidx-xr-compose = { module = "androidx.xr.compose:compose", version.ref = "androidx-xr-compose" } androidx-xr-scenecore = { module = "androidx.xr.scenecore:scenecore", version.ref = "androidx-xr-scenecore" } @@ -182,9 +182,11 @@ hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" } horologist-compose-layout = { module = "com.google.android.horologist:horologist-compose-layout", version.ref = "horologist" } horologist-compose-material = { module = "com.google.android.horologist:horologist-compose-material", version.ref = "horologist" } +jetbrains-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } junit = { module = "junit:junit", version.ref = "junit" } kotlin-coroutines-okhttp = { module = "ru.gildor.coroutines:kotlin-coroutines-okhttp", version.ref = "kotlinCoroutinesOkhttp" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinxCoroutinesGuava" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } @@ -194,21 +196,19 @@ play-services-wearable = { module = "com.google.android.gms:play-services-wearab validator-push = { module = "com.google.android.wearable.watchface.validator:validator-push", version.ref = "validatorPush" } wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "wearComposeMaterial" } wear-compose-material3 = { module = "androidx.wear.compose:compose-material3", version.ref = "wearComposeMaterial3" } -jetbrains-kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } -kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "androidGradlePlugin" } android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +android-lint = { id = "com.android.lint", version.ref = "androidGradlePlugin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } -kotlin-android = "org.jetbrains.kotlin.android:2.2.10" +kotlin-android = "org.jetbrains.kotlin.android:2.2.20" kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "androidGradlePlugin" } kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } -android-lint = { id = "com.android.lint", version.ref = "androidGradlePlugin" } spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" } diff --git a/views/build.gradle.kts b/views/build.gradle.kts index 80ee4edc8..623add7ab 100644 --- a/views/build.gradle.kts +++ b/views/build.gradle.kts @@ -19,10 +19,10 @@ plugins { android { namespace = "com.example.example.snippet.views" - compileSdk = 35 + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { - minSdk = 35 + minSdk = libs.versions.minSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") @@ -38,11 +38,11 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "17" } } diff --git a/watchfacepush/validator/build.gradle.kts b/watchfacepush/validator/build.gradle.kts index 0b9289a5c..7cfb5372d 100644 --- a/watchfacepush/validator/build.gradle.kts +++ b/watchfacepush/validator/build.gradle.kts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import org.gradle.jvm.toolchain.JavaLanguageVersion group = "com.example.validator" version = "1.0" @@ -22,8 +23,18 @@ plugins { application } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + +kotlin { + jvmToolchain(17) +} application { mainClass.set("com.example.validator.Main") + } sourceSets { @@ -32,8 +43,9 @@ sourceSets { srcDir("src/main/java") } } + } dependencies { implementation(libs.validator.push) -} \ No newline at end of file +} diff --git a/xr/build.gradle.kts b/xr/build.gradle.kts index 51c224f20..9b632756d 100644 --- a/xr/build.gradle.kts +++ b/xr/build.gradle.kts @@ -6,21 +6,21 @@ plugins { android { namespace = "com.example.xr" - compileSdk = 35 + compileSdk = libs.versions.compileSdk.get().toInt() defaultConfig { applicationId = "com.example.xr" minSdk = 34 - targetSdk = 35 + targetSdk = libs.versions.targetSdk.get().toInt() versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlin { - jvmToolchain(11) + jvmToolchain(17) } buildFeatures { compose = true