I am having a hard time hiding the bottom navigation bar when a dialog is displayed. I want that to NOT appear since the application is shown in full-screen mode.
Here is the class that builds the dialog:
class CreateNewFolderDialogFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return activity?.let {
// Use the Builder class for convenient dialog construction
//val builder = AlertDialog.Builder(it, R.style.AppBaseTheme)
val builder = AlertDialog.Builder(it)
val inflater = requireActivity().layoutInflater;
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
builder.setView(inflater.inflate(R.layout.create_new_folder_dialog, null))
// Add action buttons
.setPositiveButton("OK",
DialogInterface.OnClickListener { dialog, id ->
// create folder ...
})
.setNegativeButton("Cancel",
DialogInterface.OnClickListener { dialog, id ->
getDialog()?.cancel()
})
builder.create()
} ?: throw IllegalStateException("Activity cannot be null")
}
}
And here is the call of it inside another fragment:
fun createNewFolderDialog() {
val supportFragmentManager: FragmentManager = (activity as AppCompatActivity).supportFragmentManager
val newFragment = CreateNewFolderDialogFragment()
newFragment.show(supportFragmentManager, "newfolder")
}
And here is a screenshot of what I get when I show the dialog. As you can see the bottom navigation bar is shown. I'd like to prevent that to appear, ever.