From f2486f3ce4d15dc6863bcdd2f37ca5c1eeea035e Mon Sep 17 00:00:00 2001 From: Jonas Kalderstam Date: Mon, 15 Apr 2024 16:14:30 +0200 Subject: [PATCH] Upgraded some dependency versions --- app/build.gradle.kts | 4 +- .../feeder/ui/AddFeedFromShareActivity.kt | 10 +- .../feeder/ui/ImportOMPLFileActivity.kt | 10 +- .../nononsenseapps/feeder/ui/MainActivity.kt | 8 +- .../feeder/ui/compose/feed/FeedScreen.kt | 104 +++++++++++------- .../ui/compose/feedarticle/ArticleScreen.kt | 7 +- .../ui/compose/feedarticle/ReaderView.kt | 4 +- .../ui/compose/material3/NavigationDrawer.kt | 16 --- .../navigation/NavigationDestinations.kt | 43 ++++---- .../ui/compose/readaloud/ReadAloudPlayer.kt | 7 +- .../feeder/ui/compose/sync/SyncScreen.kt | 3 +- .../ui/compose/text/HtmlToComposable.kt | 14 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 21 ++-- 14 files changed, 119 insertions(+), 134 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d33934481..01ace0dc5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,14 +8,14 @@ plugins { android { namespace = "com.nononsenseapps.feeder" - compileSdk = 33 + compileSdk = 34 defaultConfig { applicationId = "com.nononsenseapps.feeder" versionCode = 307 versionName = "2.6.22" minSdk = 23 - targetSdk = 33 + targetSdk = 34 vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/AddFeedFromShareActivity.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/AddFeedFromShareActivity.kt index 4e4ca4910..dc365a701 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/AddFeedFromShareActivity.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/AddFeedFromShareActivity.kt @@ -8,9 +8,9 @@ import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.core.view.WindowCompat -import com.google.accompanist.navigation.animation.AnimatedNavHost -import com.google.accompanist.navigation.animation.composable -import com.google.accompanist.navigation.animation.rememberAnimatedNavController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController import com.nononsenseapps.feeder.base.DIAwareComponentActivity import com.nononsenseapps.feeder.base.diAwareViewModel import com.nononsenseapps.feeder.ui.compose.editfeed.CreateFeedScreen @@ -35,8 +35,8 @@ class AddFeedFromShareActivity : DIAwareComponentActivity() { setContent { withAllProviders { - val navController = rememberAnimatedNavController() - AnimatedNavHost(navController, startDestination = "search") { + val navController = rememberNavController() + NavHost(navController, startDestination = "search") { composable( "search", enterTransition = { fadeIn() }, diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/ImportOMPLFileActivity.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/ImportOMPLFileActivity.kt index e7eb32636..20ef4db52 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/ImportOMPLFileActivity.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/ImportOMPLFileActivity.kt @@ -8,9 +8,9 @@ import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.core.net.toUri import androidx.core.view.WindowCompat -import com.google.accompanist.navigation.animation.AnimatedNavHost -import com.google.accompanist.navigation.animation.composable -import com.google.accompanist.navigation.animation.rememberAnimatedNavController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController import com.nononsenseapps.feeder.base.DIAwareComponentActivity import com.nononsenseapps.feeder.db.room.ID_ALL_FEEDS import com.nononsenseapps.feeder.ui.compose.ompl.OpmlImportScreen @@ -35,8 +35,8 @@ class ImportOMPLFileActivity : DIAwareComponentActivity() { setContent { withAllProviders { - val navController = rememberAnimatedNavController() - AnimatedNavHost(navController, startDestination = "import") { + val navController = rememberNavController() + NavHost(navController, startDestination = "import") { composable( "import", enterTransition = { fadeIn() }, diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/MainActivity.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/MainActivity.kt index 816b00db1..9619fd8a4 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/MainActivity.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/MainActivity.kt @@ -11,8 +11,8 @@ import androidx.compose.runtime.DisposableEffect import androidx.core.util.Consumer import androidx.core.view.WindowCompat import androidx.lifecycle.lifecycleScope -import com.google.accompanist.navigation.animation.AnimatedNavHost -import com.google.accompanist.navigation.animation.rememberAnimatedNavController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.rememberNavController import com.nononsenseapps.feeder.base.DIAwareComponentActivity import com.nononsenseapps.feeder.model.workmanager.requestFeedSync import com.nononsenseapps.feeder.model.workmanager.scheduleGetUpdates @@ -80,10 +80,10 @@ class MainActivity : DIAwareComponentActivity() { @OptIn(ExperimentalAnimationApi::class) @Composable fun AppContent() { - val navController = rememberAnimatedNavController() + val navController = rememberNavController() val navDrawerListState = rememberLazyListState() - AnimatedNavHost(navController, startDestination = FeedDestination.route) { + NavHost(navController, startDestination = FeedDestination.route) { FeedDestination.register(this, navController, navDrawerListState) ArticleDestination.register(this, navController, navDrawerListState) // Feed editing diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt index be8c90c49..e0c09f505 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feed/FeedScreen.kt @@ -61,10 +61,13 @@ import androidx.compose.material3.FloatingActionButton import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.PlainTooltipBox +import androidx.compose.material3.PlainTooltip import androidx.compose.material3.Scaffold import androidx.compose.material3.Text +import androidx.compose.material3.TooltipBox +import androidx.compose.material3.TooltipDefaults import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.rememberTooltipState import androidx.compose.material3.rememberTopAppBarState import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect @@ -495,11 +498,14 @@ fun FeedScreen( onEditFeed = onEditFeed, toolbarActions = { if (viewState.currentFeedOrTag.isNotSavedArticles) { - PlainTooltipBox(tooltip = { Text(stringResource(id = R.string.filter_noun)) }) { + PlainTooltipBox( + tooltip = { + Text(stringResource(id = R.string.filter_noun)) + } + ) { Box { IconButton( onClick = { onShowFilterMenu(true) }, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.FilterList, @@ -633,12 +639,12 @@ fun FeedScreen( }, text = {}, modifier = - Modifier - .height(0.dp) - .safeSemantics { - contentDescription = closeMenuText - role = Role.Button - }, + Modifier + .height(0.dp) + .safeSemantics { + contentDescription = closeMenuText + role = Role.Button + }, ) } } @@ -649,7 +655,6 @@ fun FeedScreen( Box { IconButton( onClick = { onShowToolbarMenu(true) }, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.MoreVert, @@ -830,12 +835,12 @@ fun FeedScreen( }, text = {}, modifier = - Modifier - .height(0.dp) - .safeSemantics { - contentDescription = closeMenuText - role = Role.Button - }, + Modifier + .height(0.dp) + .safeSemantics { + contentDescription = closeMenuText + role = Role.Button + }, ) } } @@ -970,8 +975,7 @@ fun FeedScreen( onClick = onMarkAllAsRead, modifier = Modifier - .navigationBarsPadding() - .tooltipAnchor(), + .navigationBarsPadding(), ) { Icon( Icons.Default.DoneAll, @@ -1056,11 +1060,11 @@ fun FeedScreen( } }, modifier = - modifier - // The order is important! PullToRefresh MUST come first - .pullRefresh(state = pullRefreshState) - .nestedScroll(scrollBehavior.nestedScrollConnection) - .windowInsetsPadding(WindowInsets.navigationBars.only(WindowInsetsSides.Horizontal)), + modifier + // The order is important! PullToRefresh MUST come first + .pullRefresh(state = pullRefreshState) + .nestedScroll(scrollBehavior.nestedScrollConnection) + .windowInsetsPadding(WindowInsets.navigationBars.only(WindowInsetsSides.Horizontal)), contentWindowInsets = WindowInsets.statusBars, ) { padding -> Box( @@ -1140,9 +1144,9 @@ fun FeedListContent( // Separate box because scrollable will ignore max size. Box( modifier = - Modifier - .fillMaxSize() - .verticalScroll(rememberScrollState()), + Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()), ) NothingToRead( modifier = Modifier, @@ -1189,12 +1193,12 @@ fun FeedListContent( .asPaddingValues() }, modifier = - Modifier - .fillMaxSize() - .safeSemantics { - testTag = "feed_list" - collectionInfo = CollectionInfo(pagedFeedItems.itemCount, 1) - }, + Modifier + .fillMaxSize() + .safeSemantics { + testTag = "feed_list" + collectionInfo = CollectionInfo(pagedFeedItems.itemCount, 1) + }, ) { /* This is a trick to make the list stay at item 0 when updates come in IF it is @@ -1296,9 +1300,9 @@ fun FeedListContent( if (itemIndex < pagedFeedItems.itemCount - 1) { Divider( modifier = - Modifier - .height(1.dp) - .fillMaxWidth(), + Modifier + .height(1.dp) + .fillMaxWidth(), ) } } @@ -1313,9 +1317,9 @@ fun FeedListContent( ) { Spacer( modifier = - Modifier - .fillMaxWidth() - .height((56 + 16).dp), + Modifier + .fillMaxWidth() + .height((56 + 16).dp), ) } } @@ -1358,9 +1362,9 @@ fun FeedGridContent( // Separate box because scrollable will ignore max size. Box( modifier = - Modifier - .fillMaxSize() - .verticalScroll(rememberScrollState()), + Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()), ) NothingToRead( modifier = Modifier, @@ -1587,3 +1591,21 @@ private val PLACEHOLDER_ITEM = rawPubDate = null, wordCount = 0, ) + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun PlainTooltipBox( + tooltip: @Composable () -> Unit, + content: @Composable () -> Unit, +) { + TooltipBox( + positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(), + state = rememberTooltipState(), + tooltip = { + PlainTooltip { + tooltip() + } + }, + content = content, + ) +} diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ArticleScreen.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ArticleScreen.kt index 9a868c254..6d63171de 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ArticleScreen.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ArticleScreen.kt @@ -33,7 +33,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.PlainTooltipBox import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults @@ -64,6 +63,7 @@ import com.nononsenseapps.feeder.blob.blobInputStream import com.nononsenseapps.feeder.db.room.ID_UNSET import com.nononsenseapps.feeder.model.LocaleOverride import com.nononsenseapps.feeder.ui.compose.components.safeSemantics +import com.nononsenseapps.feeder.ui.compose.feed.PlainTooltipBox import com.nononsenseapps.feeder.ui.compose.icons.CustomFilled import com.nononsenseapps.feeder.ui.compose.icons.TextToSpeech import com.nononsenseapps.feeder.ui.compose.readaloud.HideableTTSPlayer @@ -229,7 +229,6 @@ fun ArticleScreen( PlainTooltipBox(tooltip = { Text(stringResource(R.string.fetch_full_article)) }) { IconButton( onClick = onToggleFullText, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.Article, @@ -241,7 +240,6 @@ fun ArticleScreen( PlainTooltipBox(tooltip = { Text(stringResource(id = R.string.open_in_web_view)) }) { IconButton( onClick = onOpenInCustomTab, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.OpenInBrowser, @@ -254,9 +252,6 @@ fun ArticleScreen( Box { IconButton( onClick = { onShowToolbarMenu(true) }, - modifier = - Modifier - .tooltipAnchor(), ) { Icon( Icons.Default.MoreVert, diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ReaderView.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ReaderView.kt index b28316f0d..9f2b23159 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ReaderView.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/feedarticle/ReaderView.kt @@ -317,7 +317,7 @@ fun ReaderView( .clip(RectangleShape) .fillMaxWidth(), ) { - WithTooltipIfNotBlank(tooltip = stringResource(id = R.string.article_image)) { innerModifier -> + WithTooltipIfNotBlank(tooltip = stringResource(id = R.string.article_image)) { val maxImageWidth by rememberMaxImageWidth() val pixelDensity = LocalDensity.current.density val contentScale = @@ -341,7 +341,7 @@ fun ReaderView( contentScale = contentScale, alignment = Alignment.Center, modifier = - innerModifier + Modifier .fillMaxWidth() .run { dimens.imageAspectRatioInReader?.let { ratio -> diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/material3/NavigationDrawer.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/material3/NavigationDrawer.kt index e08d3b904..ca2a1d322 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/material3/NavigationDrawer.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/material3/NavigationDrawer.kt @@ -926,14 +926,6 @@ internal value class Strings private constructor(private val value: Int) { companion object { val NavigationMenu = Strings(0) val CloseDrawer = Strings(1) - val CloseSheet = Strings(2) - val DefaultErrorMessage = Strings(3) - val ExposedDropdownMenu = Strings(4) - val SliderRangeStart = Strings(5) - val SliderRangeEnd = Strings(6) - val Dialog = Strings(7) - val MenuExpanded = Strings(8) - val MenuCollapsed = Strings(9) } } @@ -944,14 +936,6 @@ internal fun getString(string: Strings): String { return when (string) { Strings.NavigationMenu -> resources.getString(androidx.compose.ui.R.string.navigation_menu) Strings.CloseDrawer -> resources.getString(androidx.compose.ui.R.string.close_drawer) - Strings.CloseSheet -> resources.getString(androidx.compose.ui.R.string.close_sheet) - Strings.DefaultErrorMessage -> resources.getString(androidx.compose.ui.R.string.default_error_message) - Strings.ExposedDropdownMenu -> resources.getString(androidx.compose.ui.R.string.dropdown_menu) - Strings.SliderRangeStart -> resources.getString(androidx.compose.ui.R.string.range_start) - Strings.SliderRangeEnd -> resources.getString(androidx.compose.ui.R.string.range_end) - Strings.Dialog -> resources.getString(androidx.compose.material3.R.string.dialog) - Strings.MenuExpanded -> resources.getString(androidx.compose.material3.R.string.expanded) - Strings.MenuCollapsed -> resources.getString(androidx.compose.material3.R.string.collapsed) else -> "" } } diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/navigation/NavigationDestinations.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/navigation/NavigationDestinations.kt index 500589360..0956f384f 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/navigation/NavigationDestinations.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/navigation/NavigationDestinations.kt @@ -1,9 +1,8 @@ package com.nononsenseapps.feeder.ui.compose.navigation -import androidx.compose.animation.AnimatedContentScope +import androidx.compose.animation.AnimatedContentTransitionScope import androidx.compose.animation.EnterTransition import androidx.compose.animation.ExitTransition -import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.lazy.LazyListState @@ -17,9 +16,9 @@ import androidx.navigation.NavController import androidx.navigation.NavDeepLink import androidx.navigation.NavGraphBuilder import androidx.navigation.NavType +import androidx.navigation.compose.composable import androidx.navigation.navArgument import androidx.navigation.navDeepLink -import com.google.accompanist.navigation.animation.composable import com.nononsenseapps.feeder.base.diAwareViewModel import com.nononsenseapps.feeder.db.room.ID_UNSET import com.nononsenseapps.feeder.ui.NavigationDeepLinkViewModel @@ -39,21 +38,20 @@ import com.nononsenseapps.feeder.util.urlEncode private const val LOG_TAG = "FEEDER_NAV" -@OptIn(ExperimentalAnimationApi::class) sealed class NavigationDestination( protected val path: String, protected val navArguments: List, val deepLinks: List, - private val enterTransition: (AnimatedContentScope.() -> EnterTransition?)? = { + private val enterTransition: (AnimatedContentTransitionScope.() -> EnterTransition?)? = { fadeIn() }, - private val exitTransition: (AnimatedContentScope.() -> ExitTransition?)? = { + private val exitTransition: (AnimatedContentTransitionScope.() -> ExitTransition?)? = { fadeOut() }, - private val popEnterTransition: (AnimatedContentScope.() -> EnterTransition?)? = { + private val popEnterTransition: (AnimatedContentTransitionScope.() -> EnterTransition?)? = { fadeIn() }, - private val popExitTransition: (AnimatedContentScope.() -> ExitTransition?)? = { + private val popExitTransition: (AnimatedContentTransitionScope.() -> ExitTransition?)? = { fadeOut() }, ) { @@ -85,7 +83,6 @@ sealed class NavigationDestination( } } - @OptIn(ExperimentalAnimationApi::class) fun register( navGraphBuilder: NavGraphBuilder, navController: NavController, @@ -133,8 +130,8 @@ class PathParamArgument( builder: NavArgumentBuilder.() -> Unit, ) : NavigationArgument(name, builder) -@OptIn(ExperimentalAnimationApi::class) -object SearchFeedDestination : NavigationDestination( + +data object SearchFeedDestination : NavigationDestination( path = "search/feed", navArguments = listOf( @@ -183,8 +180,8 @@ object SearchFeedDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object AddFeedDestination : NavigationDestination( + +data object AddFeedDestination : NavigationDestination( path = "add/feed", navArguments = listOf( @@ -238,8 +235,8 @@ object AddFeedDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object EditFeedDestination : NavigationDestination( + +data object EditFeedDestination : NavigationDestination( path = "edit/feed", navArguments = listOf( @@ -276,8 +273,8 @@ object EditFeedDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object SettingsDestination : NavigationDestination( + +data object SettingsDestination : NavigationDestination( path = "settings", navArguments = emptyList(), deepLinks = emptyList(), @@ -312,8 +309,8 @@ object SettingsDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object FeedDestination : NavigationDestination( + +data object FeedDestination : NavigationDestination( path = "feed", navArguments = listOf( @@ -395,8 +392,8 @@ object FeedDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object ArticleDestination : NavigationDestination( + +data object ArticleDestination : NavigationDestination( path = "reader", navArguments = listOf( @@ -453,8 +450,8 @@ object ArticleDestination : NavigationDestination( } } -@OptIn(ExperimentalAnimationApi::class) -object SyncScreenDestination : NavigationDestination( + +data object SyncScreenDestination : NavigationDestination( path = "sync", navArguments = listOf( diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/readaloud/ReadAloudPlayer.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/readaloud/ReadAloudPlayer.kt index f2355dc44..24962bf72 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/readaloud/ReadAloudPlayer.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/readaloud/ReadAloudPlayer.kt @@ -23,7 +23,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FloatingActionButton import androidx.compose.material3.Icon import androidx.compose.material3.IconButton -import androidx.compose.material3.PlainTooltipBox import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -44,6 +43,7 @@ import com.nononsenseapps.feeder.model.ForcedLocale import com.nononsenseapps.feeder.model.LocaleOverride import com.nononsenseapps.feeder.ui.compose.components.PaddedBottomAppBar import com.nononsenseapps.feeder.ui.compose.components.safeSemantics +import com.nononsenseapps.feeder.ui.compose.feed.PlainTooltipBox import com.nononsenseapps.feeder.ui.compose.theme.FeederTheme import com.nononsenseapps.feeder.ui.compose.utils.ImmutableHolder import com.nononsenseapps.feeder.ui.compose.utils.onKeyEventLikeEscape @@ -105,7 +105,6 @@ fun TTSPlayer( PlainTooltipBox(tooltip = { Text(stringResource(R.string.stop_reading)) }) { IconButton( onClick = onStop, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.Stop, @@ -118,7 +117,6 @@ fun TTSPlayer( PlainTooltipBox(tooltip = { Text(stringResource(R.string.pause_reading)) }) { IconButton( onClick = onPause, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.Pause, @@ -130,7 +128,6 @@ fun TTSPlayer( PlainTooltipBox(tooltip = { Text(stringResource(R.string.resume_reading)) }) { IconButton( onClick = onPlay, - modifier = Modifier.tooltipAnchor(), ) { Icon( // TextToSpeech @@ -144,7 +141,6 @@ fun TTSPlayer( PlainTooltipBox(tooltip = { Text(stringResource(R.string.skip_to_next)) }) { IconButton( onClick = onSkipNext, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.SkipNext, @@ -158,7 +154,6 @@ fun TTSPlayer( onClick = { showMenu = true }, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.Translate, diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/sync/SyncScreen.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/sync/SyncScreen.kt index a82d60a8e..f4223325f 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/sync/SyncScreen.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/sync/SyncScreen.kt @@ -44,7 +44,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.PlainTooltipBox import androidx.compose.material3.Scaffold import androidx.compose.material3.Surface import androidx.compose.material3.Text @@ -81,6 +80,7 @@ import com.nononsenseapps.feeder.crypto.AesCbcWithIntegrity import com.nononsenseapps.feeder.db.room.ID_UNSET import com.nononsenseapps.feeder.db.room.SyncDevice import com.nononsenseapps.feeder.ui.compose.components.safeSemantics +import com.nononsenseapps.feeder.ui.compose.feed.PlainTooltipBox import com.nononsenseapps.feeder.ui.compose.minimumTouchSize import com.nononsenseapps.feeder.ui.compose.theme.FeederTheme import com.nononsenseapps.feeder.ui.compose.theme.LinkTextStyle @@ -147,7 +147,6 @@ private fun SyncScaffold( Box { IconButton( onClick = { showToolbar = true }, - modifier = Modifier.tooltipAnchor(), ) { Icon( Icons.Default.MoreVert, diff --git a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/text/HtmlToComposable.kt b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/text/HtmlToComposable.kt index c2061bea9..b78eea8eb 100644 --- a/app/src/main/java/com/nononsenseapps/feeder/ui/compose/text/HtmlToComposable.kt +++ b/app/src/main/java/com/nononsenseapps/feeder/ui/compose/text/HtmlToComposable.kt @@ -31,7 +31,6 @@ import androidx.compose.material.icons.outlined.Terrain import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.PlainTooltipBox import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -40,7 +39,6 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.key 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 @@ -67,6 +65,7 @@ import com.nononsenseapps.feeder.R import com.nononsenseapps.feeder.ui.compose.coil.RestrainedFillWidthScaling import com.nononsenseapps.feeder.ui.compose.coil.RestrainedFitScaling import com.nononsenseapps.feeder.ui.compose.coil.rememberTintedVectorPainter +import com.nononsenseapps.feeder.ui.compose.feed.PlainTooltipBox import com.nononsenseapps.feeder.ui.compose.feedarticle.ArticleItemKeyHolder import com.nononsenseapps.feeder.ui.compose.theme.BlockQuoteStyle import com.nononsenseapps.feeder.ui.compose.theme.CodeBlockBackground @@ -833,7 +832,7 @@ private fun ColumnScope.renderImage( } } - WithTooltipIfNotBlank(tooltip = alt) { modifier -> + WithTooltipIfNotBlank(tooltip = alt) { val contentScale = remember(pixelDensity, dimens.hasImageAspectRatioInReader) { if (dimens.hasImageAspectRatioInReader) { @@ -863,7 +862,7 @@ private fun ColumnScope.renderImage( error = rememberTintedVectorPainter(Icons.Outlined.ErrorOutline), contentScale = contentScale, modifier = - modifier + Modifier .widthIn(max = maxWidth) .fillMaxWidth(), // .run { @@ -1508,15 +1507,14 @@ fun stripHtml(html: String): String { @Composable fun WithTooltipIfNotBlank( tooltip: String, - modifier: Modifier = Modifier, - content: @Composable (Modifier) -> Unit, + content: @Composable () -> Unit, ) { if (tooltip.isNotBlank()) { PlainTooltipBox(tooltip = { Text(tooltip) }) { - content(modifier.tooltipAnchor()) + content() } } else { - content(modifier) + content() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index da1db5f04..e411586a5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 216af7440..ddc99bb98 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,14 +19,14 @@ dependencyResolutionManagement { create("libs") { // Compose compiler is highly coupled to Kotlin version // See https://developer.android.com/jetpack/androidx/releases/compose-kotlin#pre-release_kotlin_compatibility - val kotlinVersion = "1.9.20" - val kspVersion = "1.9.20-1.0.14" + val kotlinVersion = "1.9.23" + val kspVersion = "1.9.23-1.0.20" val kotlinxSerialization = "1.6.1" version("kotlin", kotlinVersion) version("ksp", kspVersion) version("kotlinxSerialization", kotlinxSerialization) - version("androidPlugin", "8.1.0") - version("composeCompiler", "1.5.4") + version("androidPlugin", "8.3.0") + version("composeCompiler", "1.5.11") // BEGIN These should be upgraded in unison version("okhttp", "4.10.0") @@ -56,7 +56,7 @@ dependencyResolutionManagement { version("lifecycle", "2.6.2") version("room", "2.5.2") // Compose related below - version("compose", "2023.06.01") + version("compose", "2024.04.00") val activityCompose = "1.7.0" version("paging", "3.2.1") version("accompanist", "0.30.1") @@ -147,7 +147,8 @@ dependencyResolutionManagement { "androidx.compose.foundation", "foundation-layout", ).withoutVersion() - library("compose-material3", "androidx.compose.material3", "material3").version { + library("compose-material3", "androidx.compose.material3", "material3") + .version { // 1.1.0 introduced tooltips, not part of compose 05 bom at least require("1.1.0") } @@ -168,7 +169,7 @@ dependencyResolutionManagement { "navigation-compose", "androidx.navigation", "navigation-compose", - ).withoutVersion() + ).version("2.7.7") library( "paging-compose", "androidx.paging", @@ -190,11 +191,6 @@ dependencyResolutionManagement { "com.google.accompanist", "accompanist-systemuicontroller", ).versionRef("accompanist") - library( - "accompanist-navigation-animation", - "com.google.accompanist", - "accompanist-navigation-animation", - ).versionRef("accompanist") library( "accompanist-adaptive", "com.google.accompanist", @@ -402,7 +398,6 @@ dependencyResolutionManagement { "android-material", "accompanist-permissions", "accompanist-systemuicontroller", - "accompanist-navigation-animation", "accompanist-adaptive", "compose-material3-windowsizeclass", "lifecycle-runtime-compose",