I am using BottomSheetDialogFragment in my activity, the dialog shows full height in portrait mode but doesn't when I switch to landscape mode.
MainActivity.java
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CustomBottomSheetDialog customBottomSheetDialog = new CustomBottomSheetDialog();
customBottomSheetDialog.show(getSupportFragmentManager(),customBottomSheetDialog.getTag());
}
}
CustomBottomSheetDialog
public class CustomBottomSheetDialog extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return View.inflate(getContext(), R.layout.view_config, null);
}
}
CustomBottomSheetDialog layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:background="#fdf107"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="196dp"
android:gravity="center"
android:textColor="@color/colorAccent"
android:text="BottomSheetDialogFragment"/>
</LinearLayout>
in landscape mode, i have to drag BottomSheetDialogFragment to see the whole content.