-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yuanwei
committed
Sep 19, 2014
1 parent
c20e137
commit d25a246
Showing
5 changed files
with
530 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
util/thirdtools/GCDiscreetNotificationView/GCDiscreetNotificationView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// GCDiscreetNotificationView.h | ||
// Mtl mobile | ||
// | ||
// Created by Guillaume Campagna on 09-12-27. | ||
// Copyright 2009 LittleKiwi. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
//The presentation mode of the notification, it sticks to the top or buttom of the content view | ||
typedef enum { | ||
GCDiscreetNotificationViewPresentationModeTop, | ||
GCDiscreetNotificationViewPresentationModeBottom, | ||
} GCDiscreetNotificationViewPresentationMode; | ||
|
||
@interface GCDiscreetNotificationView : UIView | ||
|
||
//You can access the label and the activity indicator to change its values. | ||
//If you want to change the text or the activity itself, use textLabel and showActivity proprieties. | ||
@property (strong, nonatomic, readonly) UILabel *label; | ||
@property (strong, nonatomic, readonly) UIActivityIndicatorView *activityIndicator; | ||
|
||
@property (weak, nonatomic) UIView *view; //The content view where the notification will be shown | ||
@property (nonatomic) GCDiscreetNotificationViewPresentationMode presentationMode; | ||
@property (nonatomic, copy) NSString* textLabel; | ||
@property (nonatomic) BOOL showActivity; | ||
|
||
//x 偏移 | ||
@property(nonatomic,assign)CGFloat addX; | ||
@property(nonatomic,strong)UIButton* cBtn; | ||
@property(nonatomic,strong)void (^onCompleteShowAnimationBlock)(void); | ||
@property(nonatomic,strong)void (^onCompleteHideAnimationBlock)(void); | ||
@property(nonatomic,strong)void (^onClickBtnBlock)(void); | ||
|
||
@property (nonatomic, readonly, getter = isShowing) BOOL showing; | ||
|
||
- (id) initWithText:(NSString *)text inView:(UIView *)aView; | ||
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inView:(UIView *)aView; | ||
- (id) initWithText:(NSString *)text showActivity:(BOOL)activity inPresentationMode:(GCDiscreetNotificationViewPresentationMode) aPresentationMode inView:(UIView *)aView; | ||
|
||
//Show/Hide animated | ||
- (void) showAnimated; | ||
- (void) hideAnimated; | ||
- (void) hideAnimatedAfter:(NSTimeInterval) timeInterval; | ||
- (void) show:(BOOL) animated; | ||
- (void) hide:(BOOL) animated; | ||
- (void) showAndDismissAutomaticallyAnimated; | ||
- (void) showAndDismissAfter:(NSTimeInterval) timeInterval; | ||
|
||
//Change proprieties in a animated fashion | ||
//If you need to change propreties, you NEED to use these methods. Hiding, changing value, and show it back will NOT work. | ||
- (void) setTextLabel:(NSString *) aText animated:(BOOL) animated; | ||
- (void) setShowActivity:(BOOL) activity animated:(BOOL) animated; | ||
- (void) setTextLabel:(NSString *)aText andSetShowActivity:(BOOL)activity animated:(BOOL)animated; | ||
|
||
@end |
Oops, something went wrong.