Is there anyway to add the duration to HYPEDocument.showNextScene()?


(Rob Willett) #1

Hi,

We’ve finally managed to et around to implementing our onboarding screens using Hype 3 to our ionic doc. We’ve managed to integrate Hype 3 and Ionic, which now works well.

We have a number of apps which will use different onboarding screens and we wanted to keep the onboarding code as simple as possible.

We switch between screens using swipe rights and lefts.

Rather than coding specific screens to go to, we use showNextScreen() and showPreviousScreen(). This means we can create our onboarding screens in Hype 3 and simply drop them (literally) into the right folder and when the app starts up, it has no need to know the names of the screens as it simply follows the screens in order. Very simple and easy.

However the default transition duration for kSceneTransitionPushRightToLeft when using

HYPEDocument.showNextScene(HYPEDocument.kSceneTransitionPushRightToLeft);

is 1.1 sec which is too slow for us.

The docs for HYPEDocument.showNextScene() show a transition type but NOT a transition duration. If we choose the specific scene we can set a duration
HYPEDocument.showSceneNamed('SCENE NAME' , HYPEDocument.kSceneTransitionPushRightToLeft , 0.5);

We have got around the problem by creating a small circular queue and indexing around it to get the scene name explicitly and then we can set the duration.

It seems to us that the addition of the duration parameter to showNextScene() and showPreviousScene would be a useful thing to have. Its an enhancement but would make things a little easier as well as consistent with the showSceneNamed() function


(Hans-Gerd Claßen) #2

Hi,

in the online-documentation it shows up as you described:
hypeDocument.showNextScene(optionalTransition)#

but within the hypepro embedded documentation:
hypeDocument.showNextScene(optionalTransition, optionalDuration)

not shure if it is a pro feature or the onlinedocumentation has to be updated …


(Jonathan Deutsch) #3

This was a typo in the online documentation, showNextScene() accepts an optionalDuration as the second argument. It is not a pro-exclusive feature. The docs have been corrected; thanks!


(raph) #4

Hi Rob,
I am also in the process of trying to get hype content to work with ionic. Are you using ionic 1 or 2?
I have managed to get the hype content to show up in an iframe, though have not yet been able to test this on a device (browser testing only).

I would like to avoid using iframes though :slight_smile: I just wanted to say that if you are able to share any information about how you were able to get things running that would be most appreciated. Thanks!


(Rob Willett) #5

Raph,

We are using Ionic 1 only. Ionic 2 came after we started work on Ionic 1 and we know there are many problems with some of the plugins we use with Ionic 2.

I would have to look at the code again, but from memory it’s not difficult to do (once you know how).

We do NOT use iframes as they are the spawn of the devil :slight_smile: I paraphrase a little.

We also do not use a desktop browser for testing as we have so many dependencies on hardware plugins (GPS etc), that its a waste of time for us.

Let me come back when I have had time to look at this, it won’t be for a few days as need to get a release ready.

Rob