Skip to content
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

Fix Provided consistent behavior of text color in tabbed page in all platforms. #24782

Merged
merged 3 commits into from
Sep 26, 2024
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 @@ -531,7 +531,7 @@ void UpdateiOS15TabBarAppearance()
tabbed.IsSet(TabbedPage.UnselectedTabColorProperty) ? tabbed.UnselectedTabColor : null,
tabbed.IsSet(TabbedPage.BarBackgroundColorProperty) ? tabbed.BarBackgroundColor : null,
tabbed.IsSet(TabbedPage.BarTextColorProperty) ? tabbed.BarTextColor : null,
null);
tabbed.IsSet(TabbedPage.BarTextColorProperty) ? tabbed.BarTextColor : null);
}

#region IPlatformViewHandler
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18775.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Maui.Controls.Sample.Issues"
x:Class="Maui.Controls.Sample.Issues.Issue18775" >

<TabbedPage.Resources>

<Color x:Key="Primary">#512BD4</Color>
<Color x:Key="Light">#DFD8F7</Color>
<Color x:Key="Dark">#2B0B98</Color>
<Color x:Key="White">White</Color>
<Color x:Key="Black">Black</Color>
<Color x:Key="LightGray">#E5E5E1</Color>
<Color x:Key="DarkGray">#505050</Color>
<Style TargetType="TabbedPage" ApplyToDerivedTypes="True">
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
<Setter Property="UnselectedTabColor" Value="{AppThemeBinding Light={StaticResource LightGray}, Dark={StaticResource DarkGray}}" />
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource DarkGray}, Dark={StaticResource LightGray}}" />
</Style>
</TabbedPage.Resources>

<NavigationPage Title="One">
<x:Arguments>
<local:Issue18775NavPage Title="One" />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Two">
<x:Arguments>
<local:Issue18775NavPage Title="Two" />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Three">
<x:Arguments>
<local:Issue18775NavPage Title="Three" />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Four">
<x:Arguments>
<local:Issue18775NavPage Title="Four" />
</x:Arguments>
</NavigationPage>
</TabbedPage>
28 changes: 28 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue18775.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Threading.Tasks;
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Xaml;
using Microsoft.Maui.Devices;

namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 18775, "[regression/8.0.3] Cannot control unselected text color of tabs within TabbedPage", PlatformAffected.iOS)]
public partial class Issue18775 : TabbedPage
{
public Issue18775()
{
InitializeComponent();
}

}

public partial class Issue18775NavPage : ContentPage
{
public Issue18775NavPage()
{
this.Content = new Label() { Text = "Label" ,AutomationId = "MauiLabel" };
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue18775 : _IssuesUITest
{

public Issue18775(TestDevice device) : base(device)
{
}

public override string Issue => "[regression/8.0.3] Cannot control unselected text color of tabs within TabbedPage";

[Test]
[Category(UITestCategories.TabbedPage)]
[FailsOnMac]
public void TabbedPageUnselectedBarTextColorConsistency()
{
App.WaitForElement("MauiLabel");
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