diff --git a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj
index b47172548e..c2fe16970a 100644
--- a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj
+++ b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj
@@ -25,7 +25,7 @@
-
+
diff --git a/src/Android/Avalonia.Android/Avalonia.Android.csproj b/src/Android/Avalonia.Android/Avalonia.Android.csproj
index 14376acfed..0c1100ab5f 100644
--- a/src/Android/Avalonia.Android/Avalonia.Android.csproj
+++ b/src/Android/Avalonia.Android/Avalonia.Android.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/Android/Avalonia.Android/AvaloniaAccessHelper.cs b/src/Android/Avalonia.Android/AvaloniaAccessHelper.cs
index faacff7554..ac92aafc29 100644
--- a/src/Android/Avalonia.Android/AvaloniaAccessHelper.cs
+++ b/src/Android/Avalonia.Android/AvaloniaAccessHelper.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
using Android.OS;
using AndroidX.Core.View.Accessibility;
@@ -157,7 +158,7 @@ namespace Avalonia.Android
if (labeledBy is not null)
{
GetOrCreateNodeInfoProvidersFromPeer(labeledBy, out int labeledById);
- nodeInfo.SetLabeledBy(_view, labeledById);
+ nodeInfo.AddLabeledBy(_view, labeledById);
}
// UI debug metadata
@@ -181,7 +182,7 @@ namespace Avalonia.Android
_view.TopLevelImpl.PointToScreen(bounds.TopLeft),
_view.TopLevelImpl.PointToScreen(bounds.BottomRight)
);
- nodeInfo.SetBoundsInParent(new(
+ nodeInfo.SetBoundsInScreen(new(
screenRect.X, screenRect.Y,
screenRect.Right, screenRect.Bottom
));
diff --git a/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs b/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs
index 45345f9da7..4991a7547f 100644
--- a/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs
+++ b/src/Android/Avalonia.Android/Platform/AndroidInsetsManager.cs
@@ -302,12 +302,17 @@ namespace Avalonia.Android.Platform
_activity.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
var androidColor = global::Android.Graphics.Color.Argb(color.A, color.R, color.G, color.B);
- _activity.Window.SetStatusBarColor(androidColor);
- if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
+ // Status and navigation bar colors can't be changed at all with API level >= 35
+ if (!OperatingSystem.IsAndroidVersionAtLeast(35))
{
- // As we can only change the navigation bar's foreground api 26 and newer, we only change the background color if running on those versions
- _activity.Window.SetNavigationBarColor(androidColor);
+ _activity.Window.SetStatusBarColor(androidColor);
+
+ if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
+ {
+ // As we can only change the navigation bar's foreground api 26 and newer, we only change the background color if running on those versions
+ _activity.Window.SetNavigationBarColor(androidColor);
+ }
}
}
}