Class BottomSheetState
-
- All Implemented Interfaces:
public final class BottomSheetStateState of the persistent bottom sheet in ScanbotScaffold.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBottomSheetState.Companion
-
Field Summary
Fields Modifier and Type Field Description private final SwipeableV2State<BottomSheetValue>swipeableStateprivate final BottomSheetValuecurrentValueprivate final BooleanisExpandedprivate final BooleanisCollapsedprivate final Floatprogressprivate final Floatoffsetpublic final static BottomSheetState.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description BottomSheetState(BottomSheetValue initialValue, <Error class: unknown class><Float> animationSpec, Function1<BottomSheetValue, Boolean> confirmValueChange)
-
Method Summary
Modifier and Type Method Description final SwipeableV2State<BottomSheetValue>getSwipeableState()final BottomSheetValuegetCurrentValue()final BooleanisExpanded()final BooleanisCollapsed()final FloatgetProgress()final FloatgetOffset()final Unitexpand()Expand the bottom sheet with an animation and suspend until the animation finishes or is cancelled. final Unitcollapse()Collapse the bottom sheet with animation and suspend until it if fully collapsed or animation has been cancelled. final FloatrequireOffset()Require the current offset. -
-
Constructor Detail
-
BottomSheetState
BottomSheetState(BottomSheetValue initialValue, <Error class: unknown class><Float> animationSpec, Function1<BottomSheetValue, Boolean> confirmValueChange)
- Parameters:
initialValue- The initial value of the state.animationSpec- The default animation that will be used to animate to a new state.confirmValueChange- Optional callback invoked to confirm or veto a pending state change.
-
-
Method Detail
-
getSwipeableState
final SwipeableV2State<BottomSheetValue> getSwipeableState()
-
getCurrentValue
final BottomSheetValue getCurrentValue()
-
isExpanded
final Boolean isExpanded()
-
isCollapsed
final Boolean isCollapsed()
-
getProgress
final Float getProgress()
-
expand
final Unit expand()
Expand the bottom sheet with an animation and suspend until the animation finishes or is cancelled. Note: If the pick height is equal to the sheet height, this method will animate to the Collapsed state.
This method will throw CancellationException if the animation is interrupted.
-
collapse
final Unit collapse()
Collapse the bottom sheet with animation and suspend until it if fully collapsed or animation has been cancelled. This method will throw CancellationException if the animation is interrupted.
-
requireOffset
final Float requireOffset()
Require the current offset.
-
-
-
-