Show a little red badge when there are notifications (#1132)
This commit is contained in:
parent
d0e1c616f6
commit
e11ada8277
|
@ -232,13 +232,14 @@ extension MainTabBarController {
|
||||||
return count > 0
|
return count > 0
|
||||||
} ?? false
|
} ?? false
|
||||||
|
|
||||||
let image: UIImage = {
|
let image: UIImage
|
||||||
if hasUnreadPushNotification {
|
if hasUnreadPushNotification {
|
||||||
return UIImage(systemName: "bell.badge")!
|
let imageConfiguration = UIImage.SymbolConfiguration(paletteColors: [.red, SystemTheme.tabBarItemNormalIconColor])
|
||||||
} else {
|
image = UIImage(systemName: "bell.badge", withConfiguration: imageConfiguration)!
|
||||||
return Tab.notifications.image
|
} else {
|
||||||
}
|
image = Tab.notifications.image
|
||||||
}()
|
}
|
||||||
|
|
||||||
notificationViewController.tabBarItem.image = image.imageWithoutBaseline()
|
notificationViewController.tabBarItem.image = image.imageWithoutBaseline()
|
||||||
notificationViewController.navigationController?.tabBarItem.image = image.imageWithoutBaseline()
|
notificationViewController.navigationController?.tabBarItem.image = image.imageWithoutBaseline()
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,13 +119,13 @@ extension SidebarViewModel {
|
||||||
return count > 0
|
return count > 0
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let image: UIImage = {
|
let image: UIImage
|
||||||
if hasUnreadPushNotification {
|
if hasUnreadPushNotification {
|
||||||
return UIImage(systemName: "bell.badge")!
|
let imageConfiguration = UIImage.SymbolConfiguration(paletteColors: [.red, SystemTheme.tabBarItemNormalIconColor])
|
||||||
} else {
|
image = UIImage(systemName: "bell.badge", withConfiguration: imageConfiguration)!
|
||||||
return MainTabBarController.Tab.notifications.image
|
} else {
|
||||||
}
|
image = MainTabBarController.Tab.notifications.image
|
||||||
}()
|
}
|
||||||
cell.item?.image = image
|
cell.item?.image = image
|
||||||
cell.item?.activeImage = image.withTintColor(Asset.Colors.Brand.blurple.color, renderingMode: .alwaysOriginal)
|
cell.item?.activeImage = image.withTintColor(Asset.Colors.Brand.blurple.color, renderingMode: .alwaysOriginal)
|
||||||
cell.setNeedsUpdateConfiguration()
|
cell.setNeedsUpdateConfiguration()
|
||||||
|
|
Loading…
Reference in New Issue