Background-Elevation not working after Android Studio update to Flamingo

103 Views Asked by At

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

Before Update Android Studio After Update Android Stuido

AlertDialog Before and After

Before Update Android Studio After Update Android Stuido

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.

0

There are 0 best solutions below