Skip to content

Commit

Permalink
Remove app bar scroll behaviors (#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbanes committed Jun 26, 2024
1 parent 949c113 commit f682a82
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
Expand All @@ -56,7 +55,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -89,7 +87,6 @@ fun <E : Entry> EntryGrid(
modifier: Modifier = Modifier,
) {
val snackbarHostState = remember { SnackbarHostState() }
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()

val coroutineScope = rememberCoroutineScope()
val lazyGridState = rememberLazyStaggeredGridState()
Expand Down Expand Up @@ -129,7 +126,6 @@ fun <E : Entry> EntryGrid(
}
}
.fillMaxWidth(),
scrollBehavior = scrollBehavior,
)
},
blurTopBar = true,
Expand Down Expand Up @@ -166,7 +162,6 @@ fun <E : Entry> EntryGrid(
horizontalArrangement = Arrangement.spacedBy(gutter),
verticalItemSpacing = gutter,
modifier = Modifier
.nestedScroll(scrollBehavior.nestedScrollConnection)
.bodyWidth()
.fillMaxHeight(),
) {
Expand Down Expand Up @@ -291,7 +286,6 @@ fun EntryGridAppBar(
onNavigateUp: () -> Unit,
onRefreshActionClick: () -> Unit,
modifier: Modifier = Modifier,
scrollBehavior: TopAppBarScrollBehavior? = null,
) {
TopAppBar(
navigationIcon = {
Expand All @@ -304,7 +298,6 @@ fun EntryGridAppBar(
},
modifier = modifier,
colors = TopAppBarDefaults.topAppBarColors(containerColor = Color.Transparent),
scrollBehavior = scrollBehavior,
title = { Text(text = title) },
actions = {
// This button refresh allows screen-readers, etc to trigger a refresh.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import androidx.compose.material3.Snackbar
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
Expand All @@ -57,7 +56,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -173,7 +171,6 @@ internal fun Library(
}
}

val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
val coroutineScope = rememberCoroutineScope()
val lazyGridState = rememberLazyGridState()

Expand All @@ -183,7 +180,6 @@ internal fun Library(
title = LocalStrings.current.libraryTitle,
loggedIn = state.authState == TraktAuthState.LOGGED_IN,
user = state.user,
scrollBehavior = scrollBehavior,
refreshing = state.isLoading,
onRefreshActionClick = refresh,
onUserActionClick = openUser,
Expand Down Expand Up @@ -225,7 +221,6 @@ internal fun Library(
onSortSelected = onSortSelected,
openShowDetails = openShowDetails,
modifier = Modifier
.nestedScroll(scrollBehavior.nestedScrollConnection)
.bodyWidth()
.fillMaxHeight(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import androidx.compose.material3.Snackbar
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -53,7 +52,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -185,7 +183,6 @@ internal fun UpNext(
}
}

val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
val coroutineScope = rememberCoroutineScope()
val lazyGridState = rememberLazyGridState()

Expand All @@ -195,7 +192,6 @@ internal fun UpNext(
title = LocalStrings.current.upnextTitle,
loggedIn = state.authState == TraktAuthState.LOGGED_IN,
user = state.user,
scrollBehavior = scrollBehavior,
refreshing = state.isLoading,
onRefreshActionClick = refresh,
onUserActionClick = openUser,
Expand Down Expand Up @@ -244,7 +240,6 @@ internal fun UpNext(
horizontalArrangement = Arrangement.spacedBy((gutter - 8.dp).coerceAtLeast(0.dp)),
verticalArrangement = Arrangement.spacedBy((gutter - 8.dp).coerceAtLeast(0.dp)),
modifier = Modifier
.nestedScroll(scrollBehavior.nestedScrollConnection)
.bodyWidth()
.fillMaxHeight(),
) {
Expand Down

0 comments on commit f682a82

Please sign in to comment.