Skip to content

Reset opacity when view is being reused#22820

Merged
mattleibow merged 1 commit into
mainfrom
fix_19955
Jun 4, 2024
Merged

Reset opacity when view is being reused#22820
mattleibow merged 1 commit into
mainfrom
fix_19955

Conversation

@PureWeen
Copy link
Copy Markdown
Member

@PureWeen PureWeen commented Jun 4, 2024

Description of Change

The DrawerLayout currently recreates its details view whenever it's navigated back to. In the case where you are nesting a FlyoutPage inside a NavigationPage, this causes a double animation to occur which leaves the opacity of the view set to zero. When android is processing an animation it sets the alpha of a view to zero

image

And then when it's done it sets it back to 1, the problem we're hitting is that the second animation is starting before the first one finishes, so, the second animation thinks it needs to use "0" as the "initial" alpha value.

Ideally, we will fix DrawerLayout to just reuse its view opposed to creating a new one but that's going to take a bit more of an effort, so, this should get us through until that can be reworked.

Issues Fixed

Fixes #19955

@PureWeen PureWeen requested a review from a team as a code owner June 4, 2024 10:14
@PureWeen PureWeen requested review from jfversluis and mattleibow June 4, 2024 10:14
App.Tap("NavigateToSecondPageButton");
App.WaitForElement("NavigateBackToFirstPageButton");
App.Tap("NavigateBackToFirstPageButton");
App.WaitForElement("NavigateToSecondPageButton");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does WaitForElement test for visibility?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It looks like if the opacity is zero then appium can't find it.

I was curious about this as well :-)
If I remove my fix, the test fails, if I put the fix back, the test passes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the element is not visible on the screen, appium can't find it. So, it's valid. Just could be nice to include a comment here.

Comment thread src/Core/src/Platform/Android/Navigation/NavigationViewFragment.cs
@mattleibow mattleibow merged commit 8e97f32 into main Jun 4, 2024
@mattleibow mattleibow deleted the fix_19955 branch June 4, 2024 17:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flyout doesn't load the page after navigating back

4 participants