Android Remove Dialog Black Overlay Background (Kotlin)

April 13, 2019
class BusyDialogFragment: DialogFragment() {
    override fun onStart() {
        super.onStart()

        // remove black outer overlay, or change opacity
        dialog?.window?.also { window ->
            window.attributes?.also { attributes ->
                attributes.dimAmount = 0.1f
                window.attributes = attributes
            }
        }
    }
}

NOTE: To make the white background transparent, refer to Set Dialog Background Transparent

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.