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] Navigation icon blink fix - shell (#18867) #21455

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Mar 26, 2024

Issues Fixed

Fixes #18867

Fixes #22649

Before After

@kubaflo kubaflo requested a review from a team as a code owner March 26, 2024 13:54
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 26, 2024
@jsuarezruiz jsuarezruiz added area-navigation NavigationPage area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Mar 26, 2024
@jsuarezruiz jsuarezruiz requested review from PureWeen and removed request for jsuarezruiz March 26, 2024 15:31
@AnthonyH7386
Copy link

Any idea when this will be approved? Such a frustrating bug!

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Apr 22, 2024
@@ -77,6 +77,9 @@ public static void UpdateTitleIcon(this AToolbar nativeToolbar, Toolbar toolbar)

public static void UpdateBackButton(this AToolbar nativeToolbar, Toolbar toolbar)
{
//Setting it to null to avoid the icon's blink
nativeToolbar.NavigationIcon = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, do we know by chance where this is getting set upstream? I'm curious if we can fix this by not setting this upstream somewhere.

Copy link
Contributor Author

@kubaflo kubaflo Apr 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to look for it, but couldn't find a better solution

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I think what's happening here is that the mapper code is firing too early

It looks like this is the path causing the Drawer to show up

image

ToolbarItems being set is causing the NavBar to re-evaluate before the properties on backbutton and those have updated.

It's a bit tricky because you want the toolbar itself to update atomically before propagating. I'm not too sure the best way to handle this.

The ToolbarItems are stored as a private variable, so in some cases what I've done is just set the private value and then fire the propertychanged after everything is set

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@ja3cob
Copy link

ja3cob commented Jul 9, 2024

Please merge, such an annoying bug @PureWeen

@AaronBastian
Copy link

@PureWeen What must be true to get this resolved? This is something that is plaguing our production app as well.

@PureWeen
Copy link
Member

/rebase

@@ -77,6 +77,9 @@ public static void UpdateTitleIcon(this AToolbar nativeToolbar, Toolbar toolbar)

public static void UpdateBackButton(this AToolbar nativeToolbar, Toolbar toolbar)
{
//Setting it to null to avoid the icon's blink
nativeToolbar.NavigationIcon = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I think what's happening here is that the mapper code is firing too early

It looks like this is the path causing the Drawer to show up

image

ToolbarItems being set is causing the NavBar to re-evaluate before the properties on backbutton and those have updated.

It's a bit tricky because you want the toolbar itself to update atomically before propagating. I'm not too sure the best way to handle this.

The ToolbarItems are stored as a private variable, so in some cases what I've done is just set the private value and then fire the propertychanged after everything is set

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 SR2 milestone Nov 21, 2024
@PureWeen
Copy link
Member

  • failing test unrelated

@PureWeen PureWeen merged commit 693c3d0 into dotnet:main Nov 22, 2024
104 of 106 checks passed
@samhouts samhouts added fixed-in-9.0.21 fixed-in-net8.0-nightly This may be available in a nightly release! labels Dec 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-navigation NavigationPage community ✨ Community Contribution fixed-in-9.0.21 fixed-in-net8.0-nightly This may be available in a nightly release!
Projects
Status: Done
7 participants