NY icons
Various fixes
9
Images.xcassets/Chat List/Tabs/NY/Contents.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"provides-namespace" : true
|
||||||
|
}
|
||||||
|
}
|
BIN
Images.xcassets/Chat List/Tabs/NY/IconCalls.imageset/Calls@2x.png
vendored
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
Images.xcassets/Chat List/Tabs/NY/IconCalls.imageset/Calls@3x.png
vendored
Normal file
After Width: | Height: | Size: 2.8 KiB |
22
Images.xcassets/Chat List/Tabs/NY/IconCalls.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"
|
||||||
|
}
|
||||||
|
}
|
22
Images.xcassets/Chat List/Tabs/NY/IconChats.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "Messages@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "Messages@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
BIN
Images.xcassets/Chat List/Tabs/NY/IconChats.imageset/Messages@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
Images.xcassets/Chat List/Tabs/NY/IconChats.imageset/Messages@3x.png
vendored
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
Images.xcassets/Chat List/Tabs/NY/IconContacts.imageset/Contacts@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
Images.xcassets/Chat List/Tabs/NY/IconContacts.imageset/Contacts@3x.png
vendored
Normal file
After Width: | Height: | Size: 3.3 KiB |
22
Images.xcassets/Chat List/Tabs/NY/IconContacts.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/NY/IconSettings.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/NY/IconSettings.imageset/Settings@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
Images.xcassets/Chat List/Tabs/NY/IconSettings.imageset/Settings@3x.png
vendored
Normal file
After Width: | Height: | Size: 3.4 KiB |
@ -49,7 +49,13 @@ public final class CallListController: ViewController {
|
|||||||
if case .tab = self.mode {
|
if case .tab = self.mode {
|
||||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCallIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.callPressed))
|
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationCallIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.callPressed))
|
||||||
|
|
||||||
let icon = UIImage(bundleImageName: "Chat List/Tabs/IconCalls")
|
let icon: UIImage?
|
||||||
|
if (useSpecialTabBarIcons()) {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/NY/IconCalls")
|
||||||
|
} else {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/IconCalls")
|
||||||
|
}
|
||||||
|
|
||||||
self.tabBarItem.title = self.presentationData.strings.Calls_TabTitle
|
self.tabBarItem.title = self.presentationData.strings.Calls_TabTitle
|
||||||
self.tabBarItem.image = icon
|
self.tabBarItem.image = icon
|
||||||
self.tabBarItem.selectedImage = icon
|
self.tabBarItem.selectedImage = icon
|
||||||
|
@ -4,6 +4,10 @@ import SwiftSignalKit
|
|||||||
import Display
|
import Display
|
||||||
import TelegramCore
|
import TelegramCore
|
||||||
|
|
||||||
|
public func useSpecialTabBarIcons() -> Bool {
|
||||||
|
return (Date(timeIntervalSince1970: 1545642000)...Date(timeIntervalSince1970: 1546387200)).contains(Date())
|
||||||
|
}
|
||||||
|
|
||||||
public class ChatListController: TelegramController, KeyShortcutResponder, UIViewControllerPreviewingDelegate {
|
public class ChatListController: TelegramController, KeyShortcutResponder, UIViewControllerPreviewingDelegate {
|
||||||
private var validLayout: ContainerViewLayout?
|
private var validLayout: ContainerViewLayout?
|
||||||
|
|
||||||
@ -64,7 +68,13 @@ public class ChatListController: TelegramController, KeyShortcutResponder, UIVie
|
|||||||
self.navigationItem.titleView = self.titleView
|
self.navigationItem.titleView = self.titleView
|
||||||
self.tabBarItem.title = self.presentationData.strings.DialogList_Title
|
self.tabBarItem.title = self.presentationData.strings.DialogList_Title
|
||||||
|
|
||||||
let icon = UIImage(bundleImageName: "Chat List/Tabs/IconChats")
|
let icon: UIImage?
|
||||||
|
if (useSpecialTabBarIcons()) {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/NY/IconChats")
|
||||||
|
} else {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/IconChats")
|
||||||
|
}
|
||||||
|
|
||||||
self.tabBarItem.image = icon
|
self.tabBarItem.image = icon
|
||||||
self.tabBarItem.selectedImage = icon
|
self.tabBarItem.selectedImage = icon
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ public final class DeviceAccess {
|
|||||||
public static func authorizationStatus(account: Account, subject: DeviceAccessSubject) -> Signal<AccessType, NoError> {
|
public static func authorizationStatus(account: Account, subject: DeviceAccessSubject) -> Signal<AccessType, NoError> {
|
||||||
switch subject {
|
switch subject {
|
||||||
case .notifications:
|
case .notifications:
|
||||||
let status = Signal<AccessType, NoError> { subscriber in
|
let status = (Signal<AccessType, NoError> { subscriber in
|
||||||
if #available(iOSApplicationExtension 10.0, *) {
|
if #available(iOSApplicationExtension 10.0, *) {
|
||||||
UNUserNotificationCenter.current().getNotificationSettings(completionHandler: { settings in
|
UNUserNotificationCenter.current().getNotificationSettings(completionHandler: { settings in
|
||||||
switch settings.authorizationStatus {
|
switch settings.authorizationStatus {
|
||||||
@ -107,7 +107,14 @@ public final class DeviceAccess {
|
|||||||
subscriber.putCompletion()
|
subscriber.putCompletion()
|
||||||
}
|
}
|
||||||
return EmptyDisposable
|
return EmptyDisposable
|
||||||
}
|
} |> afterNext { status in
|
||||||
|
switch status {
|
||||||
|
case .allowed, .unreachable:
|
||||||
|
DeviceAccess.notificationsPromise.set(.single(nil))
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} )
|
||||||
|> then(self.notifications
|
|> then(self.notifications
|
||||||
|> mapToSignal { authorized -> Signal<AccessType, NoError> in
|
|> mapToSignal { authorized -> Signal<AccessType, NoError> in
|
||||||
if let authorized = authorized {
|
if let authorized = authorized {
|
||||||
|
@ -1042,6 +1042,10 @@ final class ContactListNode: ASDisplayNode {
|
|||||||
itemHeaderNode.updateTheme(theme: presentationData.theme)
|
itemHeaderNode.updateTheme(theme: presentationData.theme)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if let validLayout = strongSelf.validLayout {
|
||||||
|
strongSelf.containerLayoutUpdated(validLayout, transition: .immediate)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -1136,10 +1140,8 @@ final class ContactListNode: ASDisplayNode {
|
|||||||
indexNode.update(size: indexNodeFrame.size, color: self.presentationData.theme.list.itemAccentColor, sections: indexSections, transition: transition)
|
indexNode.update(size: indexNodeFrame.size, color: self.presentationData.theme.list.itemAccentColor, sections: indexSections, transition: transition)
|
||||||
}
|
}
|
||||||
|
|
||||||
//if let authorizationNode = self.authorizationNode {
|
self.authorizationNode.updateLayout(size: layout.size, insets: insets, transition: transition)
|
||||||
authorizationNode.updateLayout(size: layout.size, insets: insets, transition: transition)
|
transition.updateFrame(node: self.authorizationNode, frame: self.bounds)
|
||||||
transition.updateFrame(node: authorizationNode, frame: self.bounds)
|
|
||||||
//}
|
|
||||||
|
|
||||||
if !hadValidLayout {
|
if !hadValidLayout {
|
||||||
self.dequeueTransitions()
|
self.dequeueTransitions()
|
||||||
|
@ -35,7 +35,13 @@ public class ContactsController: ViewController {
|
|||||||
self.title = self.presentationData.strings.Contacts_Title
|
self.title = self.presentationData.strings.Contacts_Title
|
||||||
self.tabBarItem.title = self.presentationData.strings.Contacts_Title
|
self.tabBarItem.title = self.presentationData.strings.Contacts_Title
|
||||||
|
|
||||||
let icon = UIImage(bundleImageName: "Chat List/Tabs/IconContacts")
|
let icon: UIImage?
|
||||||
|
if (useSpecialTabBarIcons()) {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/NY/IconContacts")
|
||||||
|
} else {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/IconContacts")
|
||||||
|
}
|
||||||
|
|
||||||
self.tabBarItem.image = icon
|
self.tabBarItem.image = icon
|
||||||
self.tabBarItem.selectedImage = icon
|
self.tabBarItem.selectedImage = icon
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import Foundation
|
|||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import Display
|
import Display
|
||||||
|
|
||||||
final class GalleryNavigationCheckNode: ASDisplayNode {
|
final class GalleryNavigationCheckNode: ASDisplayNode, NavigationButtonCustomDisplayNode {
|
||||||
private var checkNode: CheckNode
|
private var checkNode: CheckNode
|
||||||
|
|
||||||
init(theme: PresentationTheme) {
|
init(theme: PresentationTheme) {
|
||||||
@ -13,6 +13,10 @@ final class GalleryNavigationCheckNode: ASDisplayNode {
|
|||||||
self.addSubnode(self.checkNode)
|
self.addSubnode(self.checkNode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isHighlightable: Bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
var isChecked: Bool {
|
var isChecked: Bool {
|
||||||
return self.checkNode.isChecked
|
return self.checkNode.isChecked
|
||||||
}
|
}
|
||||||
|
@ -3,26 +3,37 @@ import AsyncDisplayKit
|
|||||||
import Display
|
import Display
|
||||||
import LegacyComponents
|
import LegacyComponents
|
||||||
|
|
||||||
final class GalleryNavigationRecipientNode: ASDisplayNode {
|
final class GalleryNavigationRecipientNode: ASDisplayNode, NavigationButtonCustomDisplayNode {
|
||||||
private var iconNode: ASImageNode
|
private var iconNode: ASImageNode
|
||||||
private var textNode: ASTextNode
|
private var textNode: ImmediateTextNode
|
||||||
|
|
||||||
init(color: UIColor, title: String) {
|
init(color: UIColor, title: String) {
|
||||||
self.iconNode = ASImageNode()
|
self.iconNode = ASImageNode()
|
||||||
self.iconNode.alpha = 0.45
|
self.iconNode.alpha = 0.45
|
||||||
self.iconNode.image = TGComponentsImageNamed("PhotoPickerArrow")
|
self.iconNode.image = TGComponentsImageNamed("PhotoPickerArrow")
|
||||||
|
|
||||||
self.textNode = ASTextNode()
|
self.textNode = ImmediateTextNode()
|
||||||
self.textNode.attributedText = NSAttributedString(string: title, font: Font.bold(13.0), textColor: UIColor(rgb: 0xffffff, alpha: 0.45))
|
self.textNode.attributedText = NSAttributedString(string: title, font: Font.bold(13.0), textColor: UIColor(rgb: 0xffffff, alpha: 0.45))
|
||||||
|
self.textNode.maximumNumberOfLines = 1
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
self.addSubnode(self.iconNode)
|
self.addSubnode(self.iconNode)
|
||||||
self.addSubnode(self.textNode)
|
self.addSubnode(self.textNode)
|
||||||
|
|
||||||
|
if title.isEmpty {
|
||||||
|
self.iconNode.isHidden = true
|
||||||
|
self.textNode.isHidden = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var isHighlightable: Bool {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
override func calculateSizeThatFits(_ constrainedSize: CGSize) -> CGSize {
|
||||||
return CGSize(width: 30.0, height: 30.0)
|
let textSize = self.textNode.updateLayout(CGSize(width: constrainedSize.width - 50.0, height: constrainedSize.height))
|
||||||
|
return CGSize(width: textSize.width + 12.0, height: 30.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func layout() {
|
override func layout() {
|
||||||
@ -32,6 +43,6 @@ final class GalleryNavigationRecipientNode: ASDisplayNode {
|
|||||||
self.iconNode.frame = CGRect(origin: CGPoint(x: -2.0, y: 9.0), size: image.size)
|
self.iconNode.frame = CGRect(origin: CGPoint(x: -2.0, y: 9.0), size: image.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
self.textNode.frame = CGRect(x: self.iconNode.frame.maxX + 6.0, y: 7.0, width: 150.0, height: 20.0)
|
self.textNode.frame = CGRect(x: self.iconNode.frame.maxX + 6.0, y: 7.0, width: self.frame.size.width - 12.0, height: 15.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ func presentLegacyWebSearchEditor(account: Account, theme: PresentationTheme, re
|
|||||||
let legacyController = LegacyController(presentation: .custom, theme: theme, initialLayout: initialLayout)
|
let legacyController = LegacyController(presentation: .custom, theme: theme, initialLayout: initialLayout)
|
||||||
legacyController.statusBar.statusBarStyle = theme.rootController.statusBar.style.style
|
legacyController.statusBar.statusBarStyle = theme.rootController.statusBar.style.style
|
||||||
|
|
||||||
let controller = TGPhotoEditorController(context: legacyController.context, item: item, intent: TGPhotoEditorControllerAvatarIntent, adjustments: nil, caption: nil, screenImage: screenImage, availableTabs: TGPhotoEditorController.defaultTabsForAvatarIntent(), selectedTab: .cropTab)!
|
let controller = TGPhotoEditorController(context: legacyController.context, item: item, intent: TGPhotoEditorControllerAvatarIntent, adjustments: nil, caption: nil, screenImage: screenImage ?? UIImage(), availableTabs: TGPhotoEditorController.defaultTabsForAvatarIntent(), selectedTab: .cropTab)!
|
||||||
legacyController.bind(controller: controller)
|
legacyController.bind(controller: controller)
|
||||||
|
|
||||||
controller.editingContext = TGMediaEditingContext()
|
controller.editingContext = TGMediaEditingContext()
|
||||||
|
@ -169,9 +169,6 @@ private final class LiveLocationPeerSummaryContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let accountPeer = accountPeer, strongSelf.isActive {
|
|
||||||
//peers.append(accountPeer)
|
|
||||||
}
|
|
||||||
if peersAndMessages.isEmpty {
|
if peersAndMessages.isEmpty {
|
||||||
strongSelf.peersAndMessages = nil
|
strongSelf.peersAndMessages = nil
|
||||||
} else {
|
} else {
|
||||||
|
@ -234,7 +234,7 @@ final class OngoingCallContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func start(key: Data, isOutgoing: Bool, connections: CallSessionConnectionSet, maxLayer: Int32, allowP2P: Bool, audioSessionActive: Signal<Bool, NoError>, logName: String) {
|
func start(key: Data, isOutgoing: Bool, connections: CallSessionConnectionSet, maxLayer: Int32, allowP2P: Bool, audioSessionActive: Signal<Bool, NoError>, logName: String) {
|
||||||
var logPath = logName.isEmpty ? "" : callLogsPath(account: self.account) + "/" + logName + ".log"
|
let logPath = logName.isEmpty ? "" : callLogsPath(account: self.account) + "/" + logName + ".log"
|
||||||
self.audioSessionDisposable.set((audioSessionActive
|
self.audioSessionDisposable.set((audioSessionActive
|
||||||
|> filter { $0 }
|
|> filter { $0 }
|
||||||
|> take(1)).start(next: { [weak self] _ in
|
|> take(1)).start(next: { [weak self] _ in
|
||||||
|
@ -79,7 +79,7 @@ final class PermissionContentNode: ASDisplayNode {
|
|||||||
func updateLayout(size: CGSize, insets: UIEdgeInsets, transition: ContainedViewLayoutTransition) {
|
func updateLayout(size: CGSize, insets: UIEdgeInsets, transition: ContainedViewLayoutTransition) {
|
||||||
let sidePadding: CGFloat
|
let sidePadding: CGFloat
|
||||||
let fontSize: CGFloat
|
let fontSize: CGFloat
|
||||||
if size.width > 330.0 {
|
if min(size.width, size.height) > 330.0 {
|
||||||
fontSize = 24.0
|
fontSize = 24.0
|
||||||
sidePadding = 38.0
|
sidePadding = 38.0
|
||||||
} else {
|
} else {
|
||||||
@ -91,28 +91,32 @@ final class PermissionContentNode: ASDisplayNode {
|
|||||||
|
|
||||||
let titleSize = self.titleNode.updateLayout(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
||||||
let textSize = self.textNode.updateLayout(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
let textSize = self.textNode.updateLayout(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
||||||
let buttonHeight = self.actionButton.updateLayout(width: size.width, transition: transition)
|
let buttonWidth = min(size.width, size.height)
|
||||||
|
let buttonHeight = self.actionButton.updateLayout(width: buttonWidth, transition: transition)
|
||||||
let privacyButtonSize = self.privacyPolicyButton.measure(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
let privacyButtonSize = self.privacyPolicyButton.measure(CGSize(width: size.width - sidePadding * 2.0, height: .greatestFiniteMagnitude))
|
||||||
|
|
||||||
let titleSubtitleSpacing: CGFloat = 26.0
|
let availableHeight = floor(size.height - insets.top - insets.bottom - titleSize.height - textSize.height - buttonHeight)
|
||||||
let buttonSpacing: CGFloat = 36.0
|
|
||||||
let privacySpacing: CGFloat = 45.0
|
let titleSubtitleSpacing: CGFloat = max(15.0, floor(availableHeight * 0.055))
|
||||||
|
let buttonSpacing: CGFloat = max(19.0, floor(availableHeight * 0.075))
|
||||||
var contentHeight = titleSize.height + titleSubtitleSpacing + textSize.height + buttonHeight + buttonSpacing
|
var contentHeight = titleSize.height + titleSubtitleSpacing + textSize.height + buttonHeight + buttonSpacing
|
||||||
|
|
||||||
var imageSize = CGSize()
|
var imageSize = CGSize()
|
||||||
var imageSpacing: CGFloat = 0.0
|
var imageSpacing: CGFloat = 0.0
|
||||||
if let icon = self.iconNode.image {
|
if let icon = self.iconNode.image, size.width < size.height {
|
||||||
imageSpacing = 60.0
|
imageSpacing = floor(availableHeight * 0.12)
|
||||||
imageSize = icon.size
|
imageSize = icon.size
|
||||||
contentHeight += imageSize.height + imageSpacing
|
contentHeight += imageSize.height + imageSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let privacySpacing: CGFloat = max(30.0 + privacyButtonSize.height, (availableHeight - titleSubtitleSpacing - buttonSpacing - imageSize.height - imageSpacing) / 2.0)
|
||||||
|
|
||||||
let contentOrigin = insets.top + floor((size.height - insets.top - insets.bottom - contentHeight) / 2.0)
|
let contentOrigin = insets.top + floor((size.height - insets.top - insets.bottom - contentHeight) / 2.0)
|
||||||
let iconFrame = CGRect(origin: CGPoint(x: floor((size.width - imageSize.width) / 2.0), y: contentOrigin), size: imageSize)
|
let iconFrame = CGRect(origin: CGPoint(x: floor((size.width - imageSize.width) / 2.0), y: contentOrigin), size: imageSize)
|
||||||
let titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) / 2.0), y: iconFrame.maxY + imageSpacing), size: titleSize)
|
let titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) / 2.0), y: iconFrame.maxY + imageSpacing), size: titleSize)
|
||||||
let textFrame = CGRect(origin: CGPoint(x: floor((size.width - textSize.width) / 2.0), y: titleFrame.maxY + titleSubtitleSpacing), size: textSize)
|
let textFrame = CGRect(origin: CGPoint(x: floor((size.width - textSize.width) / 2.0), y: titleFrame.maxY + titleSubtitleSpacing), size: textSize)
|
||||||
let buttonFrame = CGRect(origin: CGPoint(x: 0.0, y: textFrame.maxY + buttonSpacing), size: CGSize(width: size.width, height: buttonHeight))
|
let buttonFrame = CGRect(origin: CGPoint(x: floor((size.width - buttonWidth) / 2.0), y: textFrame.maxY + buttonSpacing), size: CGSize(width: buttonWidth, height: buttonHeight))
|
||||||
let privacyButtonFrame = CGRect(origin: CGPoint(x: floor((size.width - privacyButtonSize.width) / 2.0), y: buttonFrame.maxY + privacySpacing), size: privacyButtonSize)
|
let privacyButtonFrame = CGRect(origin: CGPoint(x: floor((size.width - privacyButtonSize.width) / 2.0), y: buttonFrame.maxY + floor((privacySpacing - privacyButtonSize.height) / 2.0)), size: privacyButtonSize)
|
||||||
|
|
||||||
|
|
||||||
transition.updateFrame(node: self.iconNode, frame: iconFrame)
|
transition.updateFrame(node: self.iconNode, frame: iconFrame)
|
||||||
|
@ -777,7 +777,12 @@ public func settingsController(account: Account, accountManager: AccountManager)
|
|||||||
actionsDisposable.dispose()
|
actionsDisposable.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
let icon = UIImage(bundleImageName: "Chat List/Tabs/IconSettings")
|
let icon: UIImage?
|
||||||
|
if (useSpecialTabBarIcons()) {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/NY/IconSettings")
|
||||||
|
} else {
|
||||||
|
icon = UIImage(bundleImageName: "Chat List/Tabs/IconSettings")
|
||||||
|
}
|
||||||
|
|
||||||
let controller = ItemListController(account: account, state: signal, tabBarItem: combineLatest((account.applicationContext as! TelegramApplicationContext).presentationData, notificationsAuthorizationStatus.get(), notificationsWarningSuppressed.get()) |> map { presentationData, notificationsAuthorizationStatus, notificationsWarningSuppressed in
|
let controller = ItemListController(account: account, state: signal, tabBarItem: combineLatest((account.applicationContext as! TelegramApplicationContext).presentationData, notificationsAuthorizationStatus.get(), notificationsWarningSuppressed.get()) |> map { presentationData, notificationsAuthorizationStatus, notificationsWarningSuppressed in
|
||||||
let notificationsWarning = shouldDisplayNotificationsPermissionWarning(status: notificationsAuthorizationStatus, suppressed: notificationsWarningSuppressed)
|
let notificationsWarning = shouldDisplayNotificationsPermissionWarning(status: notificationsAuthorizationStatus, suppressed: notificationsWarningSuppressed)
|
||||||
|
@ -154,9 +154,17 @@ public class TelegramController: ViewController {
|
|||||||
switch locationBroadcastPanelSource {
|
switch locationBroadcastPanelSource {
|
||||||
case let .peer(peerId):
|
case let .peer(peerId):
|
||||||
self.locationBroadcastMode = .peer
|
self.locationBroadcastMode = .peer
|
||||||
signal = liveLocationManager.summaryManager.peersBroadcastingTo(peerId: peerId)
|
signal = combineLatest(liveLocationManager.summaryManager.peersBroadcastingTo(peerId: peerId), liveLocationManager.summaryManager.broadcastingToMessages())
|
||||||
|> map { peersAndMessages in
|
|> map { peersAndMessages, outgoingMessages in
|
||||||
let peers = peersAndMessages?.map { $0.0 }
|
var peers = peersAndMessages?.map { $0.0 }
|
||||||
|
for message in outgoingMessages.values {
|
||||||
|
if message.id.peerId == peerId, let author = message.author {
|
||||||
|
if peers == nil {
|
||||||
|
peers = []
|
||||||
|
}
|
||||||
|
peers?.append(author)
|
||||||
|
}
|
||||||
|
}
|
||||||
return (peers, nil)
|
return (peers, nil)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -55,6 +55,8 @@ final class WebSearchGalleryControllerPresentationArguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class WebSearchGalleryController: ViewController {
|
class WebSearchGalleryController: ViewController {
|
||||||
|
private static let navigationTheme = NavigationBarTheme(buttonColor: .white, disabledButtonColor: UIColor(rgb: 0x525252), primaryTextColor: .white, backgroundColor: .clear, separatorColor: .clear, badgeBackgroundColor: .clear, badgeStrokeColor: .clear, badgeTextColor: .clear)
|
||||||
|
|
||||||
private var galleryNode: GalleryControllerNode {
|
private var galleryNode: GalleryControllerNode {
|
||||||
return self.displayNode as! GalleryControllerNode
|
return self.displayNode as! GalleryControllerNode
|
||||||
}
|
}
|
||||||
@ -98,7 +100,7 @@ class WebSearchGalleryController: ViewController {
|
|||||||
|
|
||||||
self.presentationData = account.telegramApplicationContext.currentPresentationData.with { $0 }
|
self.presentationData = account.telegramApplicationContext.currentPresentationData.with { $0 }
|
||||||
|
|
||||||
super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: GalleryController.darkNavigationTheme, strings: NavigationBarStrings(presentationStrings: self.presentationData.strings)))
|
super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: WebSearchGalleryController.navigationTheme, strings: NavigationBarStrings(presentationStrings: self.presentationData.strings)))
|
||||||
|
|
||||||
self.controllerInteraction = WebSearchGalleryControllerInteraction(dismiss: { [weak self] animated in
|
self.controllerInteraction = WebSearchGalleryControllerInteraction(dismiss: { [weak self] animated in
|
||||||
self?.dismiss(forceAway: false)
|
self?.dismiss(forceAway: false)
|
||||||
|