JDStatusBarStyle.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // JDStatusBarStyle.h
  3. // JDStatusBarNotificationExample
  4. //
  5. // Created by Markus on 04.12.13.
  6. // Copyright (c) 2013 Markus. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. /// This style has a red background with a white Helvetica label.
  12. extern NSString *const JDStatusBarStyleError;
  13. /// This style has a yellow background with a gray Helvetica label.
  14. extern NSString *const JDStatusBarStyleWarning;
  15. /// This style has a green background with a white Helvetica label.
  16. extern NSString *const JDStatusBarStyleSuccess;
  17. /// This style has a black background with a green bold Courier label.
  18. extern NSString *const JDStatusBarStyleMatrix;
  19. /// This style has a white background with a gray Helvetica label.
  20. extern NSString *const JDStatusBarStyleDefault;
  21. /// This style has a nearly black background with a nearly white Helvetica label.
  22. extern NSString *const JDStatusBarStyleDark;
  23. typedef NS_ENUM(NSInteger, JDStatusBarAnimationType) {
  24. /// Notification won't animate
  25. JDStatusBarAnimationTypeNone,
  26. /// Notification will move in from the top, and move out again to the top
  27. JDStatusBarAnimationTypeMove,
  28. /// Notification will fall down from the top and bounce a little bit
  29. JDStatusBarAnimationTypeBounce,
  30. /// Notification will fade in and fade out
  31. JDStatusBarAnimationTypeFade,
  32. };
  33. typedef NS_ENUM(NSInteger, JDStatusBarProgressBarPosition) {
  34. /// progress bar will be at the bottom of the status bar
  35. JDStatusBarProgressBarPositionBottom,
  36. /// progress bar will be at the center of the status bar
  37. JDStatusBarProgressBarPositionCenter,
  38. /// progress bar will be at the top of the status bar
  39. JDStatusBarProgressBarPositionTop,
  40. /// progress bar will be below the status bar (the progress bar won't move with the status bar in this case)
  41. JDStatusBarProgressBarPositionBelow,
  42. /// progress bar will be below the navigation bar (the progress bar won't move with the status bar in this case)
  43. JDStatusBarProgressBarPositionNavBar,
  44. };
  45. typedef NS_ENUM(NSInteger, JDStatusBarHeightForIPhoneX) {
  46. /// shows parts of the navigation bar
  47. JDStatusBarHeightForIPhoneXHalf,
  48. /// covers the full navigation bar
  49. JDStatusBarHeightForIPhoneXFullNavBar,
  50. };
  51. /**
  52. * A Style defines the appeareance of a notification.
  53. */
  54. @interface JDStatusBarStyle : NSObject <NSCopying>
  55. /// The background color of the notification bar
  56. @property (nonatomic, strong) UIColor *barColor;
  57. /// The text color of the notification label
  58. @property (nonatomic, strong) UIColor *textColor;
  59. /// The text shadow of the notification label
  60. @property (nonatomic, strong) NSShadow *textShadow;
  61. /// The font of the notification label
  62. @property (nonatomic, strong) UIFont *font;
  63. /// A correction of the vertical label position in points. Default is 0.0
  64. @property (nonatomic, assign) CGFloat textVerticalPositionAdjustment;
  65. #pragma mark Animation
  66. /// The animation, that is used to present the notification
  67. @property (nonatomic, assign) JDStatusBarAnimationType animationType;
  68. #pragma mark Progress Bar
  69. /// The background color of the progress bar (on top of the notification bar)
  70. @property (nonatomic, strong) UIColor *progressBarColor;
  71. /// The height of the progress bar. Default is 1.0
  72. @property (nonatomic, assign) CGFloat progressBarHeight;
  73. /// The position of the progress bar. Default is JDStatusBarProgressBarPositionBottom
  74. @property (nonatomic, assign) JDStatusBarProgressBarPosition progressBarPosition;
  75. /// The insets of the progress bar. Default is 0.0
  76. @property (nonatomic, assign) CGFloat progressBarHorizontalInsets;
  77. /// The corner radius of the progress bar. Default is 0.0
  78. @property (nonatomic, assign) CGFloat progressBarCornerRadius;
  79. #pragma mark iPhone X height
  80. @property (nonatomic, assign) JDStatusBarHeightForIPhoneX heightForIPhoneX;
  81. @end
  82. NS_ASSUME_NONNULL_END