Home > Software design >  remove background from Bottomsheet android studio
remove background from Bottomsheet android studio

Time:04-29

I have created bottomsheet dialog which work great when it is in portait mode but it shows white backgrund when screen in landscape mode attaching the error image

here is code that i used xml: https://github.com/windowschares/test/blob/main/bottomsheet.xml java code :

 final BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this);
    bottomSheetDialog.setContentView(R.layout.layout_bottomsheet);
    LinearLayout sheetView =findViewById(R.id.bottom_sheet_id);
    SwitchCompat disable_pip = bottomSheetDialog.findViewById(R.id.disable_pip);
    SwitchCompat Enable_fullscreen = bottomSheetDialog.findViewById(R.id.Enable_fullscreen);
    ImageView external_player = bottomSheetDialog.findViewById(R.id.external_player);
    bottomSheetDialog.show();

CodePudding user response:

The LinearLayout with id bottom_sheet_id is set to a fixed size which is why it's not taking up the whole width of its parent. Set it to match_parent to fix this.

CodePudding user response:

I want to achive the bottomsheet in landscape mode like thisenter image description here screen is black because they blocked screen recording in disney. apart form that those popup/bottomsheet is in just right/fit to text

  • Related