Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Google.Android.Material.Navigation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Handlers.Compatibility;
using Microsoft.Maui.Graphics;
using AColor = Android.Graphics.Color;
using AView = Android.Views.View;
Expand Down Expand Up @@ -141,6 +142,11 @@ protected virtual void SetAppearance(ShellAppearance appearance)
return;
}

// Apply background color from appearance, fallback to default if unavailable
if (_bottomView.Background is ColorDrawable background && appearance is IShellAppearanceElement appearanceElement)
{
background.Color = appearanceElement.EffectiveTabBarBackgroundColor?.ToPlatform() ?? ShellRenderer.DefaultBottomNavigationViewBackgroundColor.ToPlatform();
}
_appearanceSet = true;
_appearanceTracker.SetAppearance(_bottomView, appearance);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue16522.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue16522"
TabBarBackgroundColor="#0000FF"
>
<FlyoutItem Title="Main">
<Tab Title="Main">
<ShellContent>
<ContentPage Title="Main">
<StackLayout Padding="10">
<Label AutomationId="Label" Text="Welcome to the Main Page!"
FontSize="24"
HorizontalOptions="Center" />
<!-- Add additional UI elements here -->
</StackLayout>
</ContentPage>
</ShellContent>
</Tab>

<Tab Title="Settings">
<ShellContent>
<ContentPage Title="Settings">
<StackLayout Padding="10">
<Label Text="Settings Page"
FontSize="24"
HorizontalOptions="Center" />
<!-- Additional UI for Settings -->
</StackLayout>
</ContentPage>
</ShellContent>
</Tab>
</FlyoutItem>

<FlyoutItem Title="About">
<ShellContent>
<ContentPage Title="About">
<StackLayout Padding="10">
<Label Text="About Page"
FontSize="24"
HorizontalOptions="Center" />
<!-- Additional UI for About -->
</StackLayout>
</ContentPage>
</ShellContent>
</FlyoutItem>
</Shell>
12 changes: 12 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue16522.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 16522, "[Android] Tabs briefly display wrong background color when navigating between flyout items", PlatformAffected.Android)]
public partial class Issue16522 : Shell
{
public Issue16522()
{
InitializeComponent();

}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue16522 : _IssuesUITest
{
public Issue16522(TestDevice device) : base(device)
{
}

public override string Issue => "[Android] Tabs briefly display wrong background color when navigating between flyout items";

[Test]
[Category(UITestCategories.Shell)]
public void ShellTabBarBackgroundColor()
{
App.WaitForElement("Label");
App.Tap("Settings");
App.Tap("Main");
App.WaitForElement("Label");
VerifyScreenshot();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading