A fully functional Android app built entirely with Kotlin and Jetpack Compose
Remove redundant mutable state
Ben Trengrove3142ecb4955c
diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.ktindex e2904afc3..afdb584a2 100644--- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt+++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt@@ -30,9 +30,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCellsimport androidx.compose.foundation.lazy.staggeredgrid.itemsimport androidx.compose.material3.MaterialThemeimport androidx.compose.runtime.Composable-import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableStateOf-import androidx.compose.runtime.rememberimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.toArgbimport androidx.compose.ui.platform.LocalContext@@ -64,9 +61,6 @@ fun LazyStaggeredGridScope.newsFeed(key = { it.id },contentType = { "newsFeedItem" },) { userNewsResource ->- val resourceUrl by remember {- mutableStateOf(Uri.parse(userNewsResource.url))- }val context = LocalContext.currentval analyticsHelper = LocalAnalyticsHelper.currentval backgroundColor = MaterialTheme.colorScheme.background.toArgb()@@ -79,7 +73,8 @@ fun LazyStaggeredGridScope.newsFeed(analyticsHelper.logNewsResourceOpened(newsResourceId = userNewsResource.id,)- launchCustomChromeTab(context, resourceUrl, backgroundColor)+ launchCustomChromeTab(context, Uri.parse(userNewsResource.url), backgroundColor)+onNewsResourceViewed(userNewsResource.id)},hasBeenViewed = userNewsResource.hasBeenViewed,