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

[Android] Tabs briefly display wrong background color when navigating between flyout items #24965

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
44fae26
[Android] Tabs briefly display wrong background color when navigating…
KarthikRajaKalaimani Sep 27, 2024
69d6dca
Merge branch 'dotnet:main' into fix-16522
KarthikRajaKalaimani Sep 27, 2024
ec6d044
[Android] Tabs briefly display wrong background color when navigating…
KarthikRajaKalaimani Sep 27, 2024
d4f54ef
Merge branch 'fix-16522' of https://github.com/NanthiniMahalingam/mau…
KarthikRajaKalaimani Sep 27, 2024
2013130
Merge branch 'dotnet:main' into fix-16522
NanthiniMahalingam Oct 3, 2024
bea929b
Remove unwanted casting.
NanthiniMahalingam Oct 3, 2024
ab26c9b
Merge branch 'dotnet:main' into fix-16522
KarthikRajaKalaimani Oct 8, 2024
df6427f
[Android] Tabs briefly display wrong background color when navigating…
KarthikRajaKalaimani Sep 27, 2024
aa50a13
[Android] Tabs briefly display wrong background color when navigating…
KarthikRajaKalaimani Sep 27, 2024
3240bee
Remove unwanted casting.
NanthiniMahalingam Oct 3, 2024
670af0f
Merge branch 'dotnet:main' into fix-16522
KarthikRajaKalaimani Oct 14, 2024
f832659
Merge branch 'fix-16522' of https://github.com/NanthiniMahalingam/mau…
KarthikRajaKalaimani Oct 14, 2024
099302c
Fix for device test failed in android api 23 has committed
KarthikRajaKalaimani Oct 14, 2024
7b41d77
Merge branch 'dotnet:main' into fix-16522
KarthikRajaKalaimani Oct 25, 2024
c813e9d
UI test case added
KarthikRajaKalaimani Nov 4, 2024
91cc6eb
Snapshot for ios added
KarthikRajaKalaimani Nov 4, 2024
64f79c1
Android snapshots committed
KarthikRajaKalaimani Nov 4, 2024
5a33ac9
Snapshot added for windows platform
KarthikRajaKalaimani Nov 7, 2024
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 @@ -13,6 +13,7 @@
using Google.Android.Material.Navigation;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls.Handlers.Compatibility;
using Microsoft.Maui.Graphics;
using AColor = Android.Graphics.Color;
using AView = Android.Views.View;
Expand Down Expand Up @@ -85,7 +86,21 @@ public override AView OnCreateView(LayoutInflater inflater, ViewGroup container,

HookEvents(ShellItem);
SetupMenu();

var appearance = ShellContext.Shell.GetAppearanceForPivot(ShellItem);
if (_bottomView.Background is ColorDrawable background)
{
if (appearance is IShellAppearanceElement appearanceElement)
{
if (appearanceElement.EffectiveTabBarBackgroundColor is not null)
{
background.Color = appearanceElement.EffectiveTabBarBackgroundColor.ToPlatform();
}
else
{
background.Color = ShellRenderer.DefaultBottomNavigationViewBackgroundColor.ToPlatform();
}
}
}
_appearanceTracker = ShellContext.CreateBottomNavViewAppearanceTracker(ShellItem);
_bottomNavigationTracker = new BottomNavigationViewTracker();
((IShellController)ShellContext.Shell).AddAppearanceObserver(this, ShellItem);
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Shell/Shell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ internal T GetEffectiveValue<T>(
return defaultValue();
}

ShellAppearance GetAppearanceForPivot(Element pivot)
internal ShellAppearance GetAppearanceForPivot(Element pivot)
{
// this algorithm is pretty simple
// 1) Get the "CurrentPage" by walking down from the pivot
Expand Down
Loading