Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Hi! I cleaned up your code for you! #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
10 changes: 5 additions & 5 deletions ATMHud.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ typedef enum {
CGFloat progressBorderWidth;
CGFloat progressBarRadius;
CGFloat progressBarInset;

CGPoint center;

BOOL shadowEnabled;
BOOL blockTouches;
BOOL allowSuperviewInteraction;

NSString *showSound;
NSString *updateSound;
NSString *hideSound;

id <ATMHudDelegate> delegate;
ATMHudAccessoryPosition accessoryPosition;

@private
ATMHudView *__view;
ATMSoundFX *sound;
Expand Down
22 changes: 11 additions & 11 deletions ATMHud.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (void)loadView {
UIViewAutoresizingFlexibleHeight);
base.userInteractionEnabled = NO;
[base addSubview:__view];

self.view = base;
[base release];
}
Expand All @@ -77,11 +77,11 @@ - (void)dealloc {
[sound release];
[__view release];
[displayQueue release];

[showSound release];
[updateSound release];
[hideSound release];

[super dealloc];
}

Expand Down Expand Up @@ -156,7 +156,7 @@ - (void)setFixedSize:(CGSize)fixedSize {

- (void)setProgress:(CGFloat)progress {
__view.progress = progress;

[__view.progressLayer setTheProgress:progress];
[__view.progressLayer setNeedsDisplay];
}
Expand All @@ -183,7 +183,7 @@ - (void)startQueue {
ATMHudQueueItem *queueItem;
for (int i = 0; i < [displayQueue count]; i++) {
queueItem = [displayQueue objectAtIndex:i];

targetSize = [__view calculateSizeForQueueItem:queueItem];
if (targetSize.width > newSize.width) {
newSize.width = targetSize.width;
Expand All @@ -210,21 +210,21 @@ - (void)showQueueAtIndex:(NSInteger)index {
return;
}
ATMHudQueueItem *item = [displayQueue objectAtIndex:queuePosition];

__view.caption = item.caption;
__view.image = item.image;

BOOL flag = item.showActivity;
__view.showActivity = flag;
if (flag) {
[__view.activity startAnimating];
} else {
[__view.activity stopAnimating];
}

self.accessoryPosition = item.accessoryPosition;
[self setActivityStyle:item.activityStyle];

if (queuePosition == 0) {
[__view show];
} else {
Expand Down Expand Up @@ -262,13 +262,13 @@ - (void)construct {
progressBarInset = 3.0;
accessoryPosition = ATMHudAccessoryPositionBottom;
appearScaleFactor = disappearScaleFactor = 1.4;

__view = [[ATMHudView alloc] initWithFrame:CGRectZero andController:self];
__view.autoresizingMask = (UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleLeftMargin);

displayQueue = [[NSMutableArray alloc] init];
queuePosition = 0;
center = CGPointZero;
Expand Down
10 changes: 5 additions & 5 deletions ATMHudView.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ typedef enum {
UIActivityIndicatorView *activity;
UIActivityIndicatorViewStyle activityStyle;
ATMHud *p;

BOOL showActivity;

CGFloat progress;

CGRect targetBounds;
CGRect captionRect;
CGRect progressRect;
CGRect activityRect;
CGRect imageRect;

CGSize fixedSize;
CGSize activitySize;

CALayer *backgroundLayer;
CALayer *imageLayer;
ATMTextLayer *captionLayer;
Expand Down
Loading