Skip to content

Commit

Permalink
refactor: add toggle to always show buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Aug 20, 2024
1 parent bb34982 commit 375d544
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fun <T> Scrollable(
isHideTooltip = true
}
},
alwaysShowButtons: Boolean = false,
content: @Composable (page: List<T>) -> Unit,
) {
var size by remember { mutableStateOf(Size(0, 0)) }
Expand All @@ -49,9 +50,9 @@ fun <T> Scrollable(
position = navbarPosition,
navbar = {
NavbarButtons(navbarPosition, navbarBackground) {
if (line > 0) previousButton()
if (alwaysShowButtons || line > 0) previousButton()
else Spacer(1, 1)
if (end < items.size) nextButton()
if (alwaysShowButtons || end < items.size) nextButton()
else Spacer(1, 1)
}
},
Expand Down

0 comments on commit 375d544

Please sign in to comment.