Marinell / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Add animation when closing the sidemenu #872

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Add animation when closing the sidemenu from a button (or any other control) 
and not only from a command.

Original issue reported on code.google.com by mhvd...@gmail.com on 7 Sep 2013 at 11:09

GoogleCodeExporter commented 9 years ago
How are you closing the side menu?
If you close the side menu using SideMenuBar.closeCurrentMenu(Runnable) and 
performing your operation in the runnable the animation will run and complete.

Original comment by shai.almog on 8 Sep 2013 at 5:12

GoogleCodeExporter commented 9 years ago
I implemented the method you suggested here. The only thing is that the screen 
is replaced when the animation is finished. I would like this to be an async 
operation so the animation starts and while that is running the screen gets 
replaced.

Original comment by mhvd...@gmail.com on 8 Sep 2013 at 9:34

GoogleCodeExporter commented 9 years ago
I don't think we can do that with the way the side menu works. 
You might be interested in disabling the out transition of the current form by 
using form.setTransitionOut(CommonTransitions.createEmpty());
This will make the transition instantaneous upon folding which might feel more 
natural.

Original comment by shai.almog on 13 Sep 2013 at 1:55

GoogleCodeExporter commented 9 years ago
I already have implemented the empty transition, but that is not totally 
satisfying. Can you make it that the screen first is replaced with the new form 
and then the animation is done?

Original comment by mhvd...@gmail.com on 13 Sep 2013 at 2:01

GoogleCodeExporter commented 9 years ago
Unfortunately no. The menu is part of the parent form so the animation would 
happen on that form. If we change to another form which might have other 
commands the animation just won't be there.
We could theoretically add it there but it would use the commands of the new 
form not of the current form (not to mention that this would be pretty hairy to 
begin with).

Original comment by shai.almog on 13 Sep 2013 at 2:34