Rename tab to “Notifications”
This commit is contained in:
parent
c2232a596d
commit
ed9911ca76
|
@ -96,7 +96,7 @@
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"search": "Search",
|
"search": "Search",
|
||||||
"notification": "Notification",
|
"notifications": "Notifications",
|
||||||
"profile": "Profile"
|
"profile": "Profile"
|
||||||
},
|
},
|
||||||
"keyboard": {
|
"keyboard": {
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"search": "Search",
|
"search": "Search",
|
||||||
"notification": "Notification",
|
"notifications": "Notifications",
|
||||||
"profile": "Profile"
|
"profile": "Profile"
|
||||||
},
|
},
|
||||||
"keyboard": {
|
"keyboard": {
|
||||||
|
|
|
@ -71,8 +71,8 @@ final public class SceneCoordinator {
|
||||||
self.setup()
|
self.setup()
|
||||||
try await Task.sleep(nanoseconds: .second * 1)
|
try await Task.sleep(nanoseconds: .second * 1)
|
||||||
|
|
||||||
// redirect to notification tab
|
// redirect to notifications tab
|
||||||
self.switchToTabBar(tab: .notification)
|
self.switchToTabBar(tab: .notifications)
|
||||||
|
|
||||||
// Delay in next run loop
|
// Delay in next run loop
|
||||||
DispatchQueue.main.async { [weak self] in
|
DispatchQueue.main.async { [weak self] in
|
||||||
|
|
|
@ -49,7 +49,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case home
|
case home
|
||||||
case search
|
case search
|
||||||
case compose
|
case compose
|
||||||
case notification
|
case notifications
|
||||||
case me
|
case me
|
||||||
|
|
||||||
var tag: Int {
|
var tag: Int {
|
||||||
|
@ -61,7 +61,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case .home: return L10n.Common.Controls.Tabs.home
|
case .home: return L10n.Common.Controls.Tabs.home
|
||||||
case .search: return L10n.Common.Controls.Tabs.search
|
case .search: return L10n.Common.Controls.Tabs.search
|
||||||
case .compose: return L10n.Common.Controls.Actions.compose
|
case .compose: return L10n.Common.Controls.Actions.compose
|
||||||
case .notification: return L10n.Common.Controls.Tabs.notification
|
case .notifications: return L10n.Common.Controls.Tabs.notifications
|
||||||
case .me: return L10n.Common.Controls.Tabs.profile
|
case .me: return L10n.Common.Controls.Tabs.profile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate)
|
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate)
|
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .notification: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
case .notifications: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .me: return UIImage(systemName: "person")!
|
case .me: return UIImage(systemName: "person")!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case .home: return Asset.ObjectsAndTools.houseFill.image.withRenderingMode(.alwaysTemplate)
|
case .home: return Asset.ObjectsAndTools.houseFill.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .search: return Asset.ObjectsAndTools.magnifyingglassFill.image.withRenderingMode(.alwaysTemplate)
|
case .search: return Asset.ObjectsAndTools.magnifyingglassFill.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .notification: return Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
case .notifications: return Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .me: return UIImage(systemName: "person.fill")!
|
case .me: return UIImage(systemName: "person.fill")!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
||||||
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
||||||
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
||||||
case .notification: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
case .notifications: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate).resized(size: CGSize(width: 80, height: 80))
|
||||||
case .me: return UIImage(systemName: "person", withConfiguration: UIImage.SymbolConfiguration(pointSize: 80))!
|
case .me: return UIImage(systemName: "person", withConfiguration: UIImage.SymbolConfiguration(pointSize: 80))!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class MainTabBarController: UITabBarController {
|
||||||
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate)
|
case .home: return Asset.ObjectsAndTools.house.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate)
|
case .search: return Asset.ObjectsAndTools.magnifyingglass.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
case .compose: return Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .notification: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
case .notifications: return Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
||||||
case .me: return UIImage(systemName: "person")!
|
case .me: return UIImage(systemName: "person")!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ class MainTabBarController: UITabBarController {
|
||||||
viewController = _viewController
|
viewController = _viewController
|
||||||
case .compose:
|
case .compose:
|
||||||
viewController = UIViewController()
|
viewController = UIViewController()
|
||||||
case .notification:
|
case .notifications:
|
||||||
let _viewController = NotificationViewController()
|
let _viewController = NotificationViewController()
|
||||||
_viewController.context = context
|
_viewController.context = context
|
||||||
_viewController.coordinator = coordinator
|
_viewController.coordinator = coordinator
|
||||||
|
@ -272,7 +272,7 @@ extension MainTabBarController {
|
||||||
} ?? false
|
} ?? false
|
||||||
|
|
||||||
let image: UIImage = {
|
let image: UIImage = {
|
||||||
if currentTab == .notification {
|
if currentTab == .notifications {
|
||||||
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadgeFill.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadgeFill.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
||||||
} else {
|
} else {
|
||||||
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadge.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadge.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
||||||
|
@ -593,7 +593,7 @@ extension MainTabBarController {
|
||||||
let tabs: [Tab] = [
|
let tabs: [Tab] = [
|
||||||
.home,
|
.home,
|
||||||
.search,
|
.search,
|
||||||
.notification,
|
.notifications,
|
||||||
.me
|
.me
|
||||||
]
|
]
|
||||||
for (i, tab) in tabs.enumerated() {
|
for (i, tab) in tabs.enumerated() {
|
||||||
|
|
|
@ -100,7 +100,7 @@ extension SidebarViewModel {
|
||||||
.store(in: &cell.disposeBag)
|
.store(in: &cell.disposeBag)
|
||||||
|
|
||||||
switch item {
|
switch item {
|
||||||
case .notification:
|
case .notifications:
|
||||||
Publishers.CombineLatest(
|
Publishers.CombineLatest(
|
||||||
self.context.notificationService.unreadNotificationCountDidUpdate,
|
self.context.notificationService.unreadNotificationCountDidUpdate,
|
||||||
self.$currentTab
|
self.$currentTab
|
||||||
|
@ -116,7 +116,7 @@ extension SidebarViewModel {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let image: UIImage = {
|
let image: UIImage = {
|
||||||
if currentTab == .notification {
|
if currentTab == .notifications {
|
||||||
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadgeFill.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadgeFill.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bellFill.image.withRenderingMode(.alwaysTemplate)
|
||||||
} else {
|
} else {
|
||||||
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadge.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
return hasUnreadPushNotification ? Asset.ObjectsAndTools.bellBadge.image.withRenderingMode(.alwaysTemplate) : Asset.ObjectsAndTools.bell.image.withRenderingMode(.alwaysTemplate)
|
||||||
|
@ -192,7 +192,7 @@ extension SidebarViewModel {
|
||||||
let items: [Item] = [
|
let items: [Item] = [
|
||||||
.tab(.home),
|
.tab(.home),
|
||||||
.tab(.search),
|
.tab(.search),
|
||||||
.tab(.notification),
|
.tab(.notifications),
|
||||||
.tab(.me),
|
.tab(.me),
|
||||||
.setting,
|
.setting,
|
||||||
]
|
]
|
||||||
|
|
|
@ -172,7 +172,7 @@ extension SceneDelegate {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
coordinator.switchToTabBar(tab: .notification)
|
coordinator.switchToTabBar(tab: .notifications)
|
||||||
|
|
||||||
case "org.joinmastodon.app.new-post":
|
case "org.joinmastodon.app.new-post":
|
||||||
if coordinator?.tabBarController.topMost is ComposeViewController {
|
if coordinator?.tabBarController.topMost is ComposeViewController {
|
||||||
|
|
|
@ -366,8 +366,8 @@ public enum L10n {
|
||||||
public enum Tabs {
|
public enum Tabs {
|
||||||
/// Home
|
/// Home
|
||||||
public static let home = L10n.tr("Localizable", "Common.Controls.Tabs.Home")
|
public static let home = L10n.tr("Localizable", "Common.Controls.Tabs.Home")
|
||||||
/// Notification
|
/// Notifications
|
||||||
public static let notification = L10n.tr("Localizable", "Common.Controls.Tabs.Notification")
|
public static let notifications = L10n.tr("Localizable", "Common.Controls.Tabs.Notifications")
|
||||||
/// Profile
|
/// Profile
|
||||||
public static let profile = L10n.tr("Localizable", "Common.Controls.Tabs.Profile")
|
public static let profile = L10n.tr("Localizable", "Common.Controls.Tabs.Profile")
|
||||||
/// Search
|
/// Search
|
||||||
|
|
|
@ -131,7 +131,7 @@ Please check your internet connection.";
|
||||||
"Common.Controls.Status.Visibility.PrivateFromMe" = "Only my followers can see this post.";
|
"Common.Controls.Status.Visibility.PrivateFromMe" = "Only my followers can see this post.";
|
||||||
"Common.Controls.Status.Visibility.Unlisted" = "Everyone can see this post but not display in the public timeline.";
|
"Common.Controls.Status.Visibility.Unlisted" = "Everyone can see this post but not display in the public timeline.";
|
||||||
"Common.Controls.Tabs.Home" = "Home";
|
"Common.Controls.Tabs.Home" = "Home";
|
||||||
"Common.Controls.Tabs.Notification" = "Notification";
|
"Common.Controls.Tabs.Notifications" = "Notifications";
|
||||||
"Common.Controls.Tabs.Profile" = "Profile";
|
"Common.Controls.Tabs.Profile" = "Profile";
|
||||||
"Common.Controls.Tabs.Search" = "Search";
|
"Common.Controls.Tabs.Search" = "Search";
|
||||||
"Common.Controls.Timeline.Filtered" = "Filtered";
|
"Common.Controls.Timeline.Filtered" = "Filtered";
|
||||||
|
|
Loading…
Reference in New Issue