Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
- @Override
- public void onStateChanged(@NonNull View bottomSheet, int newState) {
- if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_COLLAPSED) {
- if (negativeClosing) {
- negativeClosing = false;
- negativeClose();
- } else if (bottomSheetBehavior.getState() == STATE_EXPANDED) {
- if (!isReadyToClose && activity != null) {
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
- isReadyToClose = true;
- }
- }
- }
- }
- @Override
- public void onSlide(@NonNull View bottomSheet, float slideOffset) {
- if (slideOffset == 0.0f) {
- negativeClose();
- }
- if (!isReadyToClose && activity != null) {
- activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
- isReadyToClose = true;
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement