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

Commit a517309

Browse files
author
kernel
committed
Update RecentRepos at Repo screen to use native navBar.
1 parent 4ca0a34 commit a517309

File tree

5 files changed

+12
-48
lines changed

5 files changed

+12
-48
lines changed

Gitty/DAFrameCtrl.m

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ - (void)animateOverlayContainerWithOption:(DAFramePresentingAnimations)option co
164164
if (completionHandler) {
165165
completionHandler(finished);
166166
}
167-
168-
// [self setNeedsStatusBarAppearanceUpdate];
169167
}];
170168
}
171169

@@ -183,14 +181,11 @@ - (void)presentMenuCtrl:(DABaseCtrl *)ctrl animated:(BOOL)animated animationOpti
183181
}
184182

185183
- (void)dismissMenuCtrl:(DABaseCtrl *)ctrl animated:(BOOL)animated {
186-
[self.menuCtrl willMoveToParentViewController:nil];
187-
188184
[self animateMenuContainerWithOption:DASlideToCenterPresentation completionHandler:^(BOOL finished) {
189-
[self.menuContainer removeAllSubviews];
190-
191-
[self.menuCtrl didMoveToParentViewController:nil];
192-
193185
_menuCtrl = nil;
186+
self.menuNavCtrl.viewControllers = @[];
187+
188+
[self setNeedsStatusBarAppearanceUpdate];
194189
}];
195190
}
196191

@@ -199,14 +194,11 @@ - (void)dismissMenuCtrl:(DABaseCtrl *)ctrl animated:(BOOL)animated {
199194
- (void)presentMenuContainerWithOption:(DAFramePresentingAnimations)option {
200195
[self prepositionMenuContainerForOption:DASlideToCenterPresentation];
201196

202-
[self addChildViewController:self.menuCtrl];
203-
204-
self.menuCtrl.view.frame = self.menuContainer.bounds;
205-
[self.menuContainer addSubview:self.menuCtrl.view];
197+
self.menuNavCtrl.navigationBarHidden = NO;
198+
[self.menuNavCtrl setViewControllers:@[self.menuCtrl]];
206199

207200
dispatch_async(dispatch_get_main_queue(), ^{
208201
[self animateMenuContainerWithOption:option completionHandler:^(BOOL finished) {
209-
[self.menuCtrl didMoveToParentViewController:self];
210202
}];
211203
});
212204
}
@@ -264,8 +256,6 @@ - (void)animateMenuContainerWithOption:(DAFramePresentingAnimations)option compl
264256
if (completionHandler) {
265257
completionHandler(finished);
266258
}
267-
268-
[self setNeedsStatusBarAppearanceUpdate];
269259
}];
270260
}
271261

Gitty/DAReposListCtrl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
@property (strong, nonatomic) void (^selectAction)(NSDictionary *repo);
1717

1818
@property (strong, nonatomic) IBOutlet UITableView *tableView;
19-
@property (strong, nonatomic) IBOutlet UINavigationItem *navItem;
2019
@property (strong, nonatomic) IBOutlet UIButton *serversButton;
2120
@end

Gitty/DAReposListCtrl.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ @interface DAReposListCtrl ()
1515

1616
@implementation DAReposListCtrl
1717

18-
- (BOOL)prefersStatusBarHidden {
19-
return NO;
20-
}
21-
2218
- (void)viewDidLoad {
2319
[super viewDidLoad];
2420

21+
self.title = NSLocalizedString(@"Repos", nil);
22+
2523
_repos = self.server.reposByAccessTime;
2624

27-
self.navItem.leftBarButtonItem = [UIBarButtonItem.alloc initWithCustomView:self.serversButton];
25+
self.navigationItem.leftBarButtonItem = [UIBarButtonItem.alloc initWithCustomView:self.serversButton];
2826

2927
NSString *identifier = DAQuickRepoCell.className;
3028
UINib *nib = [UINib nibWithNibName:identifier bundle:nil];

Gitty/DAReposListCtrl.xib

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<objects>
88
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DAReposListCtrl">
99
<connections>
10-
<outlet property="navItem" destination="MHn-Xh-K5q" id="ePG-AC-DD9"/>
1110
<outlet property="serversButton" destination="L7P-lR-jFG" id="HNu-7N-8n6"/>
1211
<outlet property="tableView" destination="OiV-0p-7m6" id="ta7-nd-hIy"/>
1312
<outlet property="view" destination="1" id="3"/>
@@ -19,11 +18,11 @@
1918
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2019
<subviews>
2120
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BT4-Xw-bbY" userLabel="Content">
22-
<rect key="frame" x="0.0" y="44" width="320" height="524"/>
21+
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2322
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2423
<subviews>
2524
<tableView contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="OiV-0p-7m6">
26-
<rect key="frame" x="0.0" y="0.0" width="320" height="524"/>
25+
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2726
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2827
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2928
<connections>
@@ -40,29 +39,11 @@
4039
<constraint firstItem="OiV-0p-7m6" firstAttribute="leading" secondItem="BT4-Xw-bbY" secondAttribute="leading" id="pkc-jh-uIY"/>
4140
</constraints>
4241
</view>
43-
<navigationBar contentMode="scaleToFill" barStyle="black" translatesAutoresizingMaskIntoConstraints="NO" id="f2X-cr-DhD">
44-
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
45-
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
46-
<constraints>
47-
<constraint firstAttribute="height" constant="44" id="Gct-P2-wb5"/>
48-
</constraints>
49-
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
50-
<textAttributes key="titleTextAttributes">
51-
<color key="textShadowColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
52-
<offsetWrapper key="textShadowOffset" horizontal="0.0" vertical="2"/>
53-
</textAttributes>
54-
<items>
55-
<navigationItem title="Repos" id="MHn-Xh-K5q"/>
56-
</items>
57-
</navigationBar>
5842
</subviews>
5943
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
6044
<constraints>
6145
<constraint firstAttribute="trailing" secondItem="BT4-Xw-bbY" secondAttribute="trailing" id="3Tj-Nt-4pT"/>
62-
<constraint firstAttribute="trailing" secondItem="f2X-cr-DhD" secondAttribute="trailing" id="C4p-Ud-Wl0"/>
63-
<constraint firstItem="f2X-cr-DhD" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="N8T-uY-mHb"/>
64-
<constraint firstItem="BT4-Xw-bbY" firstAttribute="top" secondItem="f2X-cr-DhD" secondAttribute="bottom" id="TIO-Oa-JlM"/>
65-
<constraint firstItem="f2X-cr-DhD" firstAttribute="top" secondItem="1" secondAttribute="top" id="UMG-37-a8b"/>
46+
<constraint firstItem="BT4-Xw-bbY" firstAttribute="top" secondItem="1" secondAttribute="top" id="mpx-is-m9D"/>
6647
<constraint firstItem="BT4-Xw-bbY" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="nUr-7U-i93"/>
6748
<constraint firstAttribute="bottom" secondItem="BT4-Xw-bbY" secondAttribute="bottom" id="v4E-3n-wS4"/>
6849
</constraints>
@@ -72,7 +53,7 @@
7253
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="L7P-lR-jFG" userLabel="L Button - Servers">
7354
<rect key="frame" x="0.0" y="0.0" width="73" height="44"/>
7455
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
75-
<fontDescription key="fontDescription" type="system" pointSize="15"/>
56+
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
7657
<state key="normal" title="Servers">
7758
<color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
7859
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>

Gitty/en.lproj/MainStoryboard.storyboard

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,15 +1098,11 @@ by </string>
10981098
</scenes>
10991099
<resources>
11001100
<image name="Grabber2_wide_top.png" width="90" height="11"/>
1101-
<image name="Grabber2_wide_top.png" width="90" height="11"/>
1102-
<image name="authors-white.png" width="35" height="21"/>
11031101
<image name="authors-white.png" width="35" height="21"/>
11041102
<image name="authors.png" width="35" height="21"/>
11051103
<image name="bar-branches.png" width="44" height="13"/>
11061104
<image name="bar-tags.png" width="33" height="27"/>
11071105
<image name="branches-white.png" width="29" height="7"/>
1108-
<image name="branches-white.png" width="29" height="7"/>
1109-
<image name="branches.png" width="29" height="7"/>
11101106
<image name="branches.png" width="29" height="7"/>
11111107
<image name="fader-bottom.png" width="2" height="20"/>
11121108
<image name="repo-forget.png" width="30" height="29"/>

0 commit comments

Comments
 (0)