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();
3
Answers
thanks for your wonderful help and thankyou for taking time in checking my code. i came to conclusion that, its not possible to achieve that effect shown in hotstar (i.stack.imgur.com/kUaOa.png) so i have plan to convert them to horizontal and add three more items to fill the gap
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 tomatch_parent
to fix this.May it help you to achieve your output-
Please change xml images/colors/text/icons as per your requirement
XML File–
And style.xml/theme.xml
Add this line in your parent theme
and add this custom style in your style.xml/theme.xml file