diff --git a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java index 254f1360e..1f6f79c7c 100644 --- a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java +++ b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java @@ -113,10 +113,12 @@ public void setupDialog(Dialog dialog, int style) { dialog.setContentView(parentLayout.getRootView()); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) parentLayout.getParent()).getLayoutParams(); - CoordinatorLayout.Behavior behavior = params.getBehavior(); + CoordinatorLayout.Behavior behavior = params.getBehavior(); - if (behavior != null && behavior instanceof BottomSheetBehavior) { - ((BottomSheetBehavior) behavior).addBottomSheetCallback(mBottomSheetBehaviorCallback); + if (behavior instanceof BottomSheetBehavior) { + BottomSheetBehavior bottomSheetBehavior = (BottomSheetBehavior) behavior; + bottomSheetBehavior.addBottomSheetCallback(mBottomSheetBehaviorCallback); + bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); } } }