24 views
in GUI Development by
Hello, I've been playing with the Effects::SlideTransition and created two SlideLeft and SlideRight.

The closer to the achievement has been:

Owner.SwitchToDialog(newScreen, is_increment ? SlideLeft : SlideRight, null, null, null, null, null, null, null, null, false);

But while it works generally, it is doing an unwanted double effect when I change direction.

I was wondering if there is a demo with list scroll effect applied on SwitchToDialog (I found one with Present/Dismiss but I have a long list of pages I don't want to stack all of those possibly).

Cheers, Giuseppe.

1 Answer

+1 vote
by
 
Best answer

Hello Giuseppe,

I suppose, you mean with "double effect" that when switching from dialog A to dialog B, one of the dialogs performs the SlideLeft and the other SlideRight animation. In such case please note the condition is_increment? ... : ...  in your implementation. Depending on this value one dialog is presented with SlideLeft the other with SlideRight animation. This originally specified animation is then remembered and it is used when the corresponding dialog is dismissed again - this is because when null is specified in the aDismissTransition parameter, the animation from the parameter aPresentTransition is copied automatically to aDismissTransition. You have the possibility to:

Option 1: Instead of passing null, specify explicitly the desired  animation in the aDismissTransition parameter. In this manner you configure in forehand different present/dismiss animations for the dialog.

Option 2: When you perform SwitchToDialog() you can pass in its 6th parameter (aOverrideDismissTransition) a new transition object to override the originally configured animation. In this manner, the original animation can be replaced by another one.

For more information please see the section Perform Dialog transitions with animations.

I hope it helps you further.

Best regards

Paul Banach

by
Thank you Paul, I understood a bit better how it works and achieved the desired result overriding the dismiss:

Owner.SwitchToDialog(newScreen, is_increment ? SlideLeft : SlideRight, null, null, null, is_increment ? SlideLeft : SlideRight, null, null, null, null, false);

The only glitch is that when after several SwitchToDialog (which simulate scrolling a list) I want to close the list, I still get one last unwanted slide effect.

I'm not sure if it is possible in this last dismiss to override the dismiss effect saying to do nothing at all, I'll investigate.
by

Hello Giuseppe,

The only glitch is that when after several SwitchToDialog (which simulate scrolling a list) I want to close the list, I still get one last unwanted slide effect.

I suppose, you perform a DismissDialog() when you close the list. If yes, this method also provides an aOverrideDismissTransition parameter permitting you to specify an animation different to the estimated originally at the presentation time. Hopefully it provides the desired behavior. 

... the dismiss effect saying to do nothing at all, ...

If you don't want any animation, use the Show Hide Transition (see also Customize provided Dialog transition animations). This transition results in an instantaneous visibility alternation.

Best regards

Paul Banach

by
Hi Paul,

Indeed dragging one Effects::ShowHideTransition and then changing the dismiss to:

Owner.DismissDialog(this, ShowHideTransition, null, null, null, null, false);

Did the job, thanks for your help.

Cheers,

Giuseppe.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...