Both SetStatusBarColor and SetNavigationBarColor are deprecated and removed in Android 15. They still work for Android 14 and lower but not Android 15. All part of going Edge-to-Edge.
You might want to use something like the following. Add an else to each section to use SetStatusBarColor and SetNavigationBarColor if you want the old behaviour for devices less than 15.
private void SetSystemBarsAppearance()
{
WindowInsetsControllerCompat windowInsetsController = new(Window!, Window!.DecorView);
if (!IsNightModeActive())
{
if (OperatingSystem.IsAndroidVersionAtLeast(35))
{
windowInsetsController.AppearanceLightStatusBars = true;
windowInsetsController.AppearanceLightNavigationBars = true;
}
}
else
{
if (OperatingSystem.IsAndroidVersionAtLeast(35))
{
windowInsetsController.AppearanceLightStatusBars = false;
windowInsetsController.AppearanceLightNavigationBars = false;
}
}
}
If you want to see a working example (Android only) check the BooksFragment and the README in the following project https://github.com/gmck/NavigationGraph9Net9