This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Fix Shell NavigationBar and TabBar color issues #14649
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a1b422b
Fix Shell NavBar colors in iOS 15
jsuarezruiz a8e3a07
Added repro sample
jsuarezruiz 80588f1
Updated Shell TabBar colors logic
jsuarezruiz 899402e
Fix tint and add tab testcase
jfversluis 5a13946
Fixed iOS15 TabbedPage color issues
jsuarezruiz 85d144a
Updated Shell tabs colors (disabled, unselected etc) in iOS 15
jsuarezruiz c371e12
Fix TabBar icon color in iOS 15
jsuarezruiz c5be5cb
Update NavBar Appearance code
jsuarezruiz 33a788f
Update SafeShellTabBarAppearanceTracker.cs
jfversluis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14505-II.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,49 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 0, "TabbedPage BarBackgroundColor not working on iOS 15", PlatformAffected.iOS)] | ||
public class Issue14505_II : TestTabbedPage | ||
{ | ||
public Issue14505_II() | ||
{ | ||
BarBackgroundColor = Color.Red; | ||
BarTextColor = Color.White; | ||
SelectedTabColor = Color.Green; | ||
UnselectedTabColor = Color.Blue; | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Children.Add(new ContentPage() { Title = "Tab 1", Content = CreateTabContent() }); | ||
Children.Add(new ContentPage() { Title = "Tab 2", Content = CreateTabContent() }); | ||
} | ||
|
||
Grid CreateTabContent() | ||
{ | ||
var layout = new Grid | ||
{ | ||
Margin = 12 | ||
}; | ||
|
||
var instructions = new Label | ||
{ | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "If TabBar BarBackgroundColor is Red, the test has passed." | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
|
||
return layout; | ||
} | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue14505.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,84 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 14505, "[Bug] Shell BackgroundColor and TabBarBackgroundColor do not update on iOS 15", PlatformAffected.iOS)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
#endif | ||
public class Issue14505 : TestShell | ||
{ | ||
const string Test1 = "Test 1"; | ||
const string Test2 = "Test 2"; | ||
|
||
protected override void Init() | ||
{ | ||
AddBottomTab(CreatePage1(Test1), Test1); | ||
AddBottomTab(CreatePage2(Test2), Test2); | ||
|
||
static ContentPage CreatePage1(string title) | ||
{ | ||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "If the NavigationBar is Red, everything is ok. Pass to the next Tab." | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
|
||
var contentPage1 = new ContentPage | ||
{ | ||
Title = title, | ||
Content = layout | ||
}; | ||
|
||
Shell.SetBackgroundColor(contentPage1, Color.Red); | ||
Shell.SetForegroundColor(contentPage1, Color.Yellow); | ||
Shell.SetTabBarBackgroundColor(contentPage1, Color.Red); | ||
Shell.SetTabBarForegroundColor(contentPage1, Color.Yellow); | ||
|
||
return contentPage1; | ||
} | ||
|
||
static ContentPage CreatePage2(string title) | ||
{ | ||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "If the NavigationBar is Green, the test has passed." | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
|
||
var contentPage2 = new ContentPage | ||
{ | ||
Title = title, | ||
Content = layout | ||
}; | ||
|
||
Shell.SetBackgroundColor(contentPage2, Color.Green); | ||
Shell.SetForegroundColor(contentPage2, Color.Red); | ||
Shell.SetTabBarBackgroundColor(contentPage2, Color.Green); | ||
Shell.SetTabBarForegroundColor(contentPage2, Color.Red); | ||
|
||
return contentPage2; | ||
} | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In line with the one for tab bar... Not sure about this one?