Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Commit

Permalink
+ symbol to refresh time, + more fixes and nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
insanj committed Dec 2, 2013
1 parent 5a2a8ca commit 06fd73b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 44 deletions.
7 changes: 5 additions & 2 deletions UROpen.xcodeproj/project.pbxproj
Expand Up @@ -260,6 +260,9 @@
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = insanj;
TargetAttributes = {
9E605C2D184A6B6900A6A429 = {
DevelopmentTeam = 24X8MVUSCN;
};
9E605C51184A6B6A00A6A429 = {
TestTargetID = 9E605C2D184A6B6900A6A429;
};
Expand Down Expand Up @@ -447,7 +450,7 @@
9E605C64184A6B6A00A6A429 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Distribution: Julian Weiss (24X8MVUSCN)";
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "UROpen/UROpen-Prefix.pch";
INFOPLIST_FILE = "UROpen/UROpen-Info.plist";
Expand All @@ -462,7 +465,7 @@
9E605C65184A6B6A00A6A429 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Distribution: Julian Weiss (24X8MVUSCN)";
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "UROpen/UROpen-Prefix.pch";
INFOPLIST_FILE = "UROpen/UROpen-Info.plist";
Expand Down
2 changes: 1 addition & 1 deletion UROpen/URNavigationBar.m
Expand Up @@ -12,7 +12,7 @@ @implementation URNavigationBar

-(id)initWithFrame:(CGRect)frame{
if ((self = [super initWithFrame:frame])){

//air
}

return self;
Expand Down
2 changes: 1 addition & 1 deletion UROpen/UROpen-Info.plist
Expand Up @@ -35,7 +35,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchImages</key>
Expand Down
47 changes: 7 additions & 40 deletions UROpen/URViewController.m
Expand Up @@ -26,7 +26,7 @@ -(void)viewDidLoad{
barItems.leftBarButtonItem = refresh;

UIButton *moreButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[moreButton addTarget:self action:@selector(infoTapped) forControlEvents:UIControlEventTouchUpInside];
[moreButton addTarget:self action:@selector(openInfo) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *moreItem = [[UIBarButtonItem alloc] initWithCustomView:moreButton];
barItems.rightBarButtonItem = moreItem;

Expand Down Expand Up @@ -64,7 +64,7 @@ -(void)createPlaces{
NSArray *cWeek = @[@"7.0-10.0"];
connections.windows = @{@"1": @[@"14.0-22.0"], @"2": cWeek, @"3": cWeek, @"4": cWeek, @"5": cWeek, @"6": @[@"7.0-17.0"], @"7": @[@"sunday"]};
connections.plan = @"no passes";
//danforth.location = @"43.130033333,-77.626583333";
connections.location = @"43.128766667,-77.628166667";
[working addObject:connections];

URPlace *danforth = [[URPlace alloc] initWithName:@"Danforth"];
Expand Down Expand Up @@ -123,7 +123,7 @@ -(void)createPlaces{
NSArray *puraWeek = @[@"7.5-18.5"];
pura.windows = @{@"1": @[@"monday"], @"2": puraWeek, @"3": puraWeek, @"4": puraWeek, @"5": puraWeek, @"6": @[@"7.5-14.0"], @"7": @[@"monday"]};
pura.plan = @"no passes";
//pura.location = @"43.1289,-77.628816667";
pura.location = @"43.125333333,-77.629433333";
[working addObject:pura];

URPlace *starbucks = [[URPlace alloc] initWithName:@"Starbucks"];
Expand All @@ -150,8 +150,9 @@ -(void)refreshTime{

titleText = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
titleText.backgroundColor = [UIColor clearColor];
titleText.editable = NO;
NSMutableAttributedString *titleStr = [[NSMutableAttributedString alloc] initWithString:@"UROpen" attributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:16.f], NSParagraphStyleAttributeName : centered}];
[titleStr appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"\n%@:%@ %@", [self appendZerosIfNeeded:fmod(comp.hour, 12)==0?12:fmod(comp.hour, 12)], [self appendZerosIfNeeded:comp.minute], comp.hour>=12?@"pm":@"am"] attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:11.f], NSParagraphStyleAttributeName : centered}]];
[titleStr appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"\n%i:%@ %@", fmod(comp.hour, 12)==0?12:((int)fmod(comp.hour, 12)), [self appendZerosIfNeeded:comp.minute], comp.hour>=12?@"pm":@"am"] attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:11.f], NSParagraphStyleAttributeName : centered}]];
titleText.attributedText = titleStr;
((UINavigationItem *)mainBar.items[0]).titleView = titleText;
}
Expand Down Expand Up @@ -181,33 +182,7 @@ -(void)reloadCollection:(UIBarButtonItem *)sender{
[((UINavigationItem *)mainBar.items[0]).leftBarButtonItem setEnabled:YES];
[((UINavigationItem *)mainBar.items[0]).rightBarButtonItem setEnabled:YES];
});

/*
CGRect mainFrame = mainCollectionView.frame;
mainFrame.origin.y = mainFrame.size.height;
[UIView animateWithDuration:0.5 animations:^{
[mainCollectionView setFrame:mainFrame];
} completion:^(BOOL finished){
[mainCollectionView removeFromSuperview];
[UIView animateWithDuration:0.5 animations:^{
CGRect backFrame = mainFrame;
backFrame.origin.y = 0;
[self.view insertSubview:mainCollectionView belowSubview:mainBar];
[mainCollectionView setFrame:backFrame];
}];
}];*/
}

-(void)infoTapped{
if(mainCollectionView.contentOffset.y <= 60.f || true)
[self openInfo];

else{
info = YES;
[mainCollectionView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
}
}
}//end method

-(void)openInfo{
[((UINavigationItem *)mainBar.items[0]).rightBarButtonItem setEnabled:NO];
Expand All @@ -228,7 +203,6 @@ -(void)openInfo{
[self.view addSubview:aboutView];
}//end if


for(UIView *v in mainCollectionView.subviews){
[UIView animateWithDuration:0.5 animations:^{
CGRect frame = v.frame;
Expand All @@ -255,7 +229,7 @@ -(void)openInfo{

[self.view addSubview:sample];
[UIView animateWithDuration:0.5 animations:^{
[sample setCenter:CGPointMake(self.view.center.x, self.view.center.y - 50)];
[sample setCenter:CGPointMake(self.view.center.x, self.view.center.y - 75)];
[aboutView setFrame:CGRectMake(self.view.frame.size.width - 275, self.view.frame.size.height - 225, 250, 250)];
} completion:^(BOOL finished){
[((UINavigationItem *)mainBar.items[0]).rightBarButtonItem setEnabled:YES];
Expand Down Expand Up @@ -338,13 +312,6 @@ -(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UIColle
}

#pragma mark - ScrollView and AlertView
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
if(info && scrollView.contentOffset.y <= -60.f){
info = NO;
[self openInfo];
}
}

-(void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
if(buttonIndex != alertView.cancelButtonIndex){
NSString *location = [@"http://maps.apple.com/?q=" stringByAppendingString:last.location];
Expand Down

0 comments on commit 06fd73b

Please sign in to comment.