I want to set the status bar to translucent on devices running MIUI. I can't find a solution to this problem.
I've tried doing it like this:
activity.window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLCUENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
and similarly when I want to remove the translucent status bar
activity.window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
It works on most devices (I haven't tried all of them) but it doesn't work on MIUI devices. I've tried it on Xiaomi Redmi Note 4 running Android 7.0 (Nougat). Transparent status bar works normally, but translucent doesn't.