Window animate direction

Welcome! Forums Unity Plugins In-App Web Browser Window animate direction

This topic contains 2 replies, has 2 voices, and was last updated by  chosking 2 days, 9 hours ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1305

    chosking
    Participant

    Hi,

    Firstly, good job on the In-App Web Browser plug-in, nice work!

    Is it possible to modify to change the direction the window appears?
    That is, rather than the window animating in from the bottom of the screen, it would animate in from the right?

    Obviously a plug-in update would be great, but any pointers to which source files to modify ourselves would be good.

    Much appreciated 🙂

    #1312
    Piotr
    Piotr
    Keymaster

    Hey,
    Which platform do you have in mind?

    #1314

    chosking
    Participant

    Hi,

    Appreciate your prompt reply.
    I’d ideally like to get this working on iOS and Android.

    I edited iOSInAppBrowser.mm, _PresentInAppBrowserViewController method to a successfully add a left/right transition:

    CATransition *transition = [CATransition animation];
    transition.duration = .45;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionPush;
    transition.subtype = kCATransitionFromRight;
    [unityAppController.rootViewController.view.window.layer addAnimation:transition forKey:kCATransition];
    [unityAppController.rootViewController presentViewController:navigationController animated:false completion:nil];

    Following the same process in _CloseInAppBrowser method hasn’t worked for some reason, the window closes with no transition:

    CATransition* transition = [CATransition animation];
    transition.duration = 2.45;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionPush;
    transition.subtype= kCATransitionFromLeft;
    [unityAppController.rootViewController.view.window.layer addAnimation:transition forKey:kCATransition];
    [unityAppController.rootViewController dismissViewControllerAnimated:false completion:nil];

    Obviously for Android there’s no source code to tinker with.

    Do you think this is feature you’d consider adding?

    Many thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.