From 3a106534e7cc50654fcc5d4d0f25f72012339b19 Mon Sep 17 00:00:00 2001 From: Don Turner Date: Thu, 20 Oct 2022 13:10:41 +0100 Subject: [PATCH] Remove Scaffold from BookmarksScreen --- .../feature/bookmarks/BookmarksScreen.kt | 63 +++++++++---------- 1 file changed, 28 insertions(+), 35 deletions(-) diff --git a/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt b/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt index b7618dbb2..672213492 100644 --- a/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt +++ b/feature/bookmarks/src/main/java/com/google/samples/apps/nowinandroid/feature/bookmarks/BookmarksScreen.kt @@ -70,44 +70,37 @@ fun BookmarksScreen( removeFromBookmarks: (String) -> Unit, modifier: Modifier = Modifier ) { - Scaffold( - containerColor = Color.Transparent, - contentWindowInsets = WindowInsets(0, 0, 0, 0) - ) { innerPadding -> - val scrollableState = rememberLazyGridState() - TrackScrollJank(scrollableState = scrollableState, stateName = "bookmarks:grid") - LazyVerticalGrid( - columns = Adaptive(300.dp), - contentPadding = PaddingValues(16.dp), - horizontalArrangement = Arrangement.spacedBy(32.dp), - verticalArrangement = Arrangement.spacedBy(24.dp), - state = scrollableState, - modifier = modifier - .fillMaxSize() - .testTag("bookmarks:feed") - .padding(innerPadding) - .consumedWindowInsets(innerPadding) - ) { - if (feedState is NewsFeedUiState.Loading) { - item(span = { GridItemSpan(maxLineSpan) }) { - NiaLoadingWheel( - modifier = Modifier - .fillMaxWidth() - .wrapContentSize() - .testTag("forYou:loading"), - contentDesc = stringResource(id = R.string.saved_loading), - ) - } + val scrollableState = rememberLazyGridState() + TrackScrollJank(scrollableState = scrollableState, stateName = "bookmarks:grid") + LazyVerticalGrid( + columns = Adaptive(300.dp), + contentPadding = PaddingValues(16.dp), + horizontalArrangement = Arrangement.spacedBy(32.dp), + verticalArrangement = Arrangement.spacedBy(24.dp), + state = scrollableState, + modifier = modifier + .fillMaxSize() + .testTag("bookmarks:feed") + ) { + if (feedState is NewsFeedUiState.Loading) { + item(span = { GridItemSpan(maxLineSpan) }) { + NiaLoadingWheel( + modifier = Modifier + .fillMaxWidth() + .wrapContentSize() + .testTag("forYou:loading"), + contentDesc = stringResource(id = R.string.saved_loading), + ) } + } - newsFeed( - feedState = feedState, - onNewsResourcesCheckedChanged = { id, _ -> removeFromBookmarks(id) }, - ) + newsFeed( + feedState = feedState, + onNewsResourcesCheckedChanged = { id, _ -> removeFromBookmarks(id) }, + ) - item(span = { GridItemSpan(maxLineSpan) }) { - Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.safeDrawing)) - } + item(span = { GridItemSpan(maxLineSpan) }) { + Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.safeDrawing)) } } }