Meshing up many different solutions, I figured out this walktrough
AppEntryPoint.kt
class AppEntryPoint : Application() {
override fun onCreate() {
super.onCreate()
/*in some XIAOMI devices seems to be necessary*/
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
}
AndroidManifest.xml
<application
android:name=".AppEntryPoint"
...
android:theme="@style/Theme.MyMainTheme">
...
</application>
themes.xml
<style name="Theme.MyMainTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
...
<item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
I don't know if it is the correct solution, but now it works for me.
There's maybe a strange way to manage this kind of behaviour in some Xiaomi devices...
Hope this answer could be useful also to others