Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more options for sliding operation #124

Closed
wants to merge 7 commits into from
Closed

Added more options for sliding operation #124

wants to merge 7 commits into from

Conversation

kickstandapps
Copy link

Wanted to add a few more options to the way the center view controller and side menus slide past one another. Here's a breakdown of what's different:

  • Depreciated menuSlideAnimationEnabled and menuSlideAnimationFactor properties. They still work, but there will be some unclear results from mixing new and old properties, so they're marked as depreciated and will throw a warning if used.
  • Created new internal method setControllerOffset. An offset of 0 means closed, negative would open the right menu, and positive would open the left menu. All three views are positioned from this view so that there is no need for methods aligning views to one another.
  • Created showMenuOverContent property that allows the menus to slide in front of the center view controller. The default is still to slide behind the center.
  • Created menuParallaxFactor property to control the amount of sliding of the side menus. A factor of 0 would leave the menu stationary (default behavior), a factor of 1 would slide the menu directly with the center (like a UIPageViewController), and a factor between 0 and 1 would slide the menu at a different speed from the center, giving it a parallax scrolling effect. This is only utilized when menus are behind the center view.
  • Created contentParallaxFactor property to control the amount of sliding of the center view. The values go from 0 to 1 and work as described for the menuParallaxFactor. This is only utilized when menus are in front of the center view.
  • Created menuScaleFactor property to control the size of the side menus as they slide in. For example, with a factor of 0.9, the side menu will be 90% of full size when sliding begins, then grow to fill the entire size when the menu is open. This is only utilized when menus are behind the center view.
  • Created contentScaleFactor property to control the size of the center view as it slides out. For example, with a factor of 0.9, the center view will be full size when sliding begins, then shrink to 90% when the menu is open. This is only utilized when menus are in front of the center view.
  • Created separate shadows for all three views. Shadows only show up on the view in front. When the menus are in front, their shadows gradually fade in and out when open/closed so there is no shadow when the menus aren't up.
  • Remove the locking of directions (resolves Cannot continuously drag center view left and right. Locks to initial direction.  #109). When closed, user can start panning right, and still pan left without having to begin a new gesture.

I realize that this is a pretty major change and that there is a lot of code that is being modified. Take a look through it and let me know what you think.

(Go Badgers!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot continuously drag center view left and right. Locks to initial direction.
1 participant