Skip to content

Commit 344a840

Browse files
authored
Update Compose BOM to 2026.03.00 and address deprecations (#1667)
This PR updates the Compose BOM to `2026.03.00` across all samples and addresses several deprecations introduced by recent Compose and Jetpack library updates. ### Summary of Changes 1. **Compose BOM Update**: * Updated `androidx-compose-bom` to `2026.03.00` for all projects (`JetLagged`, `JetNews`, `Jetsnack`, `Reply`, `Jetcaster`, `Jetchat`). * Bumps core Compose libraries (animation, foundation, runtime, ui, material) to `1.10.5`. 2. **Library Updates**: * Updated `androidx.activity:activity-compose` to `1.13.0`. * Updated `androidx.lifecycle:lifecycle-compose` and `androidx.lifecycle:lifecycle-runtime-compose` to `2.10.0`. * Updated `androidx.navigation:navigation-compose` to `2.9.7`. * Updated `androidx.hilt:hilt-navigation-compose` to `1.3.0`. * Updated `androidx.wear.compose:compose-material` to `1.5.6`. 3. **Addressed Deprecations & Best Practices**: * **JetLagged & JetNews**: Migrated deprecated `TabRow` and `ScrollableTabRow` components to the new Material 3 `PrimaryTabRow` and `PrimaryScrollableTabRow`. Updated `tabIndicatorOffset` to use the new `TabIndicatorScope`. * **Reply**: Replaced deprecated `WindowWidthSizeClass` equality checks with the new recommended `isWidthAtLeastBreakpoint()` scaling logic. Removed deprecated manual system UI flag configurations (`window.statusBarColor` and `WindowCompat.getInsetsController`), fully relying on `enableEdgeToEdge()` in `MainActivity` for proper edge-to-edge drawing and contrast. * **Jetsnack**: Updated the Material 3 `ColorScheme` constructor to include 12 new required 'fixed' container roles for theming. * **Jetcaster**: * Updated 15 occurrences of `hiltViewModel()` to use the new dedicated package (`androidx.hilt.lifecycle.viewmodel.compose`). * Migrated focus change properties in TV UI components from `enter`/`exit` to `onEnter`/`onExit`. * Fixed `WindowSizeClass.compute` deprecations by adapting to the required breakpoint system (`computeWindowSizeClass` and `isWidthAtLeastBreakpoint`). * Updated `:wear` module `compileSdk` to `36` to satisfy new transitive requirements for `activity-compose` 1.13.0. ### Validation * Clean builds and unit tests passed for all projects. * Instrumented tests passed on emulator for `JetNews`, `Jetsnack`, and `Reply`.
2 parents 0b96621 + b1887b4 commit 344a840

36 files changed

Lines changed: 91 additions & 112 deletions

File tree

JetLagged/app/src/main/java/com/example/jetlagged/sleep/JetLaggedHeaderTabs.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import androidx.compose.foundation.layout.fillMaxSize
2323
import androidx.compose.foundation.layout.padding
2424
import androidx.compose.foundation.shape.RoundedCornerShape
2525
import androidx.compose.material3.MaterialTheme
26-
import androidx.compose.material3.ScrollableTabRow
26+
import androidx.compose.material3.PrimaryScrollableTabRow
2727
import androidx.compose.material3.Tab
2828
import androidx.compose.material3.TabPosition
2929
import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset
@@ -46,14 +46,14 @@ enum class SleepTab(val title: Int) {
4646

4747
@Composable
4848
fun JetLaggedHeaderTabs(onTabSelected: (SleepTab) -> Unit, selectedTab: SleepTab, modifier: Modifier = Modifier) {
49-
ScrollableTabRow(
49+
PrimaryScrollableTabRow(
5050
modifier = modifier,
5151
edgePadding = 12.dp,
5252
selectedTabIndex = selectedTab.ordinal,
53-
indicator = { tabPositions: List<TabPosition> ->
53+
indicator = {
5454
Box(
5555
Modifier
56-
.tabIndicatorOffset(tabPositions[selectedTab.ordinal])
56+
.tabIndicatorOffset(selectedTab.ordinal, matchContentSize = true)
5757
.fillMaxSize()
5858
.padding(horizontal = 2.dp)
5959
.border(

JetLagged/gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
accompanist = "0.37.3"
33
android-material3 = "1.14.0-alpha09"
44
androidGradlePlugin = "9.0.1"
5-
androidx-activity-compose = "1.12.4"
5+
androidx-activity-compose = "1.13.0"
66
androidx-appcompat = "1.7.1"
7-
androidx-compose-bom = "2026.02.00"
7+
androidx-compose-bom = "2026.03.00"
88
androidx-constraintlayout = "1.1.1"
99
androidx-core-splashscreen = "1.2.0"
1010
androidx-corektx = "1.17.0"

JetNews/app/src/main/java/com/example/jetnews/ui/interests/InterestsScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ import androidx.compose.material3.HorizontalDivider
4141
import androidx.compose.material3.Icon
4242
import androidx.compose.material3.IconButton
4343
import androidx.compose.material3.MaterialTheme
44+
import androidx.compose.material3.PrimaryScrollableTabRow
45+
import androidx.compose.material3.PrimaryTabRow
4446
import androidx.compose.material3.Scaffold
45-
import androidx.compose.material3.ScrollableTabRow
4647
import androidx.compose.material3.SnackbarHost
4748
import androidx.compose.material3.SnackbarHostState
4849
import androidx.compose.material3.Surface
4950
import androidx.compose.material3.Tab
50-
import androidx.compose.material3.TabRow
5151
import androidx.compose.material3.Text
5252
import androidx.compose.runtime.Composable
5353
import androidx.compose.runtime.getValue
@@ -356,7 +356,7 @@ private fun InterestsTabRow(
356356
) {
357357
when (isExpandedScreen) {
358358
false -> {
359-
TabRow(
359+
PrimaryTabRow(
360360
selectedTabIndex = selectedTabIndex,
361361
contentColor = MaterialTheme.colorScheme.primary,
362362
) {
@@ -365,7 +365,7 @@ private fun InterestsTabRow(
365365
}
366366

367367
true -> {
368-
ScrollableTabRow(
368+
PrimaryScrollableTabRow(
369369
selectedTabIndex = selectedTabIndex,
370370
contentColor = MaterialTheme.colorScheme.primary,
371371
edgePadding = 0.dp,

JetNews/gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
accompanist = "0.37.3"
77
android-material3 = "1.14.0-alpha09"
88
androidGradlePlugin = "9.0.1"
9-
androidx-activity-compose = "1.12.4"
9+
androidx-activity-compose = "1.13.0"
1010
androidx-appcompat = "1.7.1"
11-
androidx-compose-bom = "2026.02.00"
11+
androidx-compose-bom = "2026.03.00"
1212
androidx-constraintlayout = "1.1.1"
1313
androidx-core-splashscreen = "1.2.0"
1414
androidx-corektx = "1.17.0"

Jetcaster/gradle/libs.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
accompanist = "0.37.3"
77
android-material3 = "1.13.0-alpha13"
88
androidGradlePlugin = "8.10.1"
9-
androidx-activity-compose = "1.10.1"
9+
androidx-activity-compose = "1.13.0"
1010
androidx-appcompat = "1.7.1"
11-
androidx-compose-bom = "2025.09.00"
11+
androidx-compose-bom = "2026.03.00"
1212
androidx-constraintlayout = "1.1.1"
1313
androidx-core-splashscreen = "1.0.1"
1414
androidx-corektx = "1.16.0"
1515
androidx-glance = "1.1.1"
1616
androidx-lifecycle = "2.8.2"
17-
androidx-lifecycle-compose = "2.9.1"
18-
androidx-lifecycle-runtime-compose = "2.9.1"
19-
androidx-navigation = "2.9.0"
17+
androidx-lifecycle-compose = "2.10.0"
18+
androidx-lifecycle-runtime-compose = "2.10.0"
19+
androidx-navigation = "2.9.7"
2020
androidx-palette = "1.0.0"
2121
androidx-test = "1.6.1"
2222
androidx-test-espresso = "3.6.1"
@@ -25,9 +25,9 @@ androidx-test-ext-truth = "1.6.0"
2525
androidx-tv-foundation = "1.0.0-alpha12"
2626
androidx-tv-material = "1.0.0"
2727
androidx-wear-compose-material3 = "1.5.1"
28-
androidx-wear-compose = "1.5.0"
28+
androidx-wear-compose = "1.5.6"
2929
androidx-window = "1.4.0"
30-
androidxHiltNavigationCompose = "1.2.0"
30+
androidxHiltNavigationCompose = "1.3.0"
3131
androix-test-uiautomator = "2.3.0"
3232
coil = "2.7.0"
3333
# @keep

Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/home/Home.kt

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,9 @@ import androidx.compose.ui.text.style.TextOverflow
9090
import androidx.compose.ui.tooling.preview.Preview
9191
import androidx.compose.ui.unit.Dp
9292
import androidx.compose.ui.unit.dp
93-
import androidx.hilt.navigation.compose.hiltViewModel
93+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
9494
import androidx.lifecycle.compose.collectAsStateWithLifecycle
9595
import androidx.window.core.layout.WindowSizeClass
96-
import androidx.window.core.layout.WindowWidthSizeClass
9796
import com.example.jetcaster.R
9897
import com.example.jetcaster.core.domain.testing.PreviewCategories
9998
import com.example.jetcaster.core.domain.testing.PreviewPodcastEpisodes
@@ -141,21 +140,12 @@ fun calculateScaffoldDirective(
141140
maxHorizontalPartitions = 1
142141
verticalSpacerSize = 0.dp
143142
} else {
144-
when (windowAdaptiveInfo.windowSizeClass.windowWidthSizeClass) {
145-
WindowWidthSizeClass.COMPACT -> {
146-
maxHorizontalPartitions = 1
147-
verticalSpacerSize = 0.dp
148-
}
149-
150-
WindowWidthSizeClass.MEDIUM -> {
151-
maxHorizontalPartitions = 1
152-
verticalSpacerSize = 0.dp
153-
}
154-
155-
else -> {
156-
maxHorizontalPartitions = 2
157-
verticalSpacerSize = 24.dp
158-
}
143+
if (windowAdaptiveInfo.windowSizeClass.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND)) {
144+
maxHorizontalPartitions = 2
145+
verticalSpacerSize = 24.dp
146+
} else {
147+
maxHorizontalPartitions = 1
148+
verticalSpacerSize = 0.dp
159149
}
160150
}
161151
val maxVerticalPartitions: Int
@@ -261,7 +251,7 @@ private fun HomeScreenReady(
261251
directive = navigator.scaffoldDirective,
262252
mainPane = {
263253
HomeScreen(
264-
windowSizeClass = windowSizeClass,
254+
isHomeAppBarExpanded = windowSizeClass.isCompact,
265255
isLoading = uiState.isLoading,
266256
featuredPodcasts = uiState.featuredPodcasts,
267257
homeCategories = uiState.homeCategories,
@@ -371,7 +361,7 @@ private fun HomeScreenBackground(modifier: Modifier = Modifier, content: @Compos
371361

372362
@Composable
373363
private fun HomeScreen(
374-
windowSizeClass: WindowSizeClass,
364+
isHomeAppBarExpanded: Boolean,
375365
isLoading: Boolean,
376366
featuredPodcasts: ImmutableList<PodcastInfo>,
377367
selectedHomeCategory: HomeCategory,
@@ -400,7 +390,7 @@ private fun HomeScreen(
400390
topBar = {
401391
Column {
402392
HomeAppBar(
403-
isExpanded = windowSizeClass.isCompact,
393+
isExpanded = isHomeAppBarExpanded,
404394
modifier = Modifier.fillMaxWidth(),
405395
)
406396
if (isLoading) {
@@ -758,14 +748,12 @@ private fun HomeAppBarPreview() {
758748
}
759749
}
760750

761-
private val CompactWindowSizeClass = WindowSizeClass.compute(360f, 780f)
762-
763751
@DevicePreviews
764752
@Composable
765753
private fun PreviewHome() {
766754
JetcasterTheme {
767755
HomeScreen(
768-
windowSizeClass = CompactWindowSizeClass,
756+
isHomeAppBarExpanded = true,
769757
isLoading = true,
770758
featuredPodcasts = PreviewPodcasts.toImmutableList(),
771759
homeCategories = HomeCategory.entries,

Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ import androidx.compose.ui.text.TextStyle
8383
import androidx.compose.ui.text.style.TextOverflow
8484
import androidx.compose.ui.tooling.preview.Preview
8585
import androidx.compose.ui.unit.dp
86-
import androidx.hilt.navigation.compose.hiltViewModel
86+
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
8787
import androidx.window.core.layout.WindowSizeClass
88-
import androidx.window.core.layout.WindowWidthSizeClass
88+
import androidx.window.core.layout.computeWindowSizeClass
8989
import androidx.window.layout.DisplayFeature
9090
import androidx.window.layout.FoldingFeature
9191
import com.example.jetcaster.R
@@ -256,7 +256,7 @@ fun PlayerContent(
256256
// Use a two pane layout if there is a fold impacting layout (meaning it is separating
257257
// or non-flat) or if we have a large enough width to show both.
258258
if (
259-
windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.EXPANDED ||
259+
windowSizeClass.isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_EXPANDED_LOWER_BOUND) ||
260260
isBookPosture(foldingFeature) ||
261261
isTableTopPosture(foldingFeature) ||
262262
isSeparatingPosture(foldingFeature)
@@ -926,7 +926,7 @@ fun PlayerScreenPreview() {
926926
),
927927
),
928928
displayFeatures = emptyList(),
929-
windowSizeClass = WindowSizeClass.compute(maxWidth.value, maxHeight.value),
929+
windowSizeClass = WindowSizeClass.BREAKPOINTS_V1.computeWindowSizeClass(maxWidth.value, maxHeight.value),
930930
onBackPress = { },
931931
onAddToQueue = {},
932932
onStop = {},

Jetcaster/mobile/src/main/java/com/example/jetcaster/util/WindowSizeClass.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616

1717
package com.example.jetcaster.util
1818

19-
import androidx.window.core.layout.WindowHeightSizeClass
2019
import androidx.window.core.layout.WindowSizeClass
21-
import androidx.window.core.layout.WindowWidthSizeClass
2220

2321
/**
2422
* Returns true if the width or height size classes are compact.
2523
*/
2624
val WindowSizeClass.isCompact: Boolean
27-
get() = windowWidthSizeClass == WindowWidthSizeClass.COMPACT ||
28-
windowHeightSizeClass == WindowHeightSizeClass.COMPACT
25+
get() = !isWidthAtLeastBreakpoint(WindowSizeClass.WIDTH_DP_MEDIUM_LOWER_BOUND) ||
26+
!isHeightAtLeastBreakpoint(WindowSizeClass.HEIGHT_DP_MEDIUM_LOWER_BOUND)

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/JetcasterApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private fun GlobalNavigationContainer(
7373
modifier = Modifier
7474
.padding(JetcasterAppDefaults.overScanMargin.drawer.intoPaddingValues())
7575
.focusProperties {
76-
enter = {
76+
onEnter = {
7777
when (currentRoute) {
7878
Screen.Discover.route -> discover
7979
Screen.Library.route -> library

Jetcaster/tv/src/main/java/com/example/jetcaster/tv/ui/component/Catalog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ private fun PodcastRow(
154154
modifier = modifier
155155
.focusRequester(focusRequester)
156156
.focusProperties {
157-
exit = {
157+
onExit = {
158158
focusRequester.saveFocusedChild()
159159
FocusRequester.Default
160160
}
161-
enter = {
161+
onEnter = {
162162
if (focusRequester.restoreFocusedChild()) {
163163
FocusRequester.Cancel
164164
} else {

0 commit comments

Comments
 (0)