no message
BIN
Images.xcassets/Chat List/Tabs/IconCallsHW.imageset/Calls@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 917 B |
BIN
Images.xcassets/Chat List/Tabs/IconCallsHW.imageset/Calls@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
22
Images.xcassets/Chat List/Tabs/IconCallsHW.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Calls@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Calls@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Images.xcassets/Chat List/Tabs/IconChatsHW.imageset/Chats@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 822 B |
BIN
Images.xcassets/Chat List/Tabs/IconChatsHW.imageset/Chats@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
22
Images.xcassets/Chat List/Tabs/IconChatsHW.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Chats@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Chats@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Images.xcassets/Chat List/Tabs/IconContactsHW.imageset/Contacts@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 918 B |
BIN
Images.xcassets/Chat List/Tabs/IconContactsHW.imageset/Contacts@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
22
Images.xcassets/Chat List/Tabs/IconContactsHW.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Contacts@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Contacts@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
22
Images.xcassets/Chat List/Tabs/IconSettingsHW.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Settings@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "Settings@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
Images.xcassets/Chat List/Tabs/IconSettingsHW.imageset/Settings@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
Images.xcassets/Chat List/Tabs/IconSettingsHW.imageset/Settings@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
@@ -49,9 +49,16 @@ public final class CallListController: ViewController {
|
||||
if case .tab = self.mode {
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCallIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.callPressed))
|
||||
|
||||
let icon: UIImage?
|
||||
if (useSpecialTabBarIcons()) {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconCallsHW")
|
||||
} else {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconCalls")
|
||||
}
|
||||
|
||||
self.tabBarItem.title = self.presentationData.strings.Calls_TabTitle
|
||||
self.tabBarItem.image = UIImage(bundleImageName: "Chat List/Tabs/IconCalls")
|
||||
self.tabBarItem.selectedImage = UIImage(bundleImageName: "Chat List/Tabs/IconCalls")
|
||||
self.tabBarItem.image = icon
|
||||
self.tabBarItem.selectedImage = icon
|
||||
}
|
||||
|
||||
self.segmentedTitleView.indexUpdated = { [weak self] index in
|
||||
|
||||
@@ -4,27 +4,34 @@ import SwiftSignalKit
|
||||
import Display
|
||||
import TelegramCore
|
||||
|
||||
private let tabImageNone = UIImage(bundleImageName: "Chat List/Tabs/IconChats")?.precomposed()
|
||||
private let tabImageUp = tabImageNone.flatMap({ image in
|
||||
return generateImage(image.size, contextGenerator: { size, context in
|
||||
context.clear(CGRect(origin: CGPoint(), size: size))
|
||||
context.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: size))
|
||||
context.setBlendMode(.copy)
|
||||
context.setFillColor(UIColor.clear.cgColor)
|
||||
context.translateBy(x: 0.0, y: 7.0)
|
||||
let _ = try? drawSvgPath(context, path: "M14.6557321,9.04533883 C14.9642504,8.81236784 15.4032142,8.87361104 15.6361852,9.18212936 C15.8691562,9.49064768 15.807913,9.9296115 15.4993947,10.1625825 L11.612306,13.0978342 C11.3601561,13.2882398 11.0117095,13.2861239 10.7618904,13.0926701 L6.97141581,10.1574184 C6.66574952,9.92071787 6.60984175,9.48104267 6.84654232,9.17537638 C7.08324289,8.86971009 7.5229181,8.81380232 7.82858438,9.05050289 L11.1958257,11.658013 L14.6557321,9.04533883 Z ")
|
||||
})
|
||||
})
|
||||
private let tabImageUnread = tabImageNone.flatMap({ image in
|
||||
return generateImage(image.size, contextGenerator: { size, context in
|
||||
context.clear(CGRect(origin: CGPoint(), size: size))
|
||||
context.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: size))
|
||||
context.setBlendMode(.copy)
|
||||
context.setFillColor(UIColor.clear.cgColor)
|
||||
context.translateBy(x: 0.0, y: 7.0)
|
||||
let _ = try? drawSvgPath(context, path: "M14.6557321,12.0977948 L11.1958257,9.48512064 L7.82858438,12.0926307 C7.5229181,12.3293313 7.08324289,12.2734235 6.84654232,11.9677572 C6.60984175,11.662091 6.66574952,11.2224158 6.97141581,10.9857152 L10.7618904,8.05046348 C11.0117095,7.85700968 11.3601561,7.85489378 11.612306,8.04529942 L15.4993947,10.9805511 C15.807913,11.2135221 15.8691562,11.6524859 15.6361852,11.9610043 C15.4032142,12.2695226 14.9642504,12.3307658 14.6557321,12.0977948 Z ")
|
||||
})
|
||||
})
|
||||
//private let tabImageNone = UIImage(bundleImageName: "Chat List/Tabs/IconChats")?.precomposed()
|
||||
//private let tabImageUp = tabImageNone.flatMap({ image in
|
||||
// return generateImage(image.size, contextGenerator: { size, context in
|
||||
// context.clear(CGRect(origin: CGPoint(), size: size))
|
||||
// context.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: size))
|
||||
// context.setBlendMode(.copy)
|
||||
// context.setFillColor(UIColor.clear.cgColor)
|
||||
// context.translateBy(x: 0.0, y: 7.0)
|
||||
// let _ = try? drawSvgPath(context, path: "M14.6557321,9.04533883 C14.9642504,8.81236784 15.4032142,8.87361104 15.6361852,9.18212936 C15.8691562,9.49064768 15.807913,9.9296115 15.4993947,10.1625825 L11.612306,13.0978342 C11.3601561,13.2882398 11.0117095,13.2861239 10.7618904,13.0926701 L6.97141581,10.1574184 C6.66574952,9.92071787 6.60984175,9.48104267 6.84654232,9.17537638 C7.08324289,8.86971009 7.5229181,8.81380232 7.82858438,9.05050289 L11.1958257,11.658013 L14.6557321,9.04533883 Z ")
|
||||
// })
|
||||
//})
|
||||
//private let tabImageUnread = tabImageNone.flatMap({ image in
|
||||
// return generateImage(image.size, contextGenerator: { size, context in
|
||||
// context.clear(CGRect(origin: CGPoint(), size: size))
|
||||
// context.draw(image.cgImage!, in: CGRect(origin: CGPoint(), size: size))
|
||||
// context.setBlendMode(.copy)
|
||||
// context.setFillColor(UIColor.clear.cgColor)
|
||||
// context.translateBy(x: 0.0, y: 7.0)
|
||||
// let _ = try? drawSvgPath(context, path: "M14.6557321,12.0977948 L11.1958257,9.48512064 L7.82858438,12.0926307 C7.5229181,12.3293313 7.08324289,12.2734235 6.84654232,11.9677572 C6.60984175,11.662091 6.66574952,11.2224158 6.97141581,10.9857152 L10.7618904,8.05046348 C11.0117095,7.85700968 11.3601561,7.85489378 11.612306,8.04529942 L15.4993947,10.9805511 C15.807913,11.2135221 15.8691562,11.6524859 15.6361852,11.9610043 C15.4032142,12.2695226 14.9642504,12.3307658 14.6557321,12.0977948 Z ")
|
||||
// })
|
||||
//})
|
||||
|
||||
public func useSpecialTabBarIcons() -> Bool {
|
||||
let calendar = Calendar(identifier: .gregorian)
|
||||
let now = calendar.dateComponents([.year, .month, .day], from: Date())
|
||||
let target = calendar.dateComponents([.year, .month, .day], from: Date(timeIntervalSince1970: 1540987200))
|
||||
return now.day == target.day && now.month == target.month && now.year == target.year
|
||||
}
|
||||
|
||||
public class ChatListController: TelegramController, KeyShortcutResponder, UIViewControllerPreviewingDelegate {
|
||||
private var validLayout: ContainerViewLayout?
|
||||
@@ -78,8 +85,16 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie
|
||||
self.titleView.title = NetworkStatusTitle(text: self.presentationData.strings.DialogList_Title, activity: false, hasProxy: false, connectsViaProxy: false, isPasscodeSet: false, isManuallyLocked: false)
|
||||
self.navigationItem.titleView = self.titleView
|
||||
self.tabBarItem.title = self.presentationData.strings.DialogList_Title
|
||||
self.tabBarItem.image = tabImageNone
|
||||
self.tabBarItem.selectedImage = tabImageNone
|
||||
|
||||
let icon: UIImage?
|
||||
if (useSpecialTabBarIcons()) {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconChatsHW")
|
||||
} else {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconChats")
|
||||
}
|
||||
|
||||
self.tabBarItem.image = icon
|
||||
self.tabBarItem.selectedImage = icon
|
||||
|
||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Edit, style: .plain, target: self, action: #selector(self.editPressed))
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationComposeIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.composePressed))
|
||||
|
||||
@@ -34,8 +34,16 @@ public class ContactsController: ViewController {
|
||||
|
||||
self.title = self.presentationData.strings.Contacts_Title
|
||||
self.tabBarItem.title = self.presentationData.strings.Contacts_Title
|
||||
self.tabBarItem.image = UIImage(bundleImageName: "Chat List/Tabs/IconContacts")
|
||||
self.tabBarItem.selectedImage = UIImage(bundleImageName: "Chat List/Tabs/IconContacts")
|
||||
|
||||
let icon: UIImage?
|
||||
if (useSpecialTabBarIcons()) {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconContactsHW")
|
||||
} else {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconContacts")
|
||||
}
|
||||
|
||||
self.tabBarItem.image = icon
|
||||
self.tabBarItem.selectedImage = icon
|
||||
|
||||
self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Back, style: .plain, target: nil, action: nil)
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationAddIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.addPressed))
|
||||
|
||||
@@ -385,9 +385,7 @@ func editSettingsController(account: Account, currentName: ItemListAvatarAndName
|
||||
actionsDisposable.dispose()
|
||||
}
|
||||
|
||||
let controller = ItemListController(account: account, state: signal, tabBarItem: (account.applicationContext as! TelegramApplicationContext).presentationData |> map { presentationData in
|
||||
return ItemListControllerTabBarItem(title: presentationData.strings.EditProfile_Title, image: PresentationResourcesRootController.tabSettingsIcon(presentationData.theme), selectedImage: PresentationResourcesRootController.tabSettingsSelectedIcon(presentationData.theme))
|
||||
})
|
||||
let controller = ItemListController(account: account, state: signal, tabBarItem: nil)
|
||||
pushControllerImpl = { [weak controller] value in
|
||||
(controller?.navigationController as? NavigationController)?.pushViewController(value)
|
||||
}
|
||||
|
||||
@@ -35,42 +35,6 @@ struct PresentationResourcesRootController {
|
||||
})
|
||||
}
|
||||
|
||||
static func tabContactsIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabContactsIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconContacts"), color: theme.rootController.tabBar.iconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func tabContactsSelectedIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabContactsSelectedIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconContacts"), color: theme.rootController.tabBar.selectedIconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func tabChatsIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabChatsIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconChats"), color: theme.rootController.tabBar.iconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func tabChatsSelectedIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabChatsSelectedIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconChats"), color: theme.rootController.tabBar.selectedIconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func tabSettingsIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabSettingsIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconSettings"), color: theme.rootController.tabBar.iconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func tabSettingsSelectedIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.rootTabSettingsSelectedIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/Tabs/IconSettings"), color: theme.rootController.tabBar.selectedIconColor)
|
||||
})
|
||||
}
|
||||
|
||||
static func navigationComposeIcon(_ theme: PresentationTheme) -> UIImage? {
|
||||
return theme.image(PresentationResourceKey.navigationComposeIcon.rawValue, { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat List/ComposeIcon"), color: theme.rootController.navigationBar.accentTextColor)
|
||||
|
||||
@@ -714,8 +714,15 @@ public func settingsController(account: Account, accountManager: AccountManager)
|
||||
actionsDisposable.dispose()
|
||||
}
|
||||
|
||||
let icon: UIImage?
|
||||
if (useSpecialTabBarIcons()) {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconSettingsHW")
|
||||
} else {
|
||||
icon = UIImage(bundleImageName: "Chat List/Tabs/IconSettings")
|
||||
}
|
||||
|
||||
let controller = ItemListController(account: account, state: signal, tabBarItem: (account.applicationContext as! TelegramApplicationContext).presentationData |> map { presentationData in
|
||||
return ItemListControllerTabBarItem(title: presentationData.strings.Settings_Title, image: PresentationResourcesRootController.tabSettingsIcon(presentationData.theme), selectedImage: PresentationResourcesRootController.tabSettingsSelectedIcon(presentationData.theme))
|
||||
return ItemListControllerTabBarItem(title: presentationData.strings.Settings_Title, image: icon, selectedImage: icon)
|
||||
})
|
||||
pushControllerImpl = { [weak controller] value in
|
||||
(controller?.navigationController as? NavigationController)?.replaceAllButRootController(value, animated: true)
|
||||
|
||||