I have just updated my Android Studio to Flamingo and run the project on the device.
All AlertDialog and BottomSheetDialog Backgrounds are not working now. I didn't change the code. I tried to change the theme and background colour of dialog.
What could be the reason?
Please see the before and after UI screenshots.
BottomSheetDialog Before and After
AlertDialog Before and After
Here my AlertDialog code for reference.
fun showCustomProgressDialog(mContext: Context?): AlertDialog? {
try {
val factory = LayoutInflater.from(mContext)
val customProgressBar: View = factory.inflate(R.layout.custom_progress_dialog, null)
val customDialog = AlertDialog.Builder(mContext).create()
customDialog.setView(customProgressBar)
customDialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
customDialog.setCancelable(false)
return customDialog
} catch (e: Exception) {
e.printStackTrace()
}
return null
}
Update: It is working fine in a real devices, still not working in Emulator.



