I have 2 identical full screen Dialog classes (Dialogs A and B) that extend from DialogFragment (support library one) both look as expected while ran on devices with APIs 24+. The Dialogs differ in their implementations.
Dialog A - Overrides onCreateDialog and its height is cropped on API 23<=
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val inflater = requireActivity().layoutInflater
val view = inflater.inflate(R.layout.fragment_cropped_dialog, null)
// Setting data to views
val builder = AlertDialog.Builder(activity)
builder.setView(view)
val dialog = builder.create()
return dialog
}
Dialog B - Overrides onCreateView and is displayed full screen regardless of API
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_not_cropped_dialog, container, false)
// Setting data to views
val builder = AlertDialog.Builder(activity)
builder.setView(view)
val dialog = builder.create()
return view
}
Question: What is the reason the dialog A is cropped on API 23 and lower?

