Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] NavigationPage level animation #5116

Closed
pikausp opened this issue Feb 2, 2019 · 2 comments
Closed

[Enhancement] NavigationPage level animation #5116

pikausp opened this issue Feb 2, 2019 · 2 comments
Labels
inactive Issue is older than 6 months and needs to be retested proposal-open t/enhancement ➕

Comments

@pikausp
Copy link

pikausp commented Feb 2, 2019

Summary

Sometimes it is desired to turn on/off navigation animations for a NavigationPage as a whole. The proposed changes still allow to tweak the animation behavior when calling INavigation API manually by passing the desired value of animated.

API Changes

NavigationPage would define new bool property Animated with the default value true (so the current behavior does not change).

NavigationRequestedEventArgs newly defines Animated as bool? instead of the current bool. Thanks to this we know whether there was an explicit request to animate/not animate.

Changes to the renderers would look something like this

protected override Task<bool> OnPushAsync( Page view, bool? animated ) {
    return base.OnPushAsync(view, animated ?? Element.Animated );
}

protected override Task<bool> OnPopViewAsync( Page page, bool? animated ) {
    return base.OnPopViewAsync(page, animated ?? Element.Animated);
}

protected override Task<bool> OnPopToRootAsync( Page page, bool? animated ) {
    return base.OnPopToRootAsync(page, animated ?? Element.Animated );
}

Intended Use Case

Turning off animations for pop actions executed via back buttons (navbar/hw).

A typical scenario would be when your root page has HasNavigationBar set to false. When you push a page that has navigation bar and then pop back to the root, the navigation bar is hidden after the animation is completed. This creates a rather ugly artifact on the screen.

@bares43
Copy link

bares43 commented Feb 9, 2019

I would welcome this feature as well. I had to create custom renderers just because disabling animation.

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Aug 8, 2019
@samhouts samhouts added proposal-open and removed help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Feb 7, 2020
@jfversluis
Copy link
Member

Thanks for this suggestion! As Xamarin.Forms is now in maintenance mode, this will not happen anymore for Xamarin.Forms. We're only adding bugfixes and stability fixes.

If this is still important to you, make sure to check the .NET MAUI repo and see if it's already on the roadmap. If not, feel free to open a discussion to discuss a change first or open an issue with a detailed feature request. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
inactive Issue is older than 6 months and needs to be retested proposal-open t/enhancement ➕
Projects
None yet
Development

No branches or pull requests

4 participants