Skip to content

Commit 3142ecb

Browse files
committed
Remove redundant mutable state
1 parent eb54ec7 commit 3142ecb

File tree

1 file changed

+2
-7
lines changed
  • core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui

1 file changed

+2
-7
lines changed

core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/NewsFeed.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
3030
import androidx.compose.foundation.lazy.staggeredgrid.items
3131
import androidx.compose.material3.MaterialTheme
3232
import androidx.compose.runtime.Composable
33-
import androidx.compose.runtime.getValue
34-
import androidx.compose.runtime.mutableStateOf
35-
import androidx.compose.runtime.remember
3633
import androidx.compose.ui.Modifier
3734
import androidx.compose.ui.graphics.toArgb
3835
import androidx.compose.ui.platform.LocalContext
@@ -64,9 +61,6 @@ fun LazyStaggeredGridScope.newsFeed(
6461
key = { it.id },
6562
contentType = { "newsFeedItem" },
6663
) { userNewsResource ->
67-
val resourceUrl by remember {
68-
mutableStateOf(Uri.parse(userNewsResource.url))
69-
}
7064
val context = LocalContext.current
7165
val analyticsHelper = LocalAnalyticsHelper.current
7266
val backgroundColor = MaterialTheme.colorScheme.background.toArgb()
@@ -79,7 +73,8 @@ fun LazyStaggeredGridScope.newsFeed(
7973
analyticsHelper.logNewsResourceOpened(
8074
newsResourceId = userNewsResource.id,
8175
)
82-
launchCustomChromeTab(context, resourceUrl, backgroundColor)
76+
launchCustomChromeTab(context, Uri.parse(userNewsResource.url), backgroundColor)
77+
8378
onNewsResourceViewed(userNewsResource.id)
8479
},
8580
hasBeenViewed = userNewsResource.hasBeenViewed,

0 commit comments

Comments
 (0)