Hi folks, when you read headline, you probably ask yourself that what is the relationship between ‘Passionate’ and ‘Publish Libs’. But please don’t ask, because I will try to give a perspective to passionate and starting point to create and publish a lib as open source.

We usually need third…

My Problem is that . “I am using BottomSheetDialogFragment in my activity, the dialog shows full height in portrait mode but doesn’t when I switch to landscape mode.”

the solution for this issue is.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
BottomSheetDialog dialog = (BottomSheetDialog) getDialog();
// androidx should use: com.google.android.material.R.id.design_bottom_sheet FrameLayout bottomSheet = (FrameLayout)
dialog.findViewById(android.support.design.R.id.design_bottom_sheet);
BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet);
behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
behavior.setPeekHeight(0);
}
});
}

Oguzhan Alpayli

Oktein Company, Software Engineer, Python Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store