From 522efac8c0e96854f8cd4e4e3cb2daa19a5bd93f Mon Sep 17 00:00:00 2001 From: Don Turner Date: Mon, 19 Feb 2024 16:29:21 +0000 Subject: [PATCH] Update Compose BOM to 2024.02.00. Fixes #1218 Change-Id: I838b81bf8e7fd7cb135f422653a8d8041829b28b --- .../samples/apps/nowinandroid/core/result/ResultKtTest.kt | 2 +- .../apps/nowinandroid/core/designsystem/component/Chip.kt | 2 ++ .../core/designsystem/component/LoadingWheel.kt | 4 ++-- .../apps/nowinandroid/core/designsystem/component/Tabs.kt | 2 +- .../apps/nowinandroid/core/designsystem/icon/NiaIcons.kt | 6 +++--- .../apps/nowinandroid/feature/search/SearchViewModelTest.kt | 2 +- .../apps/nowinandroid/feature/settings/SettingsDialog.kt | 6 +++--- gradle/libs.versions.toml | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt index 4f1229e9db..2c3c7b763b 100644 --- a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt +++ b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt @@ -38,7 +38,7 @@ class ResultKtTest { when (val errorResult = awaitItem()) { is Result.Error -> assertEquals( "Test Done", - errorResult.exception?.message, + errorResult.exception.message, ) Result.Loading, is Result.Success, diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Chip.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Chip.kt index 106f0b839c..9497bd92d1 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Chip.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Chip.kt @@ -73,6 +73,8 @@ fun NiaFilterChip( }, shape = CircleShape, border = FilterChipDefaults.filterChipBorder( + enabled = enabled, + selected = selected, borderColor = MaterialTheme.colorScheme.onBackground, selectedBorderColor = MaterialTheme.colorScheme.onBackground, disabledBorderColor = MaterialTheme.colorScheme.onBackground.copy( diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/LoadingWheel.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/LoadingWheel.kt index 21dfbc8c37..ca168b4be0 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/LoadingWheel.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/LoadingWheel.kt @@ -96,8 +96,8 @@ fun NiaLoadingWheel( animationSpec = infiniteRepeatable( animation = keyframes { durationMillis = ROTATION_TIME / 2 - progressLineColor at ROTATION_TIME / NUM_OF_LINES / 2 with LinearEasing - baseLineColor at ROTATION_TIME / NUM_OF_LINES with LinearEasing + progressLineColor at ROTATION_TIME / NUM_OF_LINES / 2 using LinearEasing + baseLineColor at ROTATION_TIME / NUM_OF_LINES using LinearEasing }, repeatMode = RepeatMode.Restart, initialStartOffset = StartOffset(ROTATION_TIME / NUM_OF_LINES / 2 * index), diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Tabs.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Tabs.kt index 92cd9aa8f4..74753ca9b8 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Tabs.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/component/Tabs.kt @@ -91,7 +91,7 @@ fun NiaTabRow( containerColor = Color.Transparent, contentColor = MaterialTheme.colorScheme.onSurface, indicator = { tabPositions -> - TabRowDefaults.Indicator( + TabRowDefaults.SecondaryIndicator( modifier = Modifier.tabIndicatorOffset(tabPositions[selectedTabIndex]), height = 2.dp, color = MaterialTheme.colorScheme.onSurface, diff --git a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/icon/NiaIcons.kt b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/icon/NiaIcons.kt index 8db20689f8..8d8a46424f 100644 --- a/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/icon/NiaIcons.kt +++ b/core/designsystem/src/main/kotlin/com/google/samples/apps/nowinandroid/core/designsystem/icon/NiaIcons.kt @@ -17,6 +17,7 @@ package com.google.samples.apps.nowinandroid.core.designsystem.icon import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.ArrowBack import androidx.compose.material.icons.filled.MoreVert import androidx.compose.material.icons.outlined.Bookmarks import androidx.compose.material.icons.outlined.Upcoming @@ -31,7 +32,6 @@ import androidx.compose.material.icons.rounded.Grid3x3 import androidx.compose.material.icons.rounded.Person import androidx.compose.material.icons.rounded.Search import androidx.compose.material.icons.rounded.Settings -import androidx.compose.material.icons.rounded.ShortText import androidx.compose.material.icons.rounded.Upcoming import androidx.compose.material.icons.rounded.ViewDay import androidx.compose.ui.graphics.vector.ImageVector @@ -41,7 +41,7 @@ import androidx.compose.ui.graphics.vector.ImageVector */ object NiaIcons { val Add = Icons.Rounded.Add - val ArrowBack = Icons.Rounded.ArrowBack + val ArrowBack = Icons.AutoMirrored.Rounded.ArrowBack val Bookmark = Icons.Rounded.Bookmark val BookmarkBorder = Icons.Rounded.BookmarkBorder val Bookmarks = Icons.Rounded.Bookmarks @@ -53,7 +53,7 @@ object NiaIcons { val Person = Icons.Rounded.Person val Search = Icons.Rounded.Search val Settings = Icons.Rounded.Settings - val ShortText = Icons.Rounded.ShortText + val ShortText = Icons.AutoMirrored.Rounded.ArrowBack val Upcoming = Icons.Rounded.Upcoming val UpcomingBorder = Icons.Outlined.Upcoming val ViewDay = Icons.Rounded.ViewDay diff --git a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt index fc9c20549c..6bbaf46d24 100644 --- a/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt +++ b/feature/search/src/test/kotlin/com/google/samples/apps/nowinandroid/feature/search/SearchViewModelTest.kt @@ -99,7 +99,7 @@ class SearchViewModelTest { searchContentsRepository.addNewsResources(newsResourcesTestData) searchContentsRepository.addTopics(topicsTestData) - val result = viewModel.searchResultUiState.value + // val result = viewModel.searchResultUiState.value // TODO: Figure out to get the latest emitted ui State? The result is emitted as EmptyQuery // assertIs(result) diff --git a/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt index 032515c53d..db60a64478 100644 --- a/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt +++ b/feature/settings/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/settings/SettingsDialog.kt @@ -37,7 +37,7 @@ import androidx.compose.foundation.selection.selectable import androidx.compose.foundation.selection.selectableGroup import androidx.compose.foundation.verticalScroll import androidx.compose.material3.AlertDialog -import androidx.compose.material3.Divider +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.RadioButton import androidx.compose.material3.Text @@ -115,7 +115,7 @@ fun SettingsDialog( ) }, text = { - Divider() + HorizontalDivider() Column(Modifier.verticalScroll(rememberScrollState())) { when (settingsUiState) { Loading -> { @@ -135,7 +135,7 @@ fun SettingsDialog( ) } } - Divider(Modifier.padding(top = 8.dp)) + HorizontalDivider(Modifier.padding(top = 8.dp)) LinksPanel() } TrackScreenViewEvent(screenName = "Settings") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e0380cabb..eeee360037 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ androidTools = "31.2.0" androidxActivity = "1.8.0" androidxAppCompat = "1.6.1" androidxBrowser = "1.6.0" -androidxComposeBom = "2023.10.01" +androidxComposeBom = "2024.02.00" androidxComposeCompiler = "1.5.7" androidxComposeRuntimeTracing = "1.0.0-beta01" androidxCore = "1.12.0"