Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ extension WPStyleGuide {
UITabBar.appearance().unselectedItemTintColor = .tabUnselected

let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = .systemBackground

UITabBar.appearance().standardAppearance = appearance
UITabBar.appearance().scrollEdgeAppearance = appearance
}
Expand Down
5 changes: 5 additions & 0 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum FeatureFlag: Int, CaseIterable {
case commentModerationUpdate
case compliancePopover
case domainFocus
case newTabIcons

/// Returns a boolean indicating if the feature is enabled
var enabled: Bool {
Expand Down Expand Up @@ -40,6 +41,8 @@ enum FeatureFlag: Int, CaseIterable {
return true
case .domainFocus:
return true
case .newTabIcons:
return BuildConfiguration.current == .localDeveloper
}
}

Expand Down Expand Up @@ -82,6 +85,8 @@ extension FeatureFlag {
return "Compliance Popover"
case .domainFocus:
return "Domain Focus"
case .newTabIcons:
return "New Tab Icons"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ class NotificationsViewController: UIViewController, UIViewControllerRestoration

reloadTableViewPreservingSelection()
startListeningToCommentDeletedNotifications()

extendedLayoutIncludesOpaqueBars = true
edgesForExtendedLayout = .all
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ReaderTabViewController: UIViewController {
self.makeReaderTabView = readerTabViewFactory
super.init(nibName: nil, bundle: nil)

extendedLayoutIncludesOpaqueBars = true
title = ReaderTabConstants.title
setupNavigationButtons()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ class MySitesCoordinator: NSObject {
navigationController.restorationIdentifier = MySitesCoordinator.navigationControllerRestorationID
navigationController.navigationBar.isTranslucent = false

let tabBarImage = AppStyleGuide.mySiteTabIcon
navigationController.tabBarItem.image = tabBarImage
navigationController.tabBarItem.selectedImage = tabBarImage
if FeatureFlag.newTabIcons.enabled {
navigationController.tabBarItem.image = UIImage(named: "tab-bar-home-unselected")
navigationController.tabBarItem.selectedImage = UIImage(named: "tab-bar-home-selected")
} else {
let tabBarImage = AppStyleGuide.mySiteTabIcon
navigationController.tabBarItem.image = tabBarImage
navigationController.tabBarItem.selectedImage = tabBarImage
}
navigationController.tabBarItem.accessibilityLabel = NSLocalizedString("My Site", comment: "The accessibility value of the my site tab.")
navigationController.tabBarItem.accessibilityIdentifier = "mySitesTabButton"
navigationController.tabBarItem.title = NSLocalizedString("My Site", comment: "The accessibility value of the my site tab.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ extension WPTabBarController {
NotificationCenter.default.addObserver(self, selector: #selector(accountDidChange), name: .WPAccountEmailAndDefaultBlogUpdated, object: nil)
}

@objc func configureMeTabImage(placeholderImage: UIImage) {
meNavigationController?.tabBarItem.image = placeholderImage
meNavigationController?.tabBarItem.selectedImage = placeholderImage
@objc func configureMeTabImage(placeholderImage: UIImage?) {
configureMeTabImage(unselectedPlaceholderImage: placeholderImage, selectedPlaceholderImage: placeholderImage)
}

@objc func configureMeTabImage(unselectedPlaceholderImage: UIImage?, selectedPlaceholderImage: UIImage?) {
meNavigationController?.tabBarItem.image = unselectedPlaceholderImage
meNavigationController?.tabBarItem.selectedImage = selectedPlaceholderImage

guard let account = defaultAccount(),
let email = account.email else {
Expand Down Expand Up @@ -45,7 +49,13 @@ extension WPTabBarController {
}

@objc private func accountDidChange() {
configureMeTabImage(placeholderImage: UIImage(named: "icon-tab-me") ?? UIImage())
guard FeatureFlag.newTabIcons.enabled else {
configureMeTabImage(placeholderImage: UIImage(named: "icon-tab-me"))
return
}

configureMeTabImage(unselectedPlaceholderImage: UIImage(named: "tab-bar-me-unselected"),
selectedPlaceholderImage: UIImage(named: "tab-bar-me-selected"))
}
}

Expand Down
36 changes: 27 additions & 9 deletions WordPress/Classes/ViewRelated/System/WPTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,14 @@ - (UINavigationController *)readerNavigationController
_readerNavigationController.navigationBar.translucent = NO;
_readerNavigationController.view.backgroundColor = [UIColor murielBasicBackground];

UIImage *readerTabBarImage = [UIImage imageNamed:@"icon-tab-reader"];
_readerNavigationController.tabBarItem.image = readerTabBarImage;
_readerNavigationController.tabBarItem.selectedImage = readerTabBarImage;
if ([Feature enabled:FeatureFlagNewTabIcons]) {
_readerNavigationController.tabBarItem.image = [UIImage imageNamed:@"tab-bar-reader-unselected"];
_readerNavigationController.tabBarItem.selectedImage = [UIImage imageNamed:@"tab-bar-reader-selected"];
} else {
UIImage *readerTabBarImage = [UIImage imageNamed:@"icon-tab-reader"];
_readerNavigationController.tabBarItem.image = readerTabBarImage;
_readerNavigationController.tabBarItem.selectedImage = readerTabBarImage;
}
_readerNavigationController.restorationIdentifier = WPReaderNavigationRestorationID;
_readerNavigationController.tabBarItem.accessibilityIdentifier = @"readerTabButton";
_readerNavigationController.tabBarItem.title = NSLocalizedString(@"Reader", @"The accessibility value of the Reader tab.");
Expand All @@ -207,11 +212,19 @@ - (UINavigationController *)notificationsNavigationController
}
_notificationsNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
_notificationsNavigationController.navigationBar.translucent = NO;
self.notificationsTabBarImage = [UIImage imageNamed:@"icon-tab-notifications"];
NSString *unreadImageName = [AppConfiguration isJetpack] ? @"icon-tab-notifications-unread-jetpack" : @"icon-tab-notifications-unread";
self.notificationsTabBarImageUnread = [[UIImage imageNamed:unreadImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_notificationsNavigationController.tabBarItem.image = self.notificationsTabBarImage;
_notificationsNavigationController.tabBarItem.selectedImage = self.notificationsTabBarImage;
if ([Feature enabled:FeatureFlagNewTabIcons]) {
self.notificationsTabBarImage = [UIImage imageNamed:@"tab-bar-notifications-unselected"];
NSString *unreadImageName = [AppConfiguration isJetpack] ? @"tab-bar-notifications-unread-jp" : @"tab-bar-notifications-unread-jp";
self.notificationsTabBarImageUnread = [[UIImage imageNamed:unreadImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_notificationsNavigationController.tabBarItem.image = self.notificationsTabBarImage;
_notificationsNavigationController.tabBarItem.selectedImage = [UIImage imageNamed:@"tab-bar-notifications-selected"];
} else {
self.notificationsTabBarImage = [UIImage imageNamed:@"icon-tab-notifications"];
NSString *unreadImageName = [AppConfiguration isJetpack] ? @"icon-tab-notifications-unread-jetpack" : @"icon-tab-notifications-unread";
self.notificationsTabBarImageUnread = [[UIImage imageNamed:unreadImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
_notificationsNavigationController.tabBarItem.image = self.notificationsTabBarImage;
_notificationsNavigationController.tabBarItem.selectedImage = self.notificationsTabBarImage;
}
_notificationsNavigationController.restorationIdentifier = WPNotificationsNavigationRestorationID;
_notificationsNavigationController.tabBarItem.accessibilityIdentifier = @"notificationsTabButton";
_notificationsNavigationController.tabBarItem.accessibilityLabel = NSLocalizedString(@"Notifications", @"Notifications tab bar item accessibility label");
Expand All @@ -224,7 +237,12 @@ - (UINavigationController *)meNavigationController
{
if (!_meNavigationController) {
_meNavigationController = [[UINavigationController alloc] initWithRootViewController:self.meViewController];
[self configureMeTabImageWithPlaceholderImage:[UIImage imageNamed:@"icon-tab-me"]];
if ([Feature enabled:FeatureFlagNewTabIcons]) {
[self configureMeTabImageWithUnselectedPlaceholderImage:[UIImage imageNamed:@"tab-bar-me-unselected"]
selectedPlaceholderImage:[UIImage imageNamed:@"tab-bar-me-selected"]];
} else {
[self configureMeTabImageWithPlaceholderImage:[UIImage imageNamed:@"icon-tab-me"]];
}
_meNavigationController.restorationIdentifier = WPMeNavigationRestorationID;
_meNavigationController.tabBarItem.accessibilityLabel = NSLocalizedString(@"Me", @"The accessibility value of the me tab.");
_meNavigationController.tabBarItem.accessibilityIdentifier = @"meTabButton";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-home-selected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-home-unselected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-me-selected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-me-unselected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-notifications-selected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-notifications-unread-jp.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-notifications-unread-wp.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-notifications-unselected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-reader-selected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "tab-bar-reader-unselected.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.