-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update a tabbar with gradient on app theme change
- Loading branch information
Showing
6 changed files
with
152 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/Controls/tests/TestCases.HostApp/Issues/Issue24356.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?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" | ||
x:Class="Maui.Controls.Sample.Issues.Issue24356" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"> | ||
<TabbedPage.BarBackground> | ||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> | ||
<GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}" | ||
Offset="0.0" /> | ||
<GradientStop Color="{AppThemeBinding Light=White, Dark=Black}" | ||
Offset="0.5" /> | ||
<GradientStop Color="{AppThemeBinding Light=Red, Dark=Brown}" | ||
Offset="1.0" /> | ||
</LinearGradientBrush> | ||
</TabbedPage.BarBackground> | ||
<ContentPage Title="Tab 1"> | ||
<Grid> | ||
<Label IsVisible="{AppThemeBinding Light=True, Dark=False}" AutomationId="lightThemeLabel" Text="Light theme"/> | ||
<Label IsVisible="{AppThemeBinding Light=False, Dark=True}" AutomationId="darkThemeLabel" Text="Dark theme"/> | ||
</Grid> | ||
</ContentPage> | ||
<ContentPage Title="Tab 2"/> | ||
</TabbedPage> |
11 changes: 11 additions & 0 deletions
11
src/Controls/tests/TestCases.HostApp/Issues/Issue24356.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 24356, "AppThemeBinding BarBackground with Brush in NavigationPage and TabbedPage not working", PlatformAffected.All)] | ||
public partial class Issue24356 : TabbedPage | ||
{ | ||
public Issue24356() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24356.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#if ANDROID || IOS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue24356 : _IssuesUITest | ||
{ | ||
public Issue24356(TestDevice testDevice) : base(testDevice) | ||
{ | ||
} | ||
|
||
public override string Issue => "AppThemeBinding BarBackground with Brush in NavigationPage and TabbedPage not working"; | ||
|
||
[Test] | ||
[Category(UITestCategories.TabbedPage)] | ||
public void GradientInTabBarShouldChange() | ||
{ | ||
try { | ||
App.WaitForElement("lightThemeLabel"); | ||
App.SetDarkTheme(); | ||
App.WaitForElement("darkThemeLabel"); | ||
VerifyScreenshot(); | ||
} | ||
finally | ||
{ | ||
App.SetLightTheme(); | ||
} | ||
} | ||
} | ||
} | ||
#endif |