react-native-navigation的迁移库

SidebarAnimation.h 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // SidebarAnimation.h
  2. // TheSidebarController
  3. //
  4. // Copyright (c) 2014 Jon Danao (danao.org | jondanao)
  5. //
  6. // Permission is hereby granted, free of charge, to any person obtaining a copy
  7. // of this software and associated documentation files (the "Software"), to deal
  8. // in the Software without restriction, including without limitation the rights
  9. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. // copies of the Software, and to permit persons to whom the Software is
  11. // furnished to do so, subject to the following conditions:
  12. //
  13. // The above copyright notice and this permission notice shall be included in
  14. // all copies or substantial portions of the Software.
  15. //
  16. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. // THE SOFTWARE.
  23. #import <Foundation/Foundation.h>
  24. #import <QuartzCore/QuartzCore.h>
  25. #import <UIKit/UIKit.h>
  26. #define DEG2RAD(degrees) (degrees * M_PI / 180)
  27. #define SIDEBAR_ANIMATIONS \
  28. @"SidebarFacebookAnimation", \
  29. @"SidebarAirbnbAnimation", \
  30. @"SidebarLuvocracyAnimation", \
  31. @"SidebarFeedlyAnimation", \
  32. @"SidebarFlipboardAnimation", \
  33. @"SidebarWunderlistAnimation"
  34. typedef NS_ENUM(NSInteger, SidebarTransitionStyle)
  35. {
  36. SidebarTransitionStyleFacebook,
  37. SidebarTransitionStyleAirbnb,
  38. SidebarTransitionStyleLuvocracy,
  39. SidebarTransitionStyleFeedly,
  40. SidebarTransitionStyleFlipboard,
  41. SidebarTransitionStyleWunderlist
  42. };
  43. typedef NS_ENUM(NSInteger, Side)
  44. {
  45. LeftSide,
  46. RightSide,
  47. };
  48. @class SidebarAnimation;
  49. @interface SidebarAnimation : NSObject
  50. + (void)animateContentView:(UIView *)contentView
  51. sidebarView:(UIView *)sidebarView
  52. fromSide:(Side)side
  53. visibleWidth:(CGFloat)visibleWidth
  54. duration:(NSTimeInterval)animationDuration
  55. completion:(void (^)(BOOL finished))completion;
  56. + (void)reverseAnimateContentView:(UIView *)contentView
  57. sidebarView:(UIView *)sidebarView
  58. fromSide:(Side)side
  59. visibleWidth:(CGFloat)visibleWidth
  60. duration:(NSTimeInterval)animationDuration
  61. completion:(void (^)(BOOL finished))completion;
  62. + (void)resetSidebarPosition:(UIView *)sidebarView;
  63. + (void)resetContentPosition:(UIView *)contentView;
  64. +(UIView*)overlayContentView:(CGRect)frame;
  65. +(void)setOverlayContentColor:(UIColor*)color;
  66. +(UIColor*)overlayContentColor;
  67. @end