@@ -32,9 +32,9 @@ class MDCBottomSheetControllerDelegateImpl extends NSObject {
3232 const topPadding = window . safeAreaInsets . top ;
3333 const bottomPadding = window . safeAreaInsets . bottom ;
3434
35- const isStateCollapsed = heightScreen - yOffset - bottomPadding === heightCollapsedSheet ;
35+ const isCollapsed = heightScreen - yOffset - bottomPadding === heightCollapsedSheet ;
3636 const isExpanded = yOffset === topPadding ;
37- if ( ! isStateCollapsed && ! isExpanded ) {
37+ if ( ! isCollapsed && ! isExpanded ) {
3838 //normalized = (value - min) / (max - min);
3939 let normalized = 0 ;
4040 if ( yOffset + bottomPadding > heightScreen - heightCollapsedSheet ) {
@@ -44,8 +44,7 @@ class MDCBottomSheetControllerDelegateImpl extends NSObject {
4444 }
4545 owner . _onChangeStateBottomSheetCallback ( StateBottomSheet . DRAGGING , normalized ) ;
4646 } else {
47- const state = isStateCollapsed ? StateBottomSheet . COLLAPSED : StateBottomSheet . EXPANDED ;
48- owner . _onChangeStateBottomSheetCallback ( state , state ) ;
47+ owner . _onChangeStateBottomSheetCallback ( isCollapsed ? StateBottomSheet . COLLAPSED : StateBottomSheet . EXPANDED ) ;
4948 }
5049 }
5150 }
@@ -65,20 +64,14 @@ class MDCBottomSheetControllerDelegateImpl extends NSObject {
6564 if ( state === MDCSheetState . Closed ) {
6665 if ( owner ) {
6766 owner . _onDismissBottomSheetCallback && owner . _onDismissBottomSheetCallback ( ) ;
68- if ( owner . _onChangeStateBottomSheetCallback ) {
69- owner . _onChangeStateBottomSheetCallback ( StateBottomSheet . CLOSED , StateBottomSheet . CLOSED ) ;
70- }
67+ owner . _onChangeStateBottomSheetCallback && owner . _onChangeStateBottomSheetCallback ( StateBottomSheet . CLOSED ) ;
7168 if ( owner && owner . isLoaded ) {
7269 owner . callUnloaded ( ) ;
7370 }
7471 }
7572 } else {
7673 if ( owner && owner . _onChangeStateBottomSheetCallback ) {
77- if ( state === MDCSheetState . Extended ) {
78- owner . _onChangeStateBottomSheetCallback ( StateBottomSheet . EXPANDED , StateBottomSheet . EXPANDED ) ;
79- } else {
80- owner . _onChangeStateBottomSheetCallback ( StateBottomSheet . COLLAPSED , StateBottomSheet . COLLAPSED ) ;
81- }
74+ owner . _onChangeStateBottomSheetCallback ( state === MDCSheetState . Extended ? StateBottomSheet . EXPANDED : StateBottomSheet . EXPANDED )
8275 }
8376 }
8477 }
0 commit comments