Skip to content

Commit

Permalink
added control over the HUD location including the bottom, above the s…
Browse files Browse the repository at this point in the history
…tatus bar, and below the navigation bar.
  • Loading branch information
darren-martz committed Dec 26, 2012
1 parent c5b7157 commit 86d8e82
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
11 changes: 8 additions & 3 deletions ZAActivityBar/ZAActivityBar.h
Expand Up @@ -12,9 +12,6 @@

#import <UIKit/UIKit.h>

// This allows you to offet the position of the indicator. 49.0f for Tab Bars.
#define BOTTOM_OFFSET 0.0f

// Visual Properties
#define BAR_COLOR [[UIColor blackColor] colorWithAlphaComponent:0.8f]
#define HEIGHT 40.0f
Expand All @@ -29,6 +26,14 @@

///////////////////////////////////////////////////////////////////////

// Properties

+ (void) setLocationBottom;
+ (void) setLocationTabBar;
+ (void) setLocationNavBar;

///////////////////////////////////////////////////////////////////////

// Basic use

+ (void) show;
Expand Down
23 changes: 22 additions & 1 deletion ZAActivityBar/ZAActivityBar.m
Expand Up @@ -34,6 +34,7 @@ @interface ZAActivityBar () {
}

@property BOOL isVisible;
@property NSUInteger offset;

@property (nonatomic, strong, readonly) NSTimer *fadeOutTimer;
@property (nonatomic, strong, readonly) UIWindow *overlayWindow;
Expand All @@ -59,6 +60,26 @@ @implementation ZAActivityBar

///////////////////////////////////////////////////////////////

#pragma mark - Offset Properties

+ (void) setLocationBottom
{
[ZAActivityBar sharedView].offset = 0.0f;
}

+ (void) setLocationTabBar
{
[ZAActivityBar sharedView].offset = 49.0f;
}

+ (void) setLocationNavBar
{
CGRect screenRect = [[UIScreen mainScreen] bounds];
[ZAActivityBar sharedView].offset = screenRect.size.height - 120.0f;
}

///////////////////////////////////////////////////////////////

#pragma mark - Action Methods

- (ZAActivityAction *) getPrimaryAction {
Expand Down Expand Up @@ -402,7 +423,7 @@ - (float) getOffscreenYPosition {
}

- (float) getBarYPosition {
return [self getHeight] - ((HEIGHT / 2) + PADDING) - BOTTOM_OFFSET;
return [self getHeight] - ((HEIGHT / 2) + PADDING) - self.offset;
}

// Returns the height for the bar in the current orientation
Expand Down

0 comments on commit 86d8e82

Please sign in to comment.