Skip to content

Commit 123193b

Browse files
fix(camera): Android dialog not fully showing when in landscape (#2276)
1 parent f2be036 commit 123193b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraBottomSheetDialogFragment.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ public void setupDialog(Dialog dialog, int style) {
113113
dialog.setContentView(parentLayout.getRootView());
114114

115115
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) parentLayout.getParent()).getLayoutParams();
116-
CoordinatorLayout.Behavior behavior = params.getBehavior();
116+
CoordinatorLayout.Behavior<View> behavior = params.getBehavior();
117117

118-
if (behavior != null && behavior instanceof BottomSheetBehavior) {
119-
((BottomSheetBehavior) behavior).addBottomSheetCallback(mBottomSheetBehaviorCallback);
118+
if (behavior instanceof BottomSheetBehavior) {
119+
BottomSheetBehavior<View> bottomSheetBehavior = (BottomSheetBehavior<View>) behavior;
120+
bottomSheetBehavior.addBottomSheetCallback(mBottomSheetBehaviorCallback);
121+
bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
120122
}
121123
}
122124
}

0 commit comments

Comments
 (0)