diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs index c54aa140c971..8ccde25f0ffc 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs @@ -95,7 +95,9 @@ void IAppearanceObserver.OnAppearanceChanged(ShellAppearance appearance) public static Color DefaultBackgroundColor => ResolveThemeColor(RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#FEF7FF") : Color.FromArgb("#2c3e50"), RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#141218") : Color.FromArgb("#1B3147")); public static Color DefaultForegroundColor => ResolveThemeColor(RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#1D1B20") : Colors.Black, RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#E6E0E9") : Colors.White); public static Color DefaultTitleColor => ResolveThemeColor(RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#1D1B20") : Colors.White, RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#E6E0E9") : Colors.White); - public static readonly Color DefaultUnselectedColor = Color.FromRgba(255, 255, 255, 180); + public static Color DefaultUnselectedColor => ResolveThemeColor( + RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#49454F") : Color.FromRgba(255, 255, 255, 180), + RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#CAC4D0") : Color.FromRgba(255, 255, 255, 180)); internal static Color DefaultBottomNavigationViewBackgroundColor => ResolveThemeColor(RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#F3EDF7") : Colors.White, RuntimeFeature.IsMaterial3Enabled ? Color.FromArgb("#1D1B20") : Color.FromArgb("#1B3147")); internal static bool IsDarkTheme => Application.Current?.RequestedTheme == AppTheme.Dark; diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index 3dc7814bee99..929458bee7cb 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,8 +1,10 @@ #nullable enable *REMOVED*~static readonly Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultForegroundColor -> Microsoft.Maui.Graphics.Color *REMOVED*~static readonly Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultTitleColor -> Microsoft.Maui.Graphics.Color +*REMOVED*~static readonly Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultUnselectedColor -> Microsoft.Maui.Graphics.Color ~static Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultForegroundColor.get -> Microsoft.Maui.Graphics.Color ~static Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultTitleColor.get -> Microsoft.Maui.Graphics.Color +~static Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.DefaultUnselectedColor.get -> Microsoft.Maui.Graphics.Color override Microsoft.Maui.Controls.Shapes.Shape.OnPropertyChanged(string? propertyName = null) -> void ~override Microsoft.Maui.Controls.Handlers.Items.MauiRecyclerView.OnInterceptTouchEvent(Android.Views.MotionEvent e) -> bool ~override Microsoft.Maui.Controls.Handlers.Items.MauiRecyclerView.OnTouchEvent(Android.Views.MotionEvent e) -> bool diff --git a/src/Controls/tests/TestCases.Android.Tests/snapshots/android-notch-36/TopTabUnselectedTextVisibleWhenSwitchingTabs.png b/src/Controls/tests/TestCases.Android.Tests/snapshots/android-notch-36/TopTabUnselectedTextVisibleWhenSwitchingTabs.png new file mode 100644 index 000000000000..c672107de345 Binary files /dev/null and b/src/Controls/tests/TestCases.Android.Tests/snapshots/android-notch-36/TopTabUnselectedTextVisibleWhenSwitchingTabs.png differ diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue35125.cs b/src/Controls/tests/TestCases.HostApp/Issues/Issue35125.cs new file mode 100644 index 000000000000..dc890557f013 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue35125.cs @@ -0,0 +1,63 @@ +namespace Maui.Controls.Sample.Issues; + +[Issue(IssueTracker.Github, 35125, "Shell top-tab unselected text should remain visible in Material 3 light theme", PlatformAffected.Android)] +public class Issue35125 : Shell +{ + public Issue35125() + { + Tab shellTab = new Tab + { + Title = "Top Tabs" + }; + + shellTab.Items.Add(new ShellContent + { + Title = "TAB ONE", + ContentTemplate = new DataTemplate(typeof(Issue35125PageOne)) + }); + + shellTab.Items.Add(new ShellContent + { + Title = "TAB TWO", + ContentTemplate = new DataTemplate(typeof(Issue35125PageTwo)) + }); + + FlyoutItem flyoutItem = new FlyoutItem + { + Title = "Issue35125" + }; + + flyoutItem.Items.Add(shellTab); + Items.Add(flyoutItem); + } +} + +class Issue35125PageOne : ContentPage +{ + public Issue35125PageOne() + { + Title = "Page One"; + Content = new Label + { + Text = "The test passes if the unselected tabs are visible in view.", + AutomationId = "Issue35125PageOneLabel", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + } +} + +class Issue35125PageTwo : ContentPage +{ + public Issue35125PageTwo() + { + Title = "Page Two"; + Content = new Label + { + Text = "The test passes if the unselected tabs are visible in view.", + AutomationId = "Issue35125PageTwoLabel", + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center + }; + } +} diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35125.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35125.cs new file mode 100644 index 000000000000..6e40b7f573f8 --- /dev/null +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue35125.cs @@ -0,0 +1,27 @@ +#if ANDROID +using NUnit.Framework; +using UITest.Appium; +using UITest.Core; + +namespace Microsoft.Maui.TestCases.Tests.Issues; + +public class Issue35125 : _IssuesUITest +{ + public Issue35125(TestDevice device) : base(device) + { + } + + public override string Issue => "Shell top-tab unselected text should remain visible in Material 3 light theme"; + + [Test] + [Category(UITestCategories.Shell)] + public void TopTabUnselectedTextVisibleWhenSwitchingTabs() + { + App.WaitForElement("TAB TWO"); + App.Tap("TAB TWO"); + App.WaitForElement("Issue35125PageTwoLabel"); + + VerifyScreenshot(); + } +} +#endif