Skip to content

Commit a5e791e

Browse files
committed
feat(bottomsheet): android disableDimBackground
1 parent 36f5803 commit a5e791e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/bottomsheet/bottomsheet.android.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
4040
this.bindingContext = fromObject(options.context);
4141
this._raiseShownBottomSheetEvent();
4242
},
43-
dismissCallback: () => this._onDismissBottomSheetCallback(),
43+
dismissCallback: () => this._onDismissBottomSheetCallback()
4444
};
4545
const dfListener = new com.nativescript.material.bottomsheet.BottomSheetDialogFragment.BottomSheetDialogFragmentListener({
4646
onCreateDialog(fragment: com.nativescript.material.bottomsheet.BottomSheetDialogFragment, savedInstanceState: android.os.Bundle): android.app.Dialog {
@@ -58,7 +58,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
5858
eventName: 'activityBackPressed',
5959
object: owner,
6060
activity: owner._context,
61-
cancel: false,
61+
cancel: false
6262
} as AndroidActivityBackPressedEventData;
6363

6464
// Fist fire application.android global event
@@ -69,7 +69,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
6969

7070
owner.notify(args);
7171
return args.cancel || owner.onBackPressed();
72-
},
72+
}
7373
});
7474
const dialog = new com.nativescript.material.bottomsheet.BottomSheetDialog(fragment.getActivity(), theme);
7575
dialog.setListener(dialogListener);
@@ -79,6 +79,9 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
7979
if (creationOptions.dismissOnBackgroundTap !== undefined) {
8080
dialog.setCanceledOnTouchOutside(creationOptions.dismissOnBackgroundTap);
8181
}
82+
if (creationOptions.disableDimBackground === true) {
83+
dialog.getWindow().clearFlags(android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND);
84+
}
8285
}
8386
return dialog;
8487
},
@@ -146,7 +149,7 @@ export class ViewWithBottomSheet extends ViewWithBottomSheetBase {
146149
owner._isAddedToNativeVisualTree = false;
147150
owner._tearDownUI(true);
148151
}
149-
},
152+
}
150153
});
151154
const df = new com.nativescript.material.bottomsheet.BottomSheetDialogFragment();
152155
df.setListener(dfListener);

0 commit comments

Comments
 (0)