Skip to content

Commit

Permalink
fix: isCollapsed and isExpanded
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rl3x committed Jun 17, 2024
1 parent 0692c2f commit 292bef6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bottom-drawer-scaffold/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply from: '../buildCompose.gradle'

ext {
PUBLISH_GROUP_ID = 'de.charlex.compose'
PUBLISH_VERSION = '2.0.0-rc02'
PUBLISH_VERSION = '2.0.0-rc03'
PUBLISH_ARTIFACT_ID = 'bottom-drawer-scaffold'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,20 @@ fun BottomDrawerScaffold(

@OptIn(ExperimentalMaterial3Api::class)
fun BottomSheetScaffoldState.isCollapsed(): Boolean {
return bottomSheetState.hasPartiallyExpandedState
return bottomSheetState.currentValue == SheetValue.PartiallyExpanded
}

@OptIn(ExperimentalMaterial3Api::class)
fun BottomSheetScaffoldState.isExpanded(): Boolean {
return bottomSheetState.hasExpandedState
return bottomSheetState.currentValue == SheetValue.Expanded
}

@OptIn(ExperimentalMaterial3Api::class)
suspend fun BottomSheetScaffoldState.toggle() {
if (bottomSheetState.targetValue == SheetValue.Expanded) {
bottomSheetState.partialExpand()
} else if (bottomSheetState.targetValue == SheetValue.PartiallyExpanded) {
bottomSheetState.expand()
if (isExpanded()) {
collapse()
} else if (isCollapsed()) {
expand()
}
}

Expand Down

0 comments on commit 292bef6

Please sign in to comment.