VLWeb - Prevent Control "Pop In" after Animation
Posted: Tue Nov 07, 2017 8:47 am
Working on a responsive menu that has a small animation to provide a "slide down/up" effect.
Here are the different states the menu can be in
Here is the animation when going from collapsed to expanded
https://drive.google.com/file/d/1Pckr4v ... sp=sharing
See how the menu item labels "pop in" after the animation completes? Is there any way to prevent that?
Notice how the slide up just rolls up the labels, i.e. you can still see the labels while the animation is executing.
How do I do that with the down animation?
Here is the animation components.
Routines
Here are the different states the menu can be in
Here is the animation when going from collapsed to expanded
https://drive.google.com/file/d/1Pckr4v ... sp=sharing
See how the menu item labels "pop in" after the animation completes? Is there any way to prevent that?
Notice how the slide up just rolls up the labels, i.e. you can still see the labels while the animation is executing.
How do I do that with the down animation?
Here is the animation components.
Code: Select all
define_com class(#PRIM_ANIM) name(#SlideDownAnimation)
define_com class(#PRIM_ANIM.Height) name(#Animation1) parent(#SlideDownAnimation) manage(#COM_OWNER) height(200) duration(500)
define_com class(#PRIM_ANIM) name(#SlideUpAnimation)
define_com class(#PRIM_ANIM.Height) name(#Animation2) parent(#SlideUpAnimation) manage(#COM_OWNER) height(42) duration(500)
Code: Select all
evtroutine handling(#COM_OWNER.DesignChanged) design(#design)
if (#design *Is *null)
#COM_OWNER.SizeToDesktop
return
endif
case of_field(#design.Name.UpperCase)
when (= TABLET)
#COM_OWNER.SizeToTablet
when (= MOBILE)
#COM_OWNER.SizeToMobile
otherwise
#COM_OWNER.SizeToDesktop
endcase
endroutine
mthroutine name(SizeToDesktop)
#COM_OWNER.ShowHorizontalMenu
endroutine
mthroutine name(SizeToTablet)
#COM_OWNER.ShowHorizontalMenu
endroutine
mthroutine name(SizeToMobile)
#COM_OWNER.ShowVerticalMenu
endroutine
mthroutine name(ShowHorizontalMenu)
#ToggleImage.Visible := False
#MenuPanel.LayoutManager <= #HorizontalMenuLayout
#COM_OWNER.Height := 42
#ToggleImage.DisplayPosition := 1
#AdminLabel.DisplayPosition := 2
#DepartmentLabel.DisplayPosition := 3
#DirectReportsLabel.DisplayPosition := 4
#RequestsLabel.DisplayPosition := 5
endroutine
mthroutine name(ShowVerticalMenu)
#ToggleImage.Visible := True
#MenuPanel.LayoutManager <= #VerticalMenuLayout
#ToggleImage.DisplayPosition := 1
#AdminLabel.DisplayPosition := 5
#DepartmentLabel.DisplayPosition := 4
#DirectReportsLabel.DisplayPosition := 3
#RequestsLabel.DisplayPosition := 2
endroutine
evtroutine handling(#ToggleImage.Click)
if (#COM_OWNER.Height = 42)
#SlideDownAnimation.Start
else
#SlideUpAnimation.Start
endif
endroutine