mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 03:40:18 +00:00
no message
This commit is contained in:
parent
bb69ec2997
commit
2a432ddcf4
@ -242,7 +242,9 @@ public final class CallListController: ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func call(_ peerId: PeerId, began: (() -> Void)? = nil) {
|
private func call(_ peerId: PeerId, began: (() -> Void)? = nil) {
|
||||||
self.peerViewDisposable.set((self.account.viewTracker.peerView(peerId) |> take(1) |> deliverOnMainQueue).start(next: { [weak self] view in
|
self.peerViewDisposable.set((self.account.viewTracker.peerView(peerId)
|
||||||
|
|> take(1)
|
||||||
|
|> deliverOnMainQueue).start(next: { [weak self] view in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
guard let peer = peerViewMainPeer(view) else {
|
guard let peer = peerViewMainPeer(view) else {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -52,6 +52,8 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
|||||||
self.addSubnode(self.scrollNode)
|
self.addSubnode(self.scrollNode)
|
||||||
self.scrollNode.view.delaysContentTouches = false
|
self.scrollNode.view.delaysContentTouches = false
|
||||||
self.scrollNode.view.canCancelContentTouches = true
|
self.scrollNode.view.canCancelContentTouches = true
|
||||||
|
self.scrollNode.view.alwaysBounceHorizontal = false
|
||||||
|
self.scrollNode.view.alwaysBounceVertical = false
|
||||||
|
|
||||||
self.addSubnode(self.separatorNode)
|
self.addSubnode(self.separatorNode)
|
||||||
}
|
}
|
||||||
@ -99,7 +101,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
|||||||
|
|
||||||
let rowsHeight = verticalInset + CGFloat(markup.rows.count) * buttonHeight + CGFloat(max(0, markup.rows.count - 1)) * rowSpacing + verticalInset
|
let rowsHeight = verticalInset + CGFloat(markup.rows.count) * buttonHeight + CGFloat(max(0, markup.rows.count - 1)) * rowSpacing + verticalInset
|
||||||
if !markup.flags.contains(.fit) && rowsHeight < panelHeight {
|
if !markup.flags.contains(.fit) && rowsHeight < panelHeight {
|
||||||
buttonHeight = floor((panelHeight - verticalInset * 2.0 - CGFloat(max(0, markup.rows.count - 1)) * rowSpacing) / CGFloat(markup.rows.count))
|
buttonHeight = floor((panelHeight - bottomInset - verticalInset * 2.0 - CGFloat(max(0, markup.rows.count - 1)) * rowSpacing) / CGFloat(markup.rows.count))
|
||||||
}
|
}
|
||||||
|
|
||||||
var verticalOffset = verticalInset
|
var verticalOffset = verticalInset
|
||||||
|
|||||||
@ -498,7 +498,7 @@ public final class ChatController: TelegramController, UIViewControllerPreviewin
|
|||||||
case let .url(url):
|
case let .url(url):
|
||||||
if isGame {
|
if isGame {
|
||||||
strongSelf.chatDisplayNode.dismissInput()
|
strongSelf.chatDisplayNode.dismissInput()
|
||||||
strongSelf.present(GameController(account: strongSelf.account, url: url, message: message), in: .window(.root))
|
(strongSelf.navigationController as? NavigationController)?.pushViewController(GameController(account: strongSelf.account, url: url, message: message))
|
||||||
} else {
|
} else {
|
||||||
strongSelf.openUrl(url, concealed: false)
|
strongSelf.openUrl(url, concealed: false)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,8 +16,6 @@ final class GameController: ViewController {
|
|||||||
|
|
||||||
private var presentationData: PresentationData
|
private var presentationData: PresentationData
|
||||||
|
|
||||||
private var didPlayPresentationAnimation = false
|
|
||||||
|
|
||||||
init(account: Account, url: String, message: Message) {
|
init(account: Account, url: String, message: Message) {
|
||||||
self.account = account
|
self.account = account
|
||||||
self.url = url
|
self.url = url
|
||||||
@ -29,7 +27,6 @@ final class GameController: ViewController {
|
|||||||
|
|
||||||
self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBar.style.style
|
self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBar.style.style
|
||||||
|
|
||||||
self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Close, style: .plain, target: self, action: #selector(self.closePressed))
|
|
||||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationShareIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.sharePressed))
|
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: PresentationResourcesRootController.navigationShareIcon(self.presentationData.theme), style: .plain, target: self, action: #selector(self.sharePressed))
|
||||||
|
|
||||||
for media in message.media {
|
for media in message.media {
|
||||||
@ -75,15 +72,6 @@ final class GameController: ViewController {
|
|||||||
}, message: self.message)
|
}, message: self.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func viewDidAppear(_ animated: Bool) {
|
|
||||||
super.viewDidAppear(animated)
|
|
||||||
|
|
||||||
if !self.didPlayPresentationAnimation {
|
|
||||||
self.didPlayPresentationAnimation = true
|
|
||||||
self.controllerNode.animateIn()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override func dismiss(completion: (() -> Void)? = nil) {
|
override func dismiss(completion: (() -> Void)? = nil) {
|
||||||
self.controllerNode.animateOut(completion: { [weak self] in
|
self.controllerNode.animateOut(completion: { [weak self] in
|
||||||
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
||||||
|
|||||||
@ -61,9 +61,12 @@ final class GameControllerNode: ViewControllerTracingNode {
|
|||||||
if #available(iOSApplicationExtension 9.0, *) {
|
if #available(iOSApplicationExtension 9.0, *) {
|
||||||
webView.allowsLinkPreview = false
|
webView.allowsLinkPreview = false
|
||||||
}
|
}
|
||||||
self.webView = webView
|
webView.interactiveTransitionGestureRecognizerTest = { point -> Bool in
|
||||||
|
return point.x > 30.0
|
||||||
|
}
|
||||||
|
|
||||||
self.view.addSubview(webView)
|
self.view.addSubview(webView)
|
||||||
|
self.webView = webView
|
||||||
|
|
||||||
if let parsedUrl = URL(string: url) {
|
if let parsedUrl = URL(string: url) {
|
||||||
webView.load(URLRequest(url: parsedUrl))
|
webView.load(URLRequest(url: parsedUrl))
|
||||||
|
|||||||
@ -96,13 +96,7 @@ class ItemListTextItemNode: ListViewItemNode {
|
|||||||
let makeTitleLayout = TextNode.asyncLayout(self.titleNode)
|
let makeTitleLayout = TextNode.asyncLayout(self.titleNode)
|
||||||
|
|
||||||
return { item, params, neighbors in
|
return { item, params, neighbors in
|
||||||
var leftInset: CGFloat = 15.0 + params.leftInset
|
let leftInset: CGFloat = 15.0 + params.leftInset
|
||||||
switch item.style {
|
|
||||||
case .plain:
|
|
||||||
leftInset += 20
|
|
||||||
case .blocks:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
let verticalInset: CGFloat = 7.0
|
let verticalInset: CGFloat = 7.0
|
||||||
|
|
||||||
let attributedText: NSAttributedString
|
let attributedText: NSAttributedString
|
||||||
|
|||||||
@ -236,7 +236,7 @@ func legacyLocationController(message: Message, mapMedia: TelegramMediaMap, acco
|
|||||||
controller.onViewDidAppear = { [weak controller] in
|
controller.onViewDidAppear = { [weak controller] in
|
||||||
if let strongController = controller {
|
if let strongController = controller {
|
||||||
strongController.locationMapView.interactiveTransitionGestureRecognizerTest = { point -> Bool in
|
strongController.locationMapView.interactiveTransitionGestureRecognizerTest = { point -> Bool in
|
||||||
return point.x > 36.0
|
return point.x > 30.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -683,7 +683,9 @@ public func userInfoController(account: Account, peerId: PeerId) -> ViewControll
|
|||||||
peerView.set(account.viewTracker.peerView(peerId))
|
peerView.set(account.viewTracker.peerView(peerId))
|
||||||
|
|
||||||
let requestCallImpl: () -> Void = {
|
let requestCallImpl: () -> Void = {
|
||||||
let _ = (peerView.get() |> deliverOnMainQueue).start(next: { view in
|
let _ = (peerView.get()
|
||||||
|
|> take(1)
|
||||||
|
|> deliverOnMainQueue).start(next: { view in
|
||||||
guard let peer = peerViewMainPeer(view) else {
|
guard let peer = peerViewMainPeer(view) else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user