app: fix a few lint warnings
authorDa Risk <da_risk@geekorum.com>
Thu, 28 Mar 2024 14:21:09 -0400
changeset 1243 b229f5f7a3aa
parent 1242 153f95e8dfa6
child 1244 dda428f190d7
app: fix a few lint warnings
app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt
app/src/main/java/com/geekorum/ttrss/articles_list/ArticlesListScaffold.kt
app/src/main/java/com/geekorum/ttrss/articles_list/FeedListNavigationMenu.kt
app/src/main/java/com/geekorum/ttrss/articles_list/InAppUpdatePresenter.kt
app/src/main/java/com/geekorum/ttrss/background_job/BackgroundJobManager.kt
app/src/main/java/com/geekorum/ttrss/settings/manage_features/InstallFeatureActivity.kt
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/ArticleCardsList.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -32,6 +32,7 @@
 import androidx.compose.foundation.lazy.rememberLazyListState
 import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.verticalScroll
+import androidx.compose.material.icons.filled.Archive
 import androidx.compose.material3.*
 import androidx.compose.material3.pulltorefresh.PullToRefreshContainer
 import androidx.compose.material3.pulltorefresh.PullToRefreshState
@@ -425,7 +426,7 @@
     ) {
         val text = stringResource(id = R.string.mark_as_read)
         if (dismissDirection == SwipeToDismissBoxValue.StartToEnd) {
-            Icon(painter = painterResource(R.drawable.ic_archive), contentDescription = text,
+            Icon(AppTheme3.Icons.Archive, contentDescription = text,
                 modifier = Modifier.padding(end = 8.dp),
                 tint = MaterialTheme.colorScheme.secondary
             )
@@ -433,7 +434,7 @@
         Text(text,
             style = MaterialTheme.typography.bodySmall)
         if (dismissDirection == SwipeToDismissBoxValue.EndToStart) {
-            Icon(painter = painterResource(R.drawable.ic_archive), contentDescription = text,
+            Icon(AppTheme3.Icons.Archive, contentDescription = text,
                 modifier = Modifier.padding(start = 8.dp),
                 tint = MaterialTheme.colorScheme.secondary
             )
@@ -478,8 +479,8 @@
  */
 @Composable
 fun LazyListState.isScrollingUp(): Boolean {
-    var previousIndex by remember(this) { mutableStateOf(firstVisibleItemIndex) }
-    var previousScrollOffset by remember(this) { mutableStateOf(firstVisibleItemScrollOffset) }
+    var previousIndex by remember(this) { mutableIntStateOf(firstVisibleItemIndex) }
+    var previousScrollOffset by remember(this) { mutableIntStateOf(firstVisibleItemScrollOffset) }
     return remember(this) {
         derivedStateOf {
             if (previousIndex != firstVisibleItemIndex) {
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/ArticlesListScaffold.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/ArticlesListScaffold.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -356,7 +356,7 @@
                         showBanner = !showBanner
                     }) {
                         Icon(
-                            painter = painterResource(R.drawable.ic_refresh),
+                            AppTheme3.Icons.Refresh,
                             contentDescription = "refresh"
                         )
                     }
@@ -427,7 +427,7 @@
                         showBanner = !showBanner
                     }) {
                         Icon(
-                            painter = painterResource(R.drawable.ic_refresh),
+                            AppTheme3.Icons.Refresh,
                             contentDescription = "refresh"
                         )
                     }
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/FeedListNavigationMenu.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/FeedListNavigationMenu.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -169,7 +169,7 @@
 ) {
     SectionLabel(stringResource(R.string.title_feeds_menu))
     NavigationItem(stringResource(R.string.title_magazine),
-        icon = { Icon(painterResource(R.drawable.ic_newspaper_24), contentDescription = null) },
+        icon = { Icon(AppTheme3.Icons.Newspaper, contentDescription = null) },
         selected = isMagazineSelected,
         selectedForAction = false,
         onLongClick = null,
--- a/app/src/main/java/com/geekorum/ttrss/articles_list/InAppUpdatePresenter.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/articles_list/InAppUpdatePresenter.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -80,7 +80,7 @@
             showBanner = isUpdateAvailable || isUpdateReadyToInstall
         }
 
-        var sheetHeigth by remember { mutableStateOf(0) }
+        var sheetHeigth by remember { mutableIntStateOf(0) }
         AnimatedVisibility(showBanner,
             enter = slideInVertically(initialOffsetY = { it }),
             exit = slideOutVertically(targetOffsetY = { it}),
--- a/app/src/main/java/com/geekorum/ttrss/background_job/BackgroundJobManager.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/background_job/BackgroundJobManager.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -101,7 +101,6 @@
     }
 }
 
-@RequiresApi(Build.VERSION_CODES.N)
 private class BackgroundJobManagerNougatImpl(
     context: Context
 ) : BackgroundJobManagerImpl(context){
--- a/app/src/main/java/com/geekorum/ttrss/settings/manage_features/InstallFeatureActivity.kt	Thu Mar 28 13:15:39 2024 -0400
+++ b/app/src/main/java/com/geekorum/ttrss/settings/manage_features/InstallFeatureActivity.kt	Thu Mar 28 14:21:09 2024 -0400
@@ -137,7 +137,7 @@
         // we could use rememberInfiniteTransition but we wanted the animation to stop gracefully
         val logoAnimation = remember { Animatable(0f) }
 
-        var currentAnimationVelocity by  remember { mutableStateOf(0f) }
+        var currentAnimationVelocity by  remember { mutableFloatStateOf(0f) }
         LaunchedEffect(animate) {
             if (!animate) {
                 logoAnimation.animateTo(