Skip to content
Browse files

Fix author and repo name on iphone in landscape

  • Loading branch information...
1 parent aa2c5ab commit ebdb22949b90917ca0934c6a0982028297b68a6b Jaymes Waters and Brad Grzesiak committed with Bendyworks Pair Mar 22, 2012
View
13 TravisCI/BWBuildListViewController.m
@@ -83,9 +83,8 @@ -(void)viewDidUnload
- (void)viewWillAppear:(BOOL)animated
{
[self addObserver:self forKeyPath:@"repository" options:NSKeyValueObservingOptionNew context:nil];
- NSArray *slugInfo = [self.repository.slug componentsSeparatedByString:@"/"];
- [self.authorName setText:[slugInfo objectAtIndex:0]];
- [self.repositoryName setText:[slugInfo objectAtIndex:1]];
+ [self.authorName setText:[self.repository author]];
+ [self.repositoryName setText:[self.repository name]];
[self updateFollowButton];
[super viewWillAppear:animated];
@@ -117,6 +116,14 @@ - (void)setNavigationTitleProperties:(UIInterfaceOrientation)toInterfaceOrientat
[self.repositoryName setShadowOffset:CGSizeMake(0.0f, -1.0f)];
}
}
+
+ if (IS_IPHONE && UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
+ [self.authorName setText:@""];
+ [self.repositoryName setText:self.repository.slug];
+ } else {
+ [self.authorName setText:[self.repository author]];
+ [self.repositoryName setText:[self.repository name]];
+ }
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
View
2 TravisCI/BWRepository+Presenter.h
@@ -17,5 +17,7 @@
- (NSString *)finishedText;
- (UIImage *)statusImage;
- (UIColor *)statusTextColor;
+- (NSString *)name;
+- (NSString *)author;
@end
View
12 TravisCI/BWRepository+Presenter.m
@@ -88,4 +88,16 @@ - (NSString *)accessibilityHint
return @"";
}
+- (NSString *)name
+{
+ NSArray *slugInfo = [self.slug componentsSeparatedByString:@"/"];
+ return [slugInfo objectAtIndex:1];
+}
+
+- (NSString *)author
+{
+ NSArray *slugInfo = [self.slug componentsSeparatedByString:@"/"];
+ return [slugInfo objectAtIndex:0];
+}
+
@end
View
4 TravisCI/en.lproj/MainStoryboard_iPhone.storyboard
@@ -402,8 +402,8 @@
<color key="shadowColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="8" id="qfB-dV-qVZ">
- <rect key="frame" x="0.0" y="12" width="128" height="21"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+ <rect key="frame" x="0.0" y="14" width="128" height="21"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>

0 comments on commit ebdb229

Please sign in to comment.
Something went wrong with that request. Please try again.