Custom Page Transitions with Xamarin.Forms?

2»

Answers

  • AlexNAlexN RUMember ✭✭

    Fixed!
    Problem was in Xamarin.Forms 2.3.1.113pre3.
    Today i will send to you dll's with supporting Xamarin.Forms 2.3.1.113pre3 and update Component in Store as soon as possible

  • AlexNAlexN RUMember ✭✭

    For now my component not supporting (AnimationNavigationPage). I will remove it from Xamarin.Components

  • EvgenyXfEvgenyXf RUMember
    edited September 2016

    If someone has this issue on android
    There possible solution if u are using appcompat, xamarin forms use two different renderers
    Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer
    Xamarin.Forms.Platform.Android.NavigationRenderer

    And first has virtual method SetupPageTransition(FragmentTransaction transaction, bool isPush)
    so u can set custom animation from resources for default fragment transition

    Sample

    [assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]
    namespace Sentinel.Droid.Renderers
    {
    public class CustomNavigationRenderer : Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer
    {
    protected override void SetupPageTransition(FragmentTransaction transaction, bool isPush)
    {

            base.SetupPageTransition(transaction, isPush);
            transaction.SetCustomAnimations(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_slide_out_bottom);
        }
    }
    

    }

  • JavierHolcmanJavierHolcman ARMember ✭✭

    @Evgeniy.3985
    I am also using the AppCompat.NavigationPageRenderer, but it has a problem with the exit animation on when doing a pop. I am trying to implement a slide left-right like iOS navigation. When doing a pop (on android), the exit animation is not working. As I was reading it is a bug because the poped fragment is removed before started the animation. I was looking to override the NavigationPageRenderer but all the methods are private and is imposible to fix it. May be do you have some workaround?

  • EvgenyXfEvgenyXf RUMember
    edited September 2016

    @JavierHolcman said:
    @Evgeniy.3985
    I am also using the AppCompat.NavigationPageRenderer, but it has a problem with the exit animation on when doing a pop. I am trying to implement a slide left-right like iOS navigation. When doing a pop (on android), the exit animation is not working. As I was reading it is a bug because the poped fragment is removed before started the animation. I was looking to override the NavigationPageRenderer but all the methods are private and is imposible to fix it. May be do you have some workaround?

    Yes, i'm also faced this issue. And implemented ugly hack, before each back navigation im run async method which run new transaction that shows previous fragment and hide current, then delay with hardcode animation length.

    I think it can broke navigation logic, but in my case works fine.

    private async Task FakePopFragment()
    {

            if (FragmentManager.Fragments.Count() > 1)
            {
                FragmentManager.
                    BeginTransaction().
                    SetCustomAnimations(Resource.Animation.FadeInSmall, Resource.Animation.SlideDown, Resource.Animation.SlideDown,
                    Resource.Animation.FadeInSmall).
                    Show(FragmentManager.Fragments[FragmentManager.Fragments.Count - 2]).
                    Hide(FragmentManager.Fragments.Last()).Commit();
                await Task.Delay(500); //there your animation time in xml
            }
    
    
    
        } 
    

    This executes in mvvmcross presenter before calling real navigation method

    And yes, no virtual methods in such important class is sad

  • @AlexN Can you send me the updated dlls? My app is crashing with the updated Xamarin.Forms and I need the new dlls so I can release my updates.

  • EmanueleSabettaEmanueleSabetta ITBeta ✭✭✭

    Is there some custom navigation component that finally solves this issue?

  • LeonardHarrisLeonardHarris USMember
    edited September 2016

    @AlexN said:
    For now my component not supporting (AnimationNavigationPage). I will remove it from Xamarin.Components

    Hi Alex we use your component and cant say how happy and helpful it is to us :) we hope to see your component come back available to Xamarin components store soon!

    Thanks
    Leonard

  • AlexNAlexN RUMember ✭✭

    Hi Leonard!
    Happy to hear. My component again available. It will be great if you find time to write review about my component.

    @LeonardHarris said:

    Hi Alex we use your component and cant say how happy and helpful it is to us :) we hope to see your component come back available to Xamarin components store soon!

    Thanks
    Leonard

  • LeoJHarrisLeoJHarris NZMember ✭✭✭

    @AlexN said:
    Hi Leonard!
    Happy to hear. My component again available. It will be great if you find time to write review about my component.

    @LeonardHarris said:

    Hi Alex we use your component and cant say how happy and helpful it is to us :) we hope to see your component come back available to Xamarin components store soon!

    Thanks
    Leonard

    Hi Alex, we purchased it under a different account, and game a 5 star review for it :):)

  • AlexNAlexN RUMember ✭✭

    @LeonardHarris.0546 said:

    Hi Alex, we purchased it under a different account, and game a 5 star review for it :):)

    Great! Thanks. Take a look on new version with FormsAppCompatActivity support.

  • AlexNAlexN RUMember ✭✭

    Hi All!
    If someone want to try my component i have 100% Discount for first 10 customers (promo code: DISC-Animation-Navigation-Page).

  • JoyceBabuJoyceBabu USMember

    I am getting the message Discount does not exist. Are all the coupons used up?

  • LaobuLaobu USMember ✭✭

    @AlexN
    Hey Alex,
    Loved the component and made a simple Demo app of the possible implementation scenarios for your component. If anyone else is interested in quickly learning how to use it, go and visit https://github.com/bbl-Laobu/AnimatedTransitionNavPageDemo for demo and instructions.

    Enjoy!
    Laobu

  • AlexNAlexN RUMember ✭✭

    @Laobu said:
    @AlexN
    Hey Alex,
    Loved the component and made a simple Demo app of the possible implementation scenarios for your component. If anyone else is interested in quickly learning how to use it, go and visit https://github.com/bbl-Laobu/AnimatedTransitionNavPageDemo for demo and instructions.

    Enjoy!
    Laobu

    Wow! Looks very good, nice work!
    Can i use your demo and descriptions for scenarios (i will add it to https://github.com/AlexandrNikulin/AnimationNavigationPage) ?

  • LaobuLaobu USMember ✭✭

    @AlexN Sure, go ahead. A reference back and acknowledgement would be great of course... Let me know if you need any help. :)

  • ManojkumarMaliManojkumarMali USMember ✭✭✭

    @EvgenyXf said:
    If someone has this issue on android
    There possible solution if u are using appcompat, xamarin forms use two different renderers
    Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer
    Xamarin.Forms.Platform.Android.NavigationRenderer

    And first has virtual method SetupPageTransition(FragmentTransaction transaction, bool isPush)
    so u can set custom animation from resources for default fragment transition

    Sample

    [assembly: ExportRenderer(typeof(NavigationPage), typeof(CustomNavigationRenderer))]
    namespace Sentinel.Droid.Renderers
    {
    public class CustomNavigationRenderer : Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer
    {
    protected override void SetupPageTransition(FragmentTransaction transaction, bool isPush)
    {

    base.SetupPageTransition(transaction, isPush);
    transaction.SetCustomAnimations(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_slide_out_bottom);
    }
    }
    }

    Thank you @EvgenyXf ..

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭✭

    Up

    Maybe, somebody can suggest me open source library for getting it?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭✭

    https://github.com/AndreiMisiukevich/GalleyFramework

    My package provides opportunity to create custom animations (But it requires to work only via my Framework)

    • Only one super page
    • All screens are extended from AbsoluteLayout.

    But, maybe, there is plugin, which allows to customize animations of native elements (pages)

    thanks

  • UnreachableCodeUnreachableCode USMember ✭✭✭

    @AlexN I am unable to reference your AnimationNavigationPage package in my iOS or Android project. I install version 1.0 from Nuget with no errors, but it does not appear in my references. Have you seen this before?

Sign In or Register to comment.