-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Shell: Fix top-tab unselected text visibility in Material 3 light theme #35128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
388b82f
a55edf8
831004a
f4e5671
79c900a
8281aae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 | ||||||||||||||
|
Comment on lines
2
to
+7
|
||||||||||||||
| *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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| }; | ||
|
|
||
|
Comment on lines
+6
to
+12
|
||
| 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 | ||
| }; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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)] | ||||||
|
||||||
| [Category(UITestCategories.Shell)] | |
| [Category(UITestCategories.Material3)] |
Copilot
AI
Apr 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After switching tabs, the selected/unselected indicator/text can animate; capturing immediately can make the screenshot comparison flaky. Consider using VerifyScreenshot(retryTimeout: ...) here to allow the tab layout to settle before asserting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultUnselectedColoris a shipped public API as astatic readonlyfield (seePublicAPI.Shipped.txt). Converting it to a property is a binary breaking change; the framework-side fix should avoid removing/reshaping this shipped member (e.g., keep the field and introduce a new API/internal resolver for theme-aware defaults).