Also from my testing the system setting does not reflect the value set on the window layout params, so I suspect the code should be something like this:
var context = Platform.CurrentActivity;
if (context == null) {
return 0;
}
var windowBrightness = window.Attributes.ScreenBrightness;
if (windowBrightness < 0) {
return Settings.System.GetInt(context.ContentResolver, Settings.System.ScreenBrightness) / 255;
}
return windowBrightness;
From the Android documentation:
Also from my testing the system setting does not reflect the value set on the window layout params, so I suspect the code should be something like this: