2013-06-07 02:47:43 -04:00
|
|
|
//
|
|
|
|
// NBNotifier.h
|
|
|
|
// NewsBlur
|
|
|
|
//
|
|
|
|
// Created by Samuel Clay on 6/6/13.
|
|
|
|
// Copyright (c) 2013 NewsBlur. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
2017-10-30 11:30:12 -07:00
|
|
|
#define NOTIFIER_HEIGHT 32
|
|
|
|
|
2013-06-11 23:00:00 -07:00
|
|
|
@interface NBNotifier : UIView {
|
|
|
|
|
2013-09-05 18:48:23 -07:00
|
|
|
UIView *progressBar;
|
2013-06-16 21:39:38 -07:00
|
|
|
|
2013-06-11 23:00:00 -07:00
|
|
|
@protected
|
|
|
|
UILabel *_txtLabel;
|
2017-10-30 11:30:12 -07:00
|
|
|
NSLayoutConstraint *progressBarWidthConstraint;
|
|
|
|
NSLayoutConstraint *txtLabelLeadingConstraint;
|
2013-06-11 23:00:00 -07:00
|
|
|
}
|
2013-06-07 02:47:43 -04:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NBOfflineStyle = 1,
|
|
|
|
NBLoadingStyle = 2,
|
2013-06-16 21:39:38 -07:00
|
|
|
NBSyncingStyle = 3,
|
2013-07-15 15:36:25 -07:00
|
|
|
NBSyncingProgressStyle = 4,
|
|
|
|
NBDoneStyle = 5
|
2013-06-07 02:47:43 -04:00
|
|
|
} NBNotifierStyle;
|
|
|
|
|
2013-06-11 23:00:00 -07:00
|
|
|
@property (nonatomic, strong) NSString *_text;
|
|
|
|
@property (nonatomic) NBNotifierStyle style;
|
2013-06-12 17:36:09 -07:00
|
|
|
@property (nonatomic, strong) UIView *view;
|
2013-06-19 20:26:04 -07:00
|
|
|
@property (nonatomic) CGPoint offset;
|
2013-06-11 23:00:00 -07:00
|
|
|
@property (nonatomic, strong) UIView *accessoryView;
|
|
|
|
@property (nonatomic, strong) NSString *title;
|
2013-06-13 17:56:58 -07:00
|
|
|
@property (nonatomic, assign) BOOL showing;
|
2020-09-21 20:33:31 -07:00
|
|
|
@property (nonatomic, assign) BOOL pendingHide;
|
2013-09-05 18:48:23 -07:00
|
|
|
@property (nonatomic, retain) UIView *progressBar;
|
2017-10-30 11:30:12 -07:00
|
|
|
@property (nonatomic) NSLayoutConstraint *topOffsetConstraint;
|
2013-06-07 02:47:43 -04:00
|
|
|
|
2013-06-11 23:00:00 -07:00
|
|
|
- (id)initWithTitle:(NSString *)title;
|
2017-10-30 11:30:12 -07:00
|
|
|
- (id)initWithTitle:(NSString *)title withOffset:(CGPoint)offset;
|
|
|
|
- (id)initWithTitle:(NSString *)title style:(NBNotifierStyle)style;
|
|
|
|
- (id)initWithTitle:(NSString *)title style:(NBNotifierStyle)style withOffset:(CGPoint)offset;
|
2013-06-11 23:00:00 -07:00
|
|
|
|
2017-10-30 18:22:59 -07:00
|
|
|
- (void)setProgress:(CGFloat)value;
|
2013-06-11 23:00:00 -07:00
|
|
|
|
|
|
|
- (void)show;
|
|
|
|
- (void)showIn:(float)time;
|
|
|
|
|
|
|
|
- (void)hide;
|
2015-10-28 21:50:23 -07:00
|
|
|
- (void)hideNow;
|
2013-06-11 23:00:00 -07:00
|
|
|
- (void)hideIn:(float)seconds;
|
2013-06-10 00:29:03 -07:00
|
|
|
|
2013-06-07 02:47:43 -04:00
|
|
|
@end
|