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 {
29
29
ignoreTopSafeArea ?: boolean ; // optional ios parameter to top safe area. Default is true
30
30
ignoreBottomSafeArea ?: boolean ; // optional ios parameter to bottom safe area. Default is false
31
31
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
32
33
}
33
34
34
35
export abstract class ViewWithBottomSheetBase extends View {
Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
122
122
// set to maximum possible value to prevent dragging the sheet between peek and expanded height
123
123
behavior . setPeekHeight ( java . lang . Integer . MAX_VALUE ) ;
124
124
}
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
+ }
125
132
126
133
if ( owner && ! owner . isLoaded ) {
127
134
owner . callLoaded ( ) ;
You can’t perform that action at this time.
0 commit comments