Skip to content

Commit

Permalink
[MB-1798] make MC nav bar translucency optional
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-scig committed Jun 1, 2016
1 parent 8dc0d84 commit 86202c4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Airship/Common/UADefaultMessageCenterListViewController.m
Expand Up @@ -376,6 +376,10 @@ - (void)displayMessage:(UAInboxMessage *)message {
nav.navigationBar.barTintColor = self.style.navigationBarColor;
}

if (self.style.navigationBarTranslucent) {
nav.navigationBar.translucent = self.style.navigationBarTranslucent;
}

NSMutableDictionary *titleAttributes = [NSMutableDictionary dictionary];

if (self.style.titleColor) {
Expand Down
5 changes: 5 additions & 0 deletions Airship/Common/UADefaultMessageCenterSplitViewController.m
Expand Up @@ -96,6 +96,11 @@ - (void)setStyle:(UADefaultMessageCenterStyle *)style {
self.messageNav.navigationBar.barTintColor = self.style.navigationBarColor;
}

if (style.navigationBarTranslucent) {
self.listNav.navigationBar.translucent = style.navigationBarTranslucent;
self.messageNav.navigationBar.translucent = style.navigationBarTranslucent;
}

NSMutableDictionary *titleAttributes = [NSMutableDictionary dictionary];

if (self.style.titleColor) {
Expand Down
5 changes: 5 additions & 0 deletions Airship/Common/UADefaultMessageCenterStyle.h
Expand Up @@ -33,6 +33,11 @@
*/
@property(nonatomic, strong) UIColor *navigationBarColor;

/**
* Whether the navigation bar should be translucent.
*/
@property(nonatomic, assign) BOOL navigationBarTranslucent;

/**
* The background color of the message list.
*/
Expand Down
Expand Up @@ -15,6 +15,8 @@
<integer>0</integer>
<key>navigationBarColor</key>
<real>0</real>
<key>navigationBarTranslucent</key>
<date>2016-06-01T18:51:24Z</date>
<key>listColor</key>
<false/>
<key>refreshTintColor</key>
Expand Down
Expand Up @@ -71,6 +71,7 @@ - (void)testInvalidStyle {
XCTAssertEqualObjects(defaultStyle.titleColor, invalidStyle.titleColor);
XCTAssertEqualObjects(defaultStyle.tintColor, invalidStyle.tintColor);
XCTAssertEqualObjects(defaultStyle.navigationBarColor, invalidStyle.navigationBarColor);
XCTAssertEqual(defaultStyle.navigationBarTranslucent, invalidStyle.navigationBarTranslucent);
XCTAssertEqualObjects(defaultStyle.listColor, invalidStyle.listColor);
XCTAssertEqualObjects(defaultStyle.refreshTintColor, invalidStyle.refreshTintColor);
XCTAssertEqual(defaultStyle.iconsEnabled, invalidStyle.iconsEnabled);
Expand Down Expand Up @@ -108,6 +109,7 @@ - (void)testValidStyle {
XCTAssertEqualObjects(redTestColor, validStyle.titleColor);
XCTAssertEqualObjects(redTestColor, validStyle.tintColor);
XCTAssertEqualObjects(redTestColor, validStyle.navigationBarColor);
XCTAssertFalse(validStyle.navigationBarTranslucent);
XCTAssertEqualObjects(redTestColor, validStyle.listColor);
XCTAssertEqualObjects(redTestColor, validStyle.refreshTintColor);
XCTAssertTrue(validStyle.iconsEnabled);
Expand Down
Expand Up @@ -15,6 +15,8 @@
<string>#00FF00</string>
<key>navigationBarColor</key>
<string>#00FF00</string>
<key>navigationBarTranslucent</key>
<false/>
<key>listColor</key>
<string>#00FF00</string>
<key>refreshTintColor</key>
Expand Down

0 comments on commit 86202c4

Please sign in to comment.