Skip to content

Commit

Permalink
Upgraded some dependency versions
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Apr 15, 2024
1 parent d719ced commit f2486f3
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 134 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
},
)
}
}
Expand All @@ -649,7 +655,6 @@ fun FeedScreen(
Box {
IconButton(
onClick = { onShowToolbarMenu(true) },
modifier = Modifier.tooltipAnchor(),
) {
Icon(
Icons.Default.MoreVert,
Expand Down Expand Up @@ -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
},
)
}
}
Expand Down Expand Up @@ -970,8 +975,7 @@ fun FeedScreen(
onClick = onMarkAllAsRead,
modifier =
Modifier
.navigationBarsPadding()
.tooltipAnchor(),
.navigationBarsPadding(),
) {
Icon(
Icons.Default.DoneAll,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1296,9 +1300,9 @@ fun FeedListContent(
if (itemIndex < pagedFeedItems.itemCount - 1) {
Divider(
modifier =
Modifier
.height(1.dp)
.fillMaxWidth(),
Modifier
.height(1.dp)
.fillMaxWidth(),
)
}
}
Expand All @@ -1313,9 +1317,9 @@ fun FeedListContent(
) {
Spacer(
modifier =
Modifier
.fillMaxWidth()
.height((56 + 16).dp),
Modifier
.fillMaxWidth()
.height((56 + 16).dp),
)
}
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -254,9 +252,6 @@ fun ArticleScreen(
Box {
IconButton(
onClick = { onShowToolbarMenu(true) },
modifier =
Modifier
.tooltipAnchor(),
) {
Icon(
Icons.Default.MoreVert,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -341,7 +341,7 @@ fun ReaderView(
contentScale = contentScale,
alignment = Alignment.Center,
modifier =
innerModifier
Modifier
.fillMaxWidth()
.run {
dimens.imageAspectRatioInReader?.let { ratio ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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 -> ""
}
}
Loading

0 comments on commit f2486f3

Please sign in to comment.