File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export interface BottomSheetOptions {
2929 ignoreTopSafeArea ?: boolean ; // optional ios parameter to top safe area. Default is true
3030 ignoreBottomSafeArea ?: boolean ; // optional ios parameter to bottom safe area. Default is false
3131 disableDimBackground ?: boolean ; // optional parameter to remove the dim background
32+ skipCollapsedState ?: boolean ; // optional Android parameter to skip midway state when view is greater than 50%. Default is false
3233}
3334
3435export abstract class ViewWithBottomSheetBase extends View {
Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
122122 // set to maximum possible value to prevent dragging the sheet between peek and expanded height
123123 behavior . setPeekHeight ( java . lang . Integer . MAX_VALUE ) ;
124124 }
125+ const skipCollapsedState = ! bottomSheetOptions . options || bottomSheetOptions . options . skipCollapsedState === true ;
126+ if ( skipCollapsedState ) {
127+ // directly expand the bottom sheet after start
128+ behavior . setState ( com . google . android . material . bottomsheet . BottomSheetBehavior . STATE_EXPANDED ) ;
129+ // disable peek/collapsed state
130+ behavior . setSkipCollapsed ( true ) ;
131+ }
125132
126133 if ( owner && ! owner . isLoaded ) {
127134 owner . callLoaded ( ) ;
You can’t perform that action at this time.
0 commit comments