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

Commit 12926f1

Browse files
author
kernel
committed
Update Stats.headerView design.
1 parent 4aa4755 commit 12926f1

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

Gitty/DAStatsCtrl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// Header.
2121
@property (strong, nonatomic) IBOutlet UIView *headerContainer;
2222
@property (strong, nonatomic) IBOutlet UILabel *headlineLabel, *noCommitsLabel;
23+
@property (strong, nonatomic) IBOutlet UIView *blurringBackground;
2324

2425
// commitsTable is @dynamic and points to visible table: byAuthorTable or byBranchTable.
2526
@property (strong, nonatomic, readonly) UITableView *commitsTable;

Gitty/DAStatsCtrl.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ @interface DAStatsCtrl ()
1919
@property (strong, nonatomic, readonly) DAGitLatestDayStats *latestDayFilter;
2020

2121
@property (strong, nonatomic) NSIndexPath *selectedCommitIndexPath;
22+
23+
@property (strong, nonatomic, readonly) UIToolbar *headerBluringToolbar;
2224
@end
2325

2426
@implementation DAStatsCtrl
@@ -29,6 +31,8 @@ @implementation DAStatsCtrl
2931
- (void)viewDidLoad {
3032
[super viewDidLoad];
3133

34+
[self applyLightEffectOnHeader];
35+
3236
self.byAuthorTable.scrollsToTop = NO;
3337
self.byBranchTable.scrollsToTop = NO;
3438

@@ -64,6 +68,15 @@ - (void)viewDidAppear:(BOOL)animated {
6468
}
6569
}
6670

71+
- (void)applyLightEffectOnHeader {
72+
if (!self.headerBluringToolbar) {
73+
_headerBluringToolbar = [UIToolbar.alloc initWithFrame:self.blurringBackground.bounds];
74+
}
75+
76+
self.headerBluringToolbar.barTintColor = UIColor.blackColor;
77+
[self.blurringBackground.layer insertSublayer:self.headerBluringToolbar.layer atIndex:0];
78+
}
79+
6780
- (void)reloadStatsData:(DARepoWalk *)stats {
6881
_repoStats = stats;
6982

Gitty/en.lproj/MainStoryboard.storyboard

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -991,12 +991,14 @@ yet.</string>
991991
<view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="p68-Os-XZM" userLabel="Header">
992992
<rect key="frame" x="0.0" y="0.0" width="320" height="80"/>
993993
<subviews>
994-
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="stats_header.png" translatesAutoresizingMaskIntoConstraints="NO" id="iFz-Y0-zqm" userLabel="Background">
995-
<rect key="frame" x="0.0" y="0.0" width="320" height="80"/>
994+
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nsE-xZ-Rii" userLabel="Blurring Background">
995+
<rect key="frame" x="0.0" y="0.0" width="320" height="50"/>
996+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
997+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
996998
<constraints>
997-
<constraint firstAttribute="height" constant="80" id="kbR-En-W67"/>
999+
<constraint firstAttribute="height" constant="50" id="dXD-FP-9Lw"/>
9981000
</constraints>
999-
</imageView>
1001+
</view>
10001002
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="312" translatesAutoresizingMaskIntoConstraints="NO" id="hlC-Gf-Gjv" userLabel="Headline Label">
10011003
<rect key="frame" x="4" y="0.0" width="312" height="40"/>
10021004
<constraints>
@@ -1061,11 +1063,12 @@ by </string>
10611063
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
10621064
<constraints>
10631065
<constraint firstItem="hlC-Gf-Gjv" firstAttribute="top" secondItem="p68-Os-XZM" secondAttribute="top" id="I7v-tB-9eh"/>
1066+
<constraint firstItem="nsE-xZ-Rii" firstAttribute="leading" secondItem="p68-Os-XZM" secondAttribute="leading" id="V1a-7e-Zru"/>
10641067
<constraint firstAttribute="height" constant="80" id="cMS-on-Rd8"/>
1065-
<constraint firstItem="iFz-Y0-zqm" firstAttribute="top" secondItem="p68-Os-XZM" secondAttribute="top" id="fQ3-tP-kox"/>
1068+
<constraint firstAttribute="trailing" secondItem="nsE-xZ-Rii" secondAttribute="trailing" id="cNj-Mw-y4w"/>
1069+
<constraint firstItem="nsE-xZ-Rii" firstAttribute="top" secondItem="p68-Os-XZM" secondAttribute="top" id="fkV-Kg-tOC"/>
10661070
<constraint firstItem="hlC-Gf-Gjv" firstAttribute="leading" secondItem="p68-Os-XZM" secondAttribute="leading" constant="4" id="isT-AL-Lew"/>
10671071
<constraint firstAttribute="centerX" secondItem="hlC-Gf-Gjv" secondAttribute="centerX" id="mWW-MD-Fto"/>
1068-
<constraint firstItem="iFz-Y0-zqm" firstAttribute="leading" secondItem="p68-Os-XZM" secondAttribute="leading" id="pcs-Kl-qdo"/>
10691072
</constraints>
10701073
</view>
10711074
</subviews>
@@ -1085,6 +1088,7 @@ by </string>
10851088
</view>
10861089
<toolbarItems/>
10871090
<connections>
1091+
<outlet property="blurringBackground" destination="nsE-xZ-Rii" id="avK-o0-7KM"/>
10881092
<outlet property="byAuthorDataSource" destination="NwV-q3-KOu" id="yoz-C2-Otz"/>
10891093
<outlet property="byAuthorProxy" destination="bWH-iN-Twi" id="ZUJ-lN-Jca"/>
10901094
<outlet property="byAuthorTable" destination="gnU-QP-WVX" id="xDV-cq-TIb"/>
@@ -1123,20 +1127,15 @@ by </string>
11231127
</scenes>
11241128
<resources>
11251129
<image name="Grabber2_wide_top.png" width="90" height="11"/>
1126-
<image name="Grabber2_wide_top.png" width="90" height="11"/>
1127-
<image name="authors-white.png" width="35" height="21"/>
11281130
<image name="authors-white.png" width="35" height="21"/>
11291131
<image name="authors.png" width="35" height="21"/>
11301132
<image name="bar-branches.png" width="44" height="13"/>
11311133
<image name="bar-tags.png" width="33" height="27"/>
11321134
<image name="branches-white.png" width="29" height="7"/>
1133-
<image name="branches-white.png" width="29" height="7"/>
1134-
<image name="branches.png" width="29" height="7"/>
11351135
<image name="branches.png" width="29" height="7"/>
11361136
<image name="fader-bottom.png" width="2" height="20"/>
11371137
<image name="repo-forget.png" width="30" height="29"/>
11381138
<image name="repos-shortcut.png" width="19" height="17"/>
1139-
<image name="stats_header.png" width="320" height="80"/>
11401139
</resources>
11411140
<simulatedMetricsContainer key="defaultSimulatedMetrics">
11421141
<simulatedStatusBarMetrics key="statusBar"/>

0 commit comments

Comments
 (0)