Merge pull request #799 from android/tm/feed-content-type

Add contentType to news feed
pull/815/merge
Don Turner 1 year ago committed by GitHub
commit 21777aba65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,7 +57,11 @@ fun LazyGridScope.newsFeed(
when (feedState) { when (feedState) {
NewsFeedUiState.Loading -> Unit NewsFeedUiState.Loading -> Unit
is NewsFeedUiState.Success -> { is NewsFeedUiState.Success -> {
items(feedState.feed, key = { it.id }) { userNewsResource -> items(
items = feedState.feed,
key = { it.id },
contentType = { "newsFeedItem" },
) { userNewsResource ->
val resourceUrl by remember { val resourceUrl by remember {
mutableStateOf(Uri.parse(userNewsResource.url)) mutableStateOf(Uri.parse(userNewsResource.url))
} }

@ -182,7 +182,7 @@ internal fun ForYouScreen(
onTopicClick = onTopicClick, onTopicClick = onTopicClick,
) )
item(span = { GridItemSpan(maxLineSpan) }) { item(span = { GridItemSpan(maxLineSpan) }, contentType = "bottomSpacing") {
Column { Column {
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
// Add space for the content to clear the "offline" snackbar. // Add space for the content to clear the "offline" snackbar.
@ -240,7 +240,7 @@ private fun LazyGridScope.onboarding(
-> Unit -> Unit
is OnboardingUiState.Shown -> { is OnboardingUiState.Shown -> {
item(span = { GridItemSpan(maxLineSpan) }) { item(span = { GridItemSpan(maxLineSpan) }, contentType = "onboarding") {
Column(modifier = interestsItemModifier) { Column(modifier = interestsItemModifier) {
Text( Text(
text = stringResource(R.string.onboarding_guidance_title), text = stringResource(R.string.onboarding_guidance_title),

Loading…
Cancel
Save