mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 08:49:47 +00:00
Update to iOS 13
This commit is contained in:
parent
5200c378c6
commit
c7a2fe5d3e
@ -138,7 +138,7 @@ genrule(
|
||||
],
|
||||
)
|
||||
|
||||
minimum_os_version = "12.0"
|
||||
minimum_os_version = "13.0"
|
||||
|
||||
notificationServiceExtensionVersion = "v1"
|
||||
|
||||
@ -1630,7 +1630,7 @@ plist_fragment(
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<true/>
|
||||
<key>UIViewEdgeAntialiasing</key>
|
||||
<false/>
|
||||
<key>UIViewGroupOpacity</key>
|
||||
|
||||
@ -70,9 +70,8 @@ class IntentHandler: INExtension {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOSApplicationExtension 10.0, iOS 10.0, *)
|
||||
@objc(IntentHandler)
|
||||
class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessagesIntentHandling, INSetMessageAttributeIntentHandling, INStartAudioCallIntentHandling, INSearchCallHistoryIntentHandling {
|
||||
class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessagesIntentHandling, INSetMessageAttributeIntentHandling, INStartCallIntentHandling, INSearchCallHistoryIntentHandling {
|
||||
private let accountPromise = Promise<Account?>()
|
||||
private let allAccounts = Promise<[(AccountRecordId, PeerId, Bool)]>()
|
||||
|
||||
@ -234,16 +233,31 @@ class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchFo
|
||||
|
||||
var personResolutionResult: INPersonResolutionResult {
|
||||
switch self {
|
||||
case let .success(person):
|
||||
return .success(with: person)
|
||||
case let .disambiguation(persons):
|
||||
return .disambiguation(with: persons)
|
||||
case .needsValue:
|
||||
return .needsValue()
|
||||
case .noResult:
|
||||
return .unsupported()
|
||||
case .skip:
|
||||
return .notRequired()
|
||||
case let .success(person):
|
||||
return .success(with: person)
|
||||
case let .disambiguation(persons):
|
||||
return .disambiguation(with: persons)
|
||||
case .needsValue:
|
||||
return .needsValue()
|
||||
case .noResult:
|
||||
return .unsupported()
|
||||
case .skip:
|
||||
return .notRequired()
|
||||
}
|
||||
}
|
||||
|
||||
var contactResolutionResult: INStartCallContactResolutionResult {
|
||||
switch self {
|
||||
case let .success(person):
|
||||
return .success(with: person)
|
||||
case let .disambiguation(persons):
|
||||
return .disambiguation(with: persons)
|
||||
case .needsValue:
|
||||
return .needsValue()
|
||||
case .noResult:
|
||||
return .unsupported()
|
||||
case .skip:
|
||||
return .notRequired()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -644,36 +658,34 @@ class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchFo
|
||||
}
|
||||
|
||||
// MARK: - INStartAudioCallIntentHandling
|
||||
|
||||
public func resolveContacts(for intent: INStartAudioCallIntent, with completion: @escaping ([INPersonResolutionResult]) -> Void) {
|
||||
public func resolveContacts(for intent: INStartCallIntent, with completion: @escaping ([INStartCallContactResolutionResult]) -> Void) {
|
||||
if let appGroupUrl = self.appGroupUrl {
|
||||
let rootPath = rootPathForBasePath(appGroupUrl.path)
|
||||
if let data = try? Data(contentsOf: URL(fileURLWithPath: appLockStatePath(rootPath: rootPath))), let state = try? JSONDecoder().decode(LockState.self, from: data), isAppLocked(state: state) {
|
||||
completion([INPersonResolutionResult.notRequired()])
|
||||
completion([INStartCallContactResolutionResult.notRequired()])
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
guard CNContactStore.authorizationStatus(for: .contacts) == .authorized else {
|
||||
completion([INPersonResolutionResult.notRequired()])
|
||||
completion([INStartCallContactResolutionResult.notRequired()])
|
||||
return
|
||||
}
|
||||
self.resolve(persons: intent.contacts, with: { result in
|
||||
completion(result.map { $0.personResolutionResult })
|
||||
completion(result.map { $0.contactResolutionResult })
|
||||
})
|
||||
}
|
||||
|
||||
@available(iOSApplicationExtension 11.0, iOS 11.0, *)
|
||||
public func resolveDestinationType(for intent: INStartAudioCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) {
|
||||
public func resolveDestinationType(for intent: INStartCallIntent, with completion: @escaping (INCallDestinationTypeResolutionResult) -> Void) {
|
||||
completion(.success(with: .normal))
|
||||
}
|
||||
|
||||
public func handle(intent: INStartAudioCallIntent, completion: @escaping (INStartAudioCallIntentResponse) -> Void) {
|
||||
public func handle(intent: INStartCallIntent, completion: @escaping (INStartCallIntentResponse) -> Void) {
|
||||
if let appGroupUrl = self.appGroupUrl {
|
||||
let rootPath = rootPathForBasePath(appGroupUrl.path)
|
||||
if let data = try? Data(contentsOf: URL(fileURLWithPath: appLockStatePath(rootPath: rootPath))), let state = try? JSONDecoder().decode(LockState.self, from: data), isAppLocked(state: state) {
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartAudioCallIntent.self))
|
||||
let response = INStartAudioCallIntentResponse(code: .failureRequiringAppLaunch, userActivity: userActivity)
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartCallIntent.self))
|
||||
let response = INStartCallIntentResponse(code: .failureRequiringAppLaunch, userActivity: userActivity)
|
||||
completion(response)
|
||||
return
|
||||
}
|
||||
@ -699,13 +711,13 @@ class DefaultIntentHandler: INExtension, INSendMessageIntentHandling, INSearchFo
|
||||
return .single(peerId)
|
||||
}
|
||||
|> deliverOnMainQueue).start(next: { peerId in
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartAudioCallIntent.self))
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartCallIntent.self))
|
||||
userActivity.userInfo = ["handle": "TGCA\(peerId.toInt64())"]
|
||||
let response = INStartAudioCallIntentResponse(code: .continueInApp, userActivity: userActivity)
|
||||
let response = INStartCallIntentResponse(code: .continueInApp, userActivity: userActivity)
|
||||
completion(response)
|
||||
}, error: { _ in
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartAudioCallIntent.self))
|
||||
let response = INStartAudioCallIntentResponse(code: .failureRequiringAppLaunch, userActivity: userActivity)
|
||||
let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartCallIntent.self))
|
||||
let response = INStartCallIntentResponse(code: .failureRequiringAppLaunch, userActivity: userActivity)
|
||||
completion(response)
|
||||
}))
|
||||
}
|
||||
|
||||
@ -14438,3 +14438,7 @@ Sorry for the inconvenience.";
|
||||
|
||||
"Stars.Transaction.GiftTransfer" = "Gift Transfer";
|
||||
"Stars.Intro.Transaction.GiftTransfer" = "Gift Transfer";
|
||||
|
||||
"SuggestPost.SetTimeFormat.Date" = "%@";
|
||||
"SuggestPost.SetTimeFormat.TodayAt" = "Today at %@";
|
||||
"SuggestPost.SetTimeFormat.TomorrowAt" = "Tomorrow at %@";
|
||||
|
||||
@ -117,10 +117,10 @@ public final class ActivityIndicator: ASDisplayNode {
|
||||
let indicatorView: UIActivityIndicatorView
|
||||
switch self.type {
|
||||
case let .navigationAccent(color):
|
||||
indicatorView = UIActivityIndicatorView(style: .whiteLarge)
|
||||
indicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.large)
|
||||
indicatorView.color = color
|
||||
case let .custom(color, diameter, _, forceCustom):
|
||||
indicatorView = UIActivityIndicatorView(style: diameter < 15.0 ? .white : .whiteLarge)
|
||||
indicatorView = UIActivityIndicatorView(style: diameter < 15.0 ? UIActivityIndicatorView.Style.medium : UIActivityIndicatorView.Style.large)
|
||||
indicatorView.color = convertIndicatorColor(color)
|
||||
if !forceCustom {
|
||||
self.view.addSubview(indicatorView)
|
||||
|
||||
@ -502,8 +502,8 @@ final class BotCheckoutNativeCardEntryControllerNode: ViewControllerTracingNode,
|
||||
if self.scrollNode.view.contentInset != insets {
|
||||
self.scrollNode.view.contentInset = insets
|
||||
}
|
||||
if self.scrollNode.view.scrollIndicatorInsets != insets {
|
||||
self.scrollNode.view.scrollIndicatorInsets = insets
|
||||
if self.scrollNode.view.verticalScrollIndicatorInsets != insets {
|
||||
self.scrollNode.view.verticalScrollIndicatorInsets = insets
|
||||
}
|
||||
self.scrollNode.view.ignoreUpdateBounds = false
|
||||
|
||||
|
||||
@ -279,7 +279,7 @@ final class BrowserDocumentContent: UIView, BrowserContent, WKNavigationDelegate
|
||||
self.webView.reloadInputViews()
|
||||
}
|
||||
|
||||
self.webView.scrollView.scrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
self.webView.scrollView.verticalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
self.webView.scrollView.horizontalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
}
|
||||
|
||||
|
||||
@ -648,7 +648,7 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
|
||||
} else {
|
||||
self.webView.customBottomInset = safeInsets.bottom * (1.0 - insets.bottom / fullInsets.bottom)
|
||||
}
|
||||
// self.webView.scrollView.scrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
// self.webView.scrollView.verticalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
// self.webView.scrollView.horizontalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: -insets.left, bottom: 0.0, right: -insets.right)
|
||||
|
||||
if let error = self.currentError {
|
||||
|
||||
@ -1609,7 +1609,7 @@ public final class CalendarMessageScreen: ViewController {
|
||||
self.contextGestureContainerNode.frame = CGRect(origin: CGPoint(x: 0.0, y: navigationHeight), size: CGSize(width: layout.size.width, height: layout.size.height - navigationHeight))
|
||||
self.scrollView.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: layout.size.width, height: layout.size.height - navigationHeight))
|
||||
self.scrollView.contentSize = CGSize(width: layout.size.width, height: contentHeight)
|
||||
self.scrollView.scrollIndicatorInsets = UIEdgeInsets(top: max(layout.intrinsicInsets.bottom, self.scrollView.contentInset.top), left: 0.0, bottom: 0.0, right: layout.size.width - 3.0 - 6.0)
|
||||
self.scrollView.verticalScrollIndicatorInsets = UIEdgeInsets(top: max(layout.intrinsicInsets.bottom, self.scrollView.contentInset.top), left: 0.0, bottom: 0.0, right: layout.size.width - 3.0 - 6.0)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ public final class ActivityIndicatorComponent: Component {
|
||||
|
||||
public final class View: UIActivityIndicatorView {
|
||||
public init() {
|
||||
super.init(style: .whiteLarge)
|
||||
super.init(style: UIActivityIndicatorView.Style.large)
|
||||
}
|
||||
|
||||
required public init(coder: NSCoder) {
|
||||
|
||||
@ -1441,8 +1441,8 @@ final class ComposePollScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: environment.safeInsets.bottom, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if let recenterOnTag {
|
||||
|
||||
@ -217,8 +217,6 @@ private final class InnerActionsContainerNode: ASDisplayNode {
|
||||
} else {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .systemMaterialLight))
|
||||
}
|
||||
} else if #available(iOS 10.0, *) {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
|
||||
} else {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
||||
}
|
||||
@ -572,8 +570,6 @@ final class InnerTextSelectionTipContainerNode: ASDisplayNode {
|
||||
} else {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .systemMaterialLight))
|
||||
}
|
||||
} else if #available(iOS 10.0, *) {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .regular))
|
||||
} else {
|
||||
effectView = UIVisualEffectView(effect: UIBlurEffect(style: .light))
|
||||
}
|
||||
|
||||
@ -74,6 +74,7 @@ public func childWindowHostView(parent: UIView) -> WindowHostView {
|
||||
}, updateSupportedInterfaceOrientations: { orientations in
|
||||
}, updateDeferScreenEdgeGestures: { edges in
|
||||
}, updatePrefersOnScreenNavigationHidden: { value in
|
||||
}, updateStatusBar: { _, _, _ in
|
||||
})
|
||||
|
||||
view.updateSize = { [weak hostView] size in
|
||||
|
||||
@ -906,9 +906,9 @@ open class GridNode: GridNodeScroller, ASScrollViewDelegate {
|
||||
let layoutInsets = presentationLayoutTransition.layout.layout.insets
|
||||
self.scrollView.contentInset = UIEdgeInsets(top: layoutInsets.top, left: 0.0, bottom: layoutInsets.bottom, right: 0.0)
|
||||
if let scrollIndicatorInsets = presentationLayoutTransition.layout.layout.scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollIndicatorInsets
|
||||
} else {
|
||||
self.scrollView.scrollIndicatorInsets = presentationLayoutTransition.layout.layout.insets
|
||||
self.scrollView.verticalScrollIndicatorInsets = presentationLayoutTransition.layout.layout.insets
|
||||
}
|
||||
var boundsOffset: CGFloat = 0.0
|
||||
var shouldAnimateBounds = false
|
||||
|
||||
@ -25,7 +25,8 @@ public struct KeyShortcut: Hashable {
|
||||
|
||||
extension KeyShortcut {
|
||||
var uiKeyCommand: UIKeyCommand {
|
||||
let command = UIKeyCommand(input: self.input, modifierFlags: self.modifiers, action: #selector(KeyShortcutsController.handleKeyCommand(_:)), discoverabilityTitle: self.title)
|
||||
let command = UIKeyCommand(input: self.input, modifierFlags: self.modifiers, action: #selector(KeyShortcutsController.handleKeyCommand(_:)))
|
||||
command.discoverabilityTitle = self.title
|
||||
if #available(iOS 15.0, *), ["\t", UIKeyCommand.inputUpArrow, UIKeyCommand.inputDownArrow, UIKeyCommand.inputLeftArrow, UIKeyCommand.inputRightArrow].contains(command.input) && self.modifiers.isEmpty {
|
||||
command.wantsPriorityOverSystemBehavior = true
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ private final class WindowRootViewControllerView: UIView {
|
||||
}
|
||||
}
|
||||
|
||||
private final class WindowRootViewController: UIViewController, UIViewControllerPreviewingDelegate {
|
||||
private final class WindowRootViewController: UIViewController {
|
||||
private var voiceOverStatusObserver: AnyObject?
|
||||
private var registeredForPreviewing = false
|
||||
|
||||
@ -135,23 +135,44 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
||||
var prefersOnScreenNavigationHidden: Bool = false {
|
||||
didSet {
|
||||
if oldValue != self.prefersOnScreenNavigationHidden {
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
self.setNeedsUpdateOfHomeIndicatorAutoHidden()
|
||||
self.setNeedsUpdateOfHomeIndicatorAutoHidden()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var statusBarStyle: UIStatusBarStyle = .default
|
||||
private var isStatusBarHidden: Bool = false
|
||||
|
||||
func updateStatusBar(style: UIStatusBarStyle, isHidden: Bool, transition: ContainedViewLayoutTransition) {
|
||||
if self.statusBarStyle != style || self.isStatusBarHidden != isHidden {
|
||||
self.statusBarStyle = style
|
||||
self.isStatusBarHidden = isHidden
|
||||
|
||||
switch transition {
|
||||
case .immediate:
|
||||
self.setNeedsStatusBarAppearanceUpdate()
|
||||
case .animated:
|
||||
transition.animateView {
|
||||
self.setNeedsStatusBarAppearanceUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override var preferredStatusBarStyle: UIStatusBarStyle {
|
||||
return .default
|
||||
return self.statusBarStyle
|
||||
}
|
||||
|
||||
override var prefersStatusBarHidden: Bool {
|
||||
return false
|
||||
return self.isStatusBarHidden
|
||||
}
|
||||
|
||||
override var preferredStatusBarUpdateAnimation: UIStatusBarAnimation {
|
||||
return .fade
|
||||
}
|
||||
|
||||
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
||||
return orientations
|
||||
return self.orientations
|
||||
}
|
||||
|
||||
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
@ -165,13 +186,8 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
||||
|
||||
self.extendedLayoutIncludesOpaqueBars = true
|
||||
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
self.voiceOverStatusObserver = NotificationCenter.default.addObserver(forName: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil, queue: OperationQueue.main, using: { [weak self] _ in
|
||||
if let strongSelf = self {
|
||||
strongSelf.updatePreviewingRegistration()
|
||||
}
|
||||
})
|
||||
}
|
||||
self.voiceOverStatusObserver = NotificationCenter.default.addObserver(forName: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil, queue: OperationQueue.main, using: { _ in
|
||||
})
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
self._systemUserInterfaceStyle.set(WindowUserInterfaceStyle(style: self.traitCollection.userInterfaceStyle))
|
||||
@ -211,43 +227,6 @@ private final class WindowRootViewController: UIViewController, UIViewController
|
||||
self.view = WindowRootViewControllerView()
|
||||
self.view.isOpaque = false
|
||||
self.view.backgroundColor = nil
|
||||
|
||||
self.updatePreviewingRegistration()
|
||||
}
|
||||
|
||||
private var previewingContext: AnyObject?
|
||||
|
||||
private func updatePreviewingRegistration() {
|
||||
}
|
||||
|
||||
private weak var previousPreviewingHostView: (UIView & PreviewingHostView)?
|
||||
|
||||
public func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? {
|
||||
if UIAccessibility.isVoiceOverRunning {
|
||||
return nil
|
||||
}
|
||||
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
|
||||
guard let result = self.view.hitTest(location, with: nil) else {
|
||||
return nil
|
||||
}
|
||||
if let (result, resultPoint) = tracePreviewingHostView(view: result, point: self.view.convert(location, to: result)), let delegate = result.previewingDelegate {
|
||||
self.previousPreviewingHostView = result
|
||||
if let (controller, rect) = delegate.controllerForLocation(previewingContext.sourceView, resultPoint) {
|
||||
previewingContext.sourceRect = rect
|
||||
return controller
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
public func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) {
|
||||
if #available(iOSApplicationExtension 9.0, iOS 9.0, *) {
|
||||
if let previousPreviewingHostView = self.previousPreviewingHostView, let delegate = previousPreviewingHostView.previewingDelegate {
|
||||
delegate.commitController(viewControllerToCommit)
|
||||
}
|
||||
self.previousPreviewingHostView = nil
|
||||
}
|
||||
}
|
||||
|
||||
override public func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) {
|
||||
@ -410,6 +389,9 @@ public func nativeWindowHostView() -> (UIWindow & WindowHost, WindowHostView) {
|
||||
},
|
||||
updatePrefersOnScreenNavigationHidden: { value in
|
||||
rootViewController.prefersOnScreenNavigationHidden = value
|
||||
},
|
||||
updateStatusBar: { statusBarStyle, isStatusBarHidden, transition in
|
||||
rootViewController.updateStatusBar(style: statusBarStyle, isHidden: isStatusBarHidden, transition: transition)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@ -276,6 +276,25 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
|
||||
var updateSupportedOrientations: (() -> Void)?
|
||||
|
||||
var statusBar: (style: UIStatusBarStyle, isHidden: Bool) {
|
||||
let normalStatusBarStyle: UIStatusBarStyle
|
||||
switch self.validStatusBarStyle {
|
||||
case .none:
|
||||
normalStatusBarStyle = .default
|
||||
case .black:
|
||||
if #available(iOS 13.0, *) {
|
||||
normalStatusBarStyle = .darkContent
|
||||
} else {
|
||||
normalStatusBarStyle = .default
|
||||
}
|
||||
case .white:
|
||||
normalStatusBarStyle = .lightContent
|
||||
}
|
||||
|
||||
return (normalStatusBarStyle, self.validStatusBarHidden ?? false)
|
||||
}
|
||||
var updateStatusBar: ((ContainedViewLayoutTransition) -> Void)?
|
||||
|
||||
public func updateMasterDetailsBlackout(_ blackout: MasterDetailLayoutBlackout?, transition: ContainedViewLayoutTransition) {
|
||||
self.masterDetailsBlackout = blackout
|
||||
if isViewLoaded {
|
||||
@ -1247,25 +1266,15 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
resolvedStatusBarStyle = .white
|
||||
}
|
||||
|
||||
if self.validStatusBarStyle != resolvedStatusBarStyle {
|
||||
if self.validStatusBarStyle != resolvedStatusBarStyle || self.validStatusBarHidden != statusBarHidden {
|
||||
self.validStatusBarStyle = resolvedStatusBarStyle
|
||||
let normalStatusBarStyle: UIStatusBarStyle
|
||||
switch resolvedStatusBarStyle {
|
||||
case .black:
|
||||
if #available(iOS 13.0, *) {
|
||||
normalStatusBarStyle = .darkContent
|
||||
} else {
|
||||
normalStatusBarStyle = .default
|
||||
}
|
||||
case .white:
|
||||
normalStatusBarStyle = .lightContent
|
||||
}
|
||||
self.statusBarHost?.setStatusBarStyle(normalStatusBarStyle, animated: animateStatusBarStyleTransition)
|
||||
}
|
||||
|
||||
if self.validStatusBarHidden != statusBarHidden {
|
||||
self.validStatusBarHidden = statusBarHidden
|
||||
self.statusBarHost?.setStatusBarHidden(statusBarHidden, animated: animateStatusBarStyleTransition)
|
||||
|
||||
var statusBarTransition = transition
|
||||
if animateStatusBarStyleTransition && !statusBarTransition.isAnimated {
|
||||
statusBarTransition = .animated(duration: 0.2, curve: .easeInOut)
|
||||
}
|
||||
self.updateStatusBar?(statusBarTransition)
|
||||
}
|
||||
|
||||
var topHasOpaque = false
|
||||
|
||||
@ -46,6 +46,29 @@ public final class PresentationContext {
|
||||
}
|
||||
}
|
||||
|
||||
var statusBar: (style: UIStatusBarStyle, isHidden: Bool)? {
|
||||
for (controller, _) in self.controllers.reversed() {
|
||||
if let controller = controller as? ViewController {
|
||||
if controller.statusBar.statusBarStyle != .Ignore {
|
||||
var style: UIStatusBarStyle = .default
|
||||
var isHidden: Bool = false
|
||||
switch controller.statusBar.statusBarStyle {
|
||||
case .White:
|
||||
style = .lightContent
|
||||
case .Black:
|
||||
style = .darkContent
|
||||
case .Ignore, .Hide:
|
||||
style = .darkContent
|
||||
isHidden = true
|
||||
}
|
||||
return (style, isHidden)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
var updateStatusBar: ((ContainedViewLayoutTransition) -> Void)?
|
||||
|
||||
private var layout: ContainerViewLayout?
|
||||
|
||||
private var ready: Bool {
|
||||
@ -308,6 +331,8 @@ public final class PresentationContext {
|
||||
controller.displayNode.accessibilityElementsHidden = false
|
||||
}
|
||||
}
|
||||
|
||||
self.updateStatusBar?(.animated(duration: 0.2, curve: .easeInOut))
|
||||
}
|
||||
|
||||
private func notifyAccessibilityScreenChanged() {
|
||||
|
||||
@ -3,15 +3,11 @@ import SwiftSignalKit
|
||||
|
||||
public protocol StatusBarHost {
|
||||
var statusBarFrame: CGRect { get }
|
||||
var statusBarStyle: UIStatusBarStyle { get set }
|
||||
|
||||
var keyboardWindow: UIWindow? { get }
|
||||
var keyboardView: UIView? { get }
|
||||
|
||||
var isApplicationInForeground: Bool { get }
|
||||
|
||||
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool)
|
||||
func setStatusBarHidden(_ value: Bool, animated: Bool)
|
||||
|
||||
var shouldChangeStatusBarStyle: ((UIStatusBarStyle) -> Bool)? { get set }
|
||||
}
|
||||
|
||||
@ -80,20 +80,16 @@ public extension UIColor {
|
||||
}
|
||||
|
||||
convenience init?(hexString: String) {
|
||||
let scanner = Scanner(string: hexString)
|
||||
if hexString.hasPrefix("#") {
|
||||
scanner.scanLocation = 1
|
||||
}
|
||||
var value: UInt32 = 0
|
||||
if scanner.scanHexInt32(&value) {
|
||||
if hexString.count > 7 {
|
||||
self.init(argb: value)
|
||||
} else {
|
||||
self.init(rgb: value)
|
||||
}
|
||||
} else {
|
||||
let cleanedString = hexString.hasPrefix("#") ? hexString.dropFirst() : hexString[...]
|
||||
guard let value = UInt32(cleanedString, radix: 16) else {
|
||||
return nil
|
||||
}
|
||||
|
||||
if hexString.count > 7 {
|
||||
self.init(argb: value)
|
||||
} else {
|
||||
self.init(rgb: value)
|
||||
}
|
||||
}
|
||||
|
||||
var alpha: CGFloat {
|
||||
|
||||
@ -161,6 +161,7 @@ public final class WindowHostView {
|
||||
let updateSupportedInterfaceOrientations: (UIInterfaceOrientationMask) -> Void
|
||||
let updateDeferScreenEdgeGestures: (UIRectEdge) -> Void
|
||||
let updatePrefersOnScreenNavigationHidden: (Bool) -> Void
|
||||
let updateStatusBar: (UIStatusBarStyle, Bool, ContainedViewLayoutTransition) -> Void
|
||||
|
||||
var present: ((ContainableController, PresentationSurfaceLevel, Bool, @escaping () -> Void) -> Void)?
|
||||
var presentInGlobalOverlay: ((_ controller: ContainableController) -> Void)?
|
||||
@ -179,7 +180,7 @@ public final class WindowHostView {
|
||||
var forEachController: (((ContainableController) -> Void) -> Void)?
|
||||
var getAccessibilityElements: (() -> [Any]?)?
|
||||
|
||||
init(containerView: UIView, eventView: UIView, isRotating: @escaping () -> Bool, systemUserInterfaceStyle: Signal<WindowUserInterfaceStyle, NoError>, currentInterfaceOrientation: @escaping () -> UIInterfaceOrientation, updateSupportedInterfaceOrientations: @escaping (UIInterfaceOrientationMask) -> Void, updateDeferScreenEdgeGestures: @escaping (UIRectEdge) -> Void, updatePrefersOnScreenNavigationHidden: @escaping (Bool) -> Void) {
|
||||
init(containerView: UIView, eventView: UIView, isRotating: @escaping () -> Bool, systemUserInterfaceStyle: Signal<WindowUserInterfaceStyle, NoError>, currentInterfaceOrientation: @escaping () -> UIInterfaceOrientation, updateSupportedInterfaceOrientations: @escaping (UIInterfaceOrientationMask) -> Void, updateDeferScreenEdgeGestures: @escaping (UIRectEdge) -> Void, updatePrefersOnScreenNavigationHidden: @escaping (Bool) -> Void, updateStatusBar: @escaping (UIStatusBarStyle, Bool, ContainedViewLayoutTransition) -> Void) {
|
||||
self.containerView = containerView
|
||||
self.eventView = eventView
|
||||
self.isRotating = isRotating
|
||||
@ -188,6 +189,7 @@ public final class WindowHostView {
|
||||
self.updateSupportedInterfaceOrientations = updateSupportedInterfaceOrientations
|
||||
self.updateDeferScreenEdgeGestures = updateDeferScreenEdgeGestures
|
||||
self.updatePrefersOnScreenNavigationHidden = updatePrefersOnScreenNavigationHidden
|
||||
self.updateStatusBar = updateStatusBar
|
||||
}
|
||||
|
||||
fileprivate var onScreenNavigationHeight: CGFloat? {
|
||||
@ -385,6 +387,9 @@ public class Window1 {
|
||||
self.presentationContext.updateIsInteractionBlocked = { [weak self] value in
|
||||
self?.isInteractionBlocked = value
|
||||
}
|
||||
self.presentationContext.updateStatusBar = { [weak self] transition in
|
||||
self?.updateStatusBar(transition: transition)
|
||||
}
|
||||
|
||||
let updateOpaqueOverlays: () -> Void = { [weak self] in
|
||||
guard let strongSelf = self else {
|
||||
@ -398,6 +403,9 @@ public class Window1 {
|
||||
self.topPresentationContext.updateHasOpaqueOverlay = { value in
|
||||
updateOpaqueOverlays()
|
||||
}
|
||||
self.topPresentationContext.updateStatusBar = { [weak self] transition in
|
||||
self?.updateStatusBar(transition: transition)
|
||||
}
|
||||
|
||||
self.hostView.present = { [weak self] controller, level, blockInteraction, completion in
|
||||
self?.present(controller, on: level, blockInteraction: blockInteraction, completion: completion)
|
||||
@ -460,14 +468,16 @@ public class Window1 {
|
||||
self.topPresentationContext.containerLayoutUpdated(containedLayoutForWindowLayout(self.windowLayout, deviceMetrics: self.deviceMetrics), transition: .immediate)
|
||||
self.overlayPresentationContext.containerLayoutUpdated(containedLayoutForWindowLayout(self.windowLayout, deviceMetrics: self.deviceMetrics), transition: .immediate)
|
||||
|
||||
self.statusBarChangeObserver = NotificationCenter.default.addObserver(forName: UIApplication.willChangeStatusBarFrameNotification, object: nil, queue: OperationQueue.main, using: { [weak self] notification in
|
||||
//TODO:release check old iOS
|
||||
/*self.statusBarChangeObserver = NotificationCenter.default.addObserver(forName: UIApplication.willChangeStatusBarFrameNotification, object: nil, queue: OperationQueue.main, using: { [weak self] notification in
|
||||
if let strongSelf = self, strongSelf.statusBarHost != nil {
|
||||
let statusBarHeight: CGFloat = max(defaultStatusBarHeight, (notification.userInfo?[UIApplication.statusBarFrameUserInfoKey] as? NSValue)?.cgRectValue.height ?? defaultStatusBarHeight)
|
||||
|
||||
let transition: ContainedViewLayoutTransition = .animated(duration: 0.35, curve: .easeInOut)
|
||||
strongSelf.updateLayout { $0.update(statusBarHeight: statusBarHeight, transition: transition, overrideTransition: false) }
|
||||
}
|
||||
})
|
||||
})*/
|
||||
|
||||
self.keyboardRotationChangeObserver = NotificationCenter.default.addObserver(forName: NSNotification.Name("UITextEffectsWindowDidRotateNotification"), object: nil, queue: nil, using: { [weak self] notification in
|
||||
if let strongSelf = self {
|
||||
if !strongSelf.hostView.isUpdatingOrientationLayout {
|
||||
@ -879,11 +889,18 @@ public class Window1 {
|
||||
}
|
||||
strongSelf.hostView.updateSupportedInterfaceOrientations(resolvedOrientations)
|
||||
}
|
||||
rootController.updateStatusBar = { [weak self] transition in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.updateStatusBar(transition: transition)
|
||||
}
|
||||
rootController.keyboardViewManager = self.keyboardViewManager
|
||||
rootController.inCallNavigate = { [weak self] in
|
||||
self?.inCallNavigate?()
|
||||
}
|
||||
}
|
||||
|
||||
self.hostView.containerView.insertSubview(rootController.view, at: 0)
|
||||
if !self.windowLayout.size.width.isZero && !self.windowLayout.size.height.isZero {
|
||||
rootController.displayNode.frame = CGRect(origin: CGPoint(), size: self.windowLayout.size)
|
||||
@ -968,6 +985,29 @@ public class Window1 {
|
||||
}
|
||||
}
|
||||
|
||||
private func updateStatusBar(transition: ContainedViewLayoutTransition) {
|
||||
var style: UIStatusBarStyle = .default
|
||||
var isHidden = false
|
||||
|
||||
if let rootController = self._rootController as? NavigationController {
|
||||
let statusBar = rootController.statusBar
|
||||
style = statusBar.style
|
||||
isHidden = statusBar.isHidden
|
||||
}
|
||||
|
||||
if let statusBar = self.presentationContext.statusBar {
|
||||
style = statusBar.style
|
||||
isHidden = statusBar.isHidden
|
||||
}
|
||||
|
||||
if let statusBar = self.topPresentationContext.statusBar {
|
||||
style = statusBar.style
|
||||
isHidden = statusBar.isHidden
|
||||
}
|
||||
|
||||
self.hostView.updateStatusBar(style, isHidden, transition)
|
||||
}
|
||||
|
||||
private func layoutSubviews(force: Bool) {
|
||||
if self.tracingStatusBarsInvalidated, let _ = keyboardManager {
|
||||
self.tracingStatusBarsInvalidated = false
|
||||
|
||||
@ -1007,7 +1007,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
||||
}
|
||||
}
|
||||
|
||||
override func showCGGlyphs(_ glyphs: UnsafePointer<CGGlyph>, positions: UnsafePointer<CGPoint>, count glyphCount: Int, font: UIFont, matrix textMatrix: CGAffineTransform, attributes: [NSAttributedString.Key : Any] = [:], in graphicsContext: CGContext) {
|
||||
override func showCGGlyphs(_ glyphs: UnsafePointer<CGGlyph>, positions: UnsafePointer<CGPoint>, count glyphCount: Int, font: UIFont, textMatrix: CGAffineTransform, attributes: [NSAttributedString.Key : Any] = [:], in graphicsContext: CGContext) {
|
||||
if let strokeColor = self.strokeColor {
|
||||
graphicsContext.setStrokeColor(strokeColor.cgColor)
|
||||
graphicsContext.setLineJoin(.round)
|
||||
@ -1019,7 +1019,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
||||
graphicsContext.saveGState()
|
||||
graphicsContext.translateBy(x: self.strokeOffset.x, y: self.strokeOffset.y)
|
||||
|
||||
super.showCGGlyphs(glyphs, positions: positions, count: glyphCount, font: font, matrix: textMatrix, attributes: attributes, in: graphicsContext)
|
||||
super.showCGGlyphs(glyphs, positions: positions, count: glyphCount, font: font, textMatrix: textMatrix, attributes: attributes, in: graphicsContext)
|
||||
|
||||
graphicsContext.restoreGState()
|
||||
|
||||
@ -1028,7 +1028,7 @@ final class DrawingTextLayoutManager: NSLayoutManager {
|
||||
graphicsContext.setFillColor(textColor.cgColor)
|
||||
graphicsContext.setTextDrawingMode(.fill)
|
||||
}
|
||||
super.showCGGlyphs(glyphs, positions: positions, count: glyphCount, font: font, matrix: textMatrix, attributes: attributes, in: graphicsContext)
|
||||
super.showCGGlyphs(glyphs, positions: positions, count: glyphCount, font: font, textMatrix: textMatrix, attributes: attributes, in: graphicsContext)
|
||||
}
|
||||
|
||||
override func drawBackground(forGlyphRange glyphsToShow: NSRange, at origin: CGPoint) {
|
||||
|
||||
@ -1204,7 +1204,7 @@ static id<LegacyComponentsContext> _defaultContext = nil;
|
||||
UIEdgeInsets finalInset = self.controllerInset;
|
||||
|
||||
scrollView.contentInset = finalInset;
|
||||
scrollView.scrollIndicatorInsets = _explicitScrollIndicatorInset;
|
||||
scrollView.verticalScrollIndicatorInsets = _explicitScrollIndicatorInset;
|
||||
|
||||
if (!UIEdgeInsetsEqualToEdgeInsets(previousInset, UIEdgeInsetsZero))
|
||||
{
|
||||
|
||||
@ -141,7 +141,7 @@ public final class LegacyControllerContext: NSObject, LegacyComponentsContext {
|
||||
}
|
||||
|
||||
public func statusBarFrame() -> CGRect {
|
||||
return legacyComponentsApplication!.statusBarFrame
|
||||
return legacyComponentsApplication!.delegate!.window!?.windowScene!.statusBarManager?.statusBarFrame ?? CGRect()
|
||||
}
|
||||
|
||||
public func isStatusBarHidden() -> Bool {
|
||||
|
||||
@ -113,11 +113,11 @@ private final class LegacyComponentsGlobalsProviderImpl: NSObject, LegacyCompone
|
||||
}
|
||||
|
||||
public func applicationStatusBarOrientation() -> UIInterfaceOrientation {
|
||||
return legacyComponentsApplication?.statusBarOrientation ?? UIInterfaceOrientation.portrait
|
||||
return legacyComponentsApplication?.delegate?.window??.windowScene?.interfaceOrientation ?? .portrait
|
||||
}
|
||||
|
||||
public func statusBarFrame() -> CGRect {
|
||||
return legacyComponentsApplication?.statusBarFrame ?? CGRect(origin: CGPoint(), size: CGSize(width: 320.0, height: 20.0))
|
||||
return legacyComponentsApplication?.delegate?.window??.windowScene?.statusBarManager?.statusBarFrame ?? CGRect(origin: CGPoint(), size: CGSize(width: 320.0, height: 20.0))
|
||||
}
|
||||
|
||||
public func isStatusBarHidden() -> Bool {
|
||||
|
||||
@ -72,7 +72,7 @@ final class ListMessageHoleItemNode: ListViewItemNode {
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
let activityIndicator = UIActivityIndicatorView(style: .gray)
|
||||
let activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
self.activityIndicator = activityIndicator
|
||||
self.view.addSubview(activityIndicator)
|
||||
let size = activityIndicator.bounds.size
|
||||
|
||||
@ -63,7 +63,7 @@ private func fetchMapSnapshotResource(resource: MapSnapshotMediaResource) -> Sig
|
||||
let latitude = adjustGMapLatitude(resource.latitude, offset: -10, zoom: 15)
|
||||
options.region = MKCoordinateRegion(center: CLLocationCoordinate2DMake(latitude, resource.longitude), span: MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003))
|
||||
options.mapType = .standard
|
||||
options.showsPointsOfInterest = false
|
||||
options.pointOfInterestFilter = .excludingAll
|
||||
options.showsBuildings = true
|
||||
options.size = CGSize(width: CGFloat(resource.width + 1), height: CGFloat(resource.height + 10))
|
||||
options.scale = 2.0
|
||||
|
||||
@ -334,7 +334,7 @@ public final class LocationMapNode: ASDisplayNode, MKMapViewDelegateTarget {
|
||||
mapView.mapType = self.mapMode.mapType
|
||||
mapView.isRotateEnabled = self.isRotateEnabled
|
||||
mapView.showsUserLocation = true
|
||||
mapView.showsPointsOfInterest = false
|
||||
mapView.pointOfInterestFilter = .excludingAll
|
||||
mapView.showsCompass = false
|
||||
mapView.customHitTest = { [weak self] point in
|
||||
guard let strongSelf = self else {
|
||||
|
||||
@ -59,9 +59,6 @@ public final class PasscodeEntryController: ViewController {
|
||||
private var inBackground: Bool = false
|
||||
private var inBackgroundDisposable: Disposable?
|
||||
|
||||
private var statusBarHost: StatusBarHost?
|
||||
private var previousStatusBarStyle: UIStatusBarStyle?
|
||||
|
||||
public init(applicationBindings: TelegramApplicationBindings, accountManager: AccountManager<TelegramAccountManagerTypes>, appLockContext: AppLockContext, presentationData: PresentationData, presentationDataSignal: Signal<PresentationData, NoError>, statusBarHost: StatusBarHost?, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, arguments: PasscodeEntryControllerPresentationArguments) {
|
||||
self.applicationBindings = applicationBindings
|
||||
self.accountManager = accountManager
|
||||
@ -72,19 +69,10 @@ public final class PasscodeEntryController: ViewController {
|
||||
self.biometrics = biometrics
|
||||
self.arguments = arguments
|
||||
|
||||
self.statusBarHost = statusBarHost
|
||||
self.previousStatusBarStyle = statusBarHost?.statusBarStyle
|
||||
super.init(navigationBarPresentationData: nil)
|
||||
|
||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||
self.statusBarHost?.setStatusBarStyle(.lightContent, animated: true)
|
||||
self.statusBarHost?.shouldChangeStatusBarStyle = { [weak self] style in
|
||||
if let strongSelf = self {
|
||||
strongSelf.previousStatusBarStyle = style
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
self.statusBar.updateStatusBarStyle(.White, animated: false)
|
||||
|
||||
self.presentationDataDisposable = (presentationDataSignal
|
||||
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
||||
@ -284,10 +272,6 @@ public final class PasscodeEntryController: ViewController {
|
||||
}
|
||||
|
||||
public override func dismiss(completion: (() -> Void)? = nil) {
|
||||
self.statusBarHost?.shouldChangeStatusBarStyle = nil
|
||||
if let statusBarHost = self.statusBarHost, let previousStatusBarStyle = self.previousStatusBarStyle {
|
||||
statusBarHost.setStatusBarStyle(previousStatusBarStyle, animated: true)
|
||||
}
|
||||
self.view.endEditing(true)
|
||||
self.controllerNode.animateOut { [weak self] in
|
||||
guard let strongSelf = self else {
|
||||
|
||||
@ -92,7 +92,7 @@ public final class CallKitIntegration {
|
||||
let handle = INPersonHandle(value: "tg\(peerId.id._internalGetInt64Value())", type: .unknown)
|
||||
let contact = INPerson(personHandle: handle, nameComponents: nil, displayName: displayTitle, image: nil, contactIdentifier: localContactId, customIdentifier: "tg\(peerId.id._internalGetInt64Value())")
|
||||
|
||||
let intent = INStartAudioCallIntent(destinationType: .normal, contacts: [contact])
|
||||
let intent = INStartCallIntent(audioRoute: .unknown, destinationType: .normal, contacts: [contact], recordTypeForRedialing: .unknown, callCapability: .audioCall)
|
||||
|
||||
let interaction = INInteraction(intent: intent, response: nil)
|
||||
interaction.direction = .outgoing
|
||||
|
||||
@ -475,12 +475,11 @@ public func dataWithHexString(_ string: String) -> Data {
|
||||
let subIndex = hex.index(hex.startIndex, offsetBy: 2)
|
||||
let c = String(hex[..<subIndex])
|
||||
hex = String(hex[subIndex...])
|
||||
var ch: UInt32 = 0
|
||||
if !Scanner(string: c).scanHexInt32(&ch) {
|
||||
|
||||
guard let byte = UInt8(c, radix: 16) else {
|
||||
return Data()
|
||||
}
|
||||
var char = UInt8(ch)
|
||||
data.append(&char, count: 1)
|
||||
data.append(byte)
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
@ -363,6 +363,7 @@ swift_library(
|
||||
"//submodules/TelegramUI/Components/Chat/ChatContextResultPeekContent",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatInputContextPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ReplyAccessoryPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/SuggestPostAccessoryPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatMessageCallBubbleContentNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatMessageInteractiveInstantVideoNode",
|
||||
"//submodules/TelegramUI/Components/Chat/InstantVideoRadialStatusNode",
|
||||
|
||||
@ -1380,22 +1380,20 @@ private func findHigherResolutionFileForAdaptation(itemDirectoryPath: String, ba
|
||||
let fileName = url.lastPathComponent
|
||||
if fileName.hasPrefix(baseName) {
|
||||
let scanner = Scanner(string: fileName)
|
||||
guard scanner.scanString(baseName, into: nil) else {
|
||||
guard scanner.scanString(baseName) != nil else {
|
||||
continue
|
||||
}
|
||||
var itemWidth: Int = 0
|
||||
guard scanner.scanInt(&itemWidth) else {
|
||||
guard let itemWidth = scanner.scanInt() else {
|
||||
continue
|
||||
}
|
||||
guard scanner.scanString("x", into: nil) else {
|
||||
guard scanner.scanString("x") != nil else {
|
||||
continue
|
||||
}
|
||||
var itemHeight: Int = 0
|
||||
guard scanner.scanInt(&itemHeight) else {
|
||||
guard let itemHeight = scanner.scanInt() else {
|
||||
continue
|
||||
}
|
||||
if !baseSuffix.isEmpty {
|
||||
guard scanner.scanString(baseSuffix, into: nil) else {
|
||||
guard scanner.scanString(baseSuffix) != nil else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,16 +107,6 @@ final class PrivateCallPictureInPictureView: UIView {
|
||||
override var frame: CGRect {
|
||||
didSet {
|
||||
if !self.bounds.isEmpty {
|
||||
/*if let testView = self.viewWithTag(123) {
|
||||
testView.frame = self.bounds.insetBy(dx: 10.0, dy: 10.0)
|
||||
} else {
|
||||
let testView = AnimationTrackingView(frame: self.bounds.insetBy(dx: 10.0, dy: 10.0))
|
||||
testView.layer.borderColor = UIColor.red.cgColor
|
||||
testView.layer.borderWidth = 2.0
|
||||
testView.tag = 123
|
||||
self.addSubview(testView)
|
||||
}*/
|
||||
|
||||
self.updateLayout(size: self.bounds.size)
|
||||
}
|
||||
}
|
||||
@ -169,8 +159,22 @@ final class PrivateCallPictureInPictureView: UIView {
|
||||
return
|
||||
}
|
||||
|
||||
var interfaceOrientation: UIInterfaceOrientation = .portrait
|
||||
switch UIDevice.current.orientation {
|
||||
case .portrait:
|
||||
interfaceOrientation = .portrait
|
||||
case .landscapeLeft:
|
||||
interfaceOrientation = .landscapeLeft
|
||||
case .landscapeRight:
|
||||
interfaceOrientation = .landscapeRight
|
||||
case .portraitUpsideDown:
|
||||
interfaceOrientation = .portraitUpsideDown
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
if let videoMetrics = self.videoMetrics {
|
||||
let resolvedRotationAngle = resolveCallVideoRotationAngle(angle: videoMetrics.rotationAngle, followsDeviceOrientation: videoMetrics.followsDeviceOrientation, interfaceOrientation: UIApplication.shared.statusBarOrientation)
|
||||
let resolvedRotationAngle = resolveCallVideoRotationAngle(angle: videoMetrics.rotationAngle, followsDeviceOrientation: videoMetrics.followsDeviceOrientation, interfaceOrientation: interfaceOrientation)
|
||||
|
||||
var rotatedResolution = videoMetrics.resolution
|
||||
var videoIsRotated = false
|
||||
|
||||
@ -164,7 +164,7 @@ public final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
public override init() {
|
||||
self.button = HighlightableButtonNode()
|
||||
self.discussButton = HighlightableButtonNode()
|
||||
self.activityIndicator = UIActivityIndicatorView(style: .gray)
|
||||
self.activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
self.activityIndicator.isHidden = true
|
||||
|
||||
self.discussButtonText = ImmediateTextNode()
|
||||
|
||||
@ -1279,8 +1279,8 @@ final class ComposeTodoScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: environment.safeInsets.bottom, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if let recenterOnTag {
|
||||
|
||||
@ -4471,8 +4471,8 @@ public final class EmojiPagerContentComponent: Component {
|
||||
if self.warpView != nil {
|
||||
scrollIndicatorInsets.bottom += 20.0
|
||||
}
|
||||
if self.scrollView.scrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollIndicatorInsets
|
||||
}
|
||||
self.previousScrollingOffset = ScrollingOffsetState(value: scrollView.contentOffset.y, isDraggingOrDecelerating: scrollView.isDragging || scrollView.isDecelerating)
|
||||
|
||||
|
||||
@ -955,8 +955,8 @@ public final class GifPagerContentComponent: Component {
|
||||
if self.scrollView.contentSize != itemLayout.contentSize {
|
||||
self.scrollView.contentSize = itemLayout.contentSize
|
||||
}
|
||||
if self.scrollView.scrollIndicatorInsets != pagerEnvironment.containerInsets {
|
||||
self.scrollView.scrollIndicatorInsets = pagerEnvironment.containerInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != pagerEnvironment.containerInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = pagerEnvironment.containerInsets
|
||||
}
|
||||
|
||||
if contentReset {
|
||||
|
||||
@ -515,8 +515,8 @@ final class ForumSettingsScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
self.ignoreScrolling = false
|
||||
|
||||
|
||||
@ -1422,8 +1422,8 @@ final class GiftOptionsScreenComponent: Component {
|
||||
self.nextScrollTransition = nil
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -1553,8 +1553,8 @@ final class GiftSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -1187,8 +1187,8 @@ final class GiftStoreScreenComponent: Component {
|
||||
self.nextScrollTransition = nil
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: topPanelHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -420,8 +420,8 @@ final class ContextResultPanelComponent: Component {
|
||||
if self.scrollView.contentInset != scrollContentInsets {
|
||||
self.scrollView.contentInset = scrollContentInsets
|
||||
}
|
||||
if self.scrollView.scrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollIndicatorInsets
|
||||
}
|
||||
if self.scrollView.contentSize != scrollContentSize {
|
||||
self.scrollView.contentSize = scrollContentSize
|
||||
|
||||
@ -463,8 +463,8 @@ final class StickersResultPanelComponent: Component {
|
||||
if self.scrollView.contentInset != scrollContentInsets {
|
||||
self.scrollView.contentInset = scrollContentInsets
|
||||
}
|
||||
if self.scrollView.scrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollIndicatorInsets
|
||||
}
|
||||
if self.scrollView.contentSize != scrollContentSize {
|
||||
self.scrollView.contentSize = scrollContentSize
|
||||
|
||||
@ -1666,8 +1666,8 @@ final class PeerAllowedReactionsScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: environment.safeInsets.bottom, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if self.recenterOnCaret {
|
||||
|
||||
@ -1554,8 +1554,8 @@ final class AffiliateProgramSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: environment.safeInsets.bottom, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
self.ignoreScrolling = false
|
||||
|
||||
|
||||
@ -442,8 +442,8 @@ final class PostSuggestionsSettingsScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -129,8 +129,15 @@ public final class ScrollComponent<ChildEnvironment: Equatable>: Component {
|
||||
self.contentSize = contentSize
|
||||
self.ignoreDidScroll = false
|
||||
}
|
||||
if self.scrollIndicatorInsets != component.contentInsets {
|
||||
self.scrollIndicatorInsets = component.contentInsets
|
||||
|
||||
let verticalScrollIndicatorInsets = UIEdgeInsets(top: component.contentInsets.top, left: 0.0, bottom: component.contentInsets.bottom, right: 0.0)
|
||||
let horizontalScrollIndicatorInsets = UIEdgeInsets(top: 0.0, left: component.contentInsets.left, bottom: 0.0, right: component.contentInsets.right)
|
||||
|
||||
if self.verticalScrollIndicatorInsets != verticalScrollIndicatorInsets {
|
||||
self.verticalScrollIndicatorInsets = verticalScrollIndicatorInsets
|
||||
}
|
||||
if self.horizontalScrollIndicatorInsets != horizontalScrollIndicatorInsets {
|
||||
self.horizontalScrollIndicatorInsets = horizontalScrollIndicatorInsets
|
||||
}
|
||||
component.externalState?.contentHeight = contentSize.height
|
||||
|
||||
|
||||
@ -1514,8 +1514,8 @@ final class AutomaticBusinessMessageSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
self.ignoreScrolling = false
|
||||
|
||||
|
||||
@ -630,8 +630,8 @@ final class BusinessLinksSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -592,8 +592,8 @@ final class BusinessDaySetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -792,8 +792,8 @@ final class BusinessHoursSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
self.ignoreScrolling = false
|
||||
|
||||
|
||||
@ -1106,8 +1106,8 @@ final class BusinessIntroSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -579,8 +579,8 @@ final class BusinessLocationSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -622,8 +622,8 @@ final class BusinessRecipientListScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -1318,8 +1318,8 @@ final class ChatbotSetupScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: 0.0, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -1831,8 +1831,8 @@ final class ChannelAppearanceScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: availableSize.height - bottomPanelFrame.minY, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -1196,8 +1196,8 @@ final class UserAppearanceScreenComponent: Component {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
let scrollInsets = UIEdgeInsets(top: environment.navigationHeight, left: 0.0, bottom: availableSize.height - bottomPanelFrame.minY, right: 0.0)
|
||||
if self.scrollView.scrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollInsets
|
||||
}
|
||||
|
||||
if !previousBounds.isEmpty, !transition.animation.isImmediate {
|
||||
|
||||
@ -966,8 +966,8 @@ final class CountriesMultiselectionScreenComponent: Component {
|
||||
}
|
||||
let contentInset: UIEdgeInsets = UIEdgeInsets(top: 0.0, left: 0.0, bottom: bottomPanelHeight + bottomPanelInset, right: 0.0)
|
||||
let indicatorInset = UIEdgeInsets(top: max(itemLayout.containerInset, environment.safeInsets.top + navigationHeight), left: 0.0, bottom: contentInset.bottom, right: 0.0)
|
||||
if indicatorInset != self.scrollView.scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = indicatorInset
|
||||
if indicatorInset != self.scrollView.verticalScrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = indicatorInset
|
||||
}
|
||||
if contentInset != self.scrollView.contentInset {
|
||||
self.scrollView.contentInset = contentInset
|
||||
|
||||
@ -2988,8 +2988,8 @@ final class ShareWithPeersScreenComponent: Component {
|
||||
}
|
||||
let contentInset: UIEdgeInsets = UIEdgeInsets(top: 0.0, left: 0.0, bottom: bottomPanelHeight + bottomPanelInset, right: 0.0)
|
||||
let indicatorInset = UIEdgeInsets(top: max(itemLayout.containerInset, environment.safeInsets.top + navigationHeight), left: 0.0, bottom: contentInset.bottom, right: 0.0)
|
||||
if indicatorInset != self.scrollView.scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = indicatorInset
|
||||
if indicatorInset != self.scrollView.verticalScrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = indicatorInset
|
||||
}
|
||||
if contentInset != self.scrollView.contentInset {
|
||||
self.scrollView.contentInset = contentInset
|
||||
|
||||
@ -675,7 +675,7 @@ final class StarsTransactionsListPanelComponent: Component {
|
||||
if self.scrollView.contentSize != contentSize {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
self.scrollView.scrollIndicatorInsets = environment.containerInsets
|
||||
self.scrollView.verticalScrollIndicatorInsets = environment.containerInsets
|
||||
if !transition.animation.isImmediate && self.scrollView.bounds.minY != contentOffset {
|
||||
let deltaOffset = self.scrollView.bounds.minY - contentOffset
|
||||
transition.animateBoundsOrigin(view: self.scrollView, from: CGPoint(x: 0.0, y: -deltaOffset), to: CGPoint(), additive: true)
|
||||
|
||||
@ -1053,7 +1053,7 @@ final class StorageFileListPanelComponent: Component {
|
||||
if self.scrollView.contentSize != contentSize {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
self.scrollView.scrollIndicatorInsets = environment.containerInsets
|
||||
self.scrollView.verticalScrollIndicatorInsets = environment.containerInsets
|
||||
if !transition.animation.isImmediate && self.scrollView.bounds.minY != contentOffset {
|
||||
let deltaOffset = self.scrollView.bounds.minY - contentOffset
|
||||
transition.animateBoundsOrigin(view: self.scrollView, from: CGPoint(x: 0.0, y: -deltaOffset), to: CGPoint(), additive: true)
|
||||
|
||||
@ -641,7 +641,7 @@ final class StorageMediaGridPanelComponent: Component {
|
||||
if self.scrollView.contentSize != contentSize {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
self.scrollView.scrollIndicatorInsets = environment.containerInsets
|
||||
self.scrollView.verticalScrollIndicatorInsets = environment.containerInsets
|
||||
if !transition.animation.isImmediate && self.scrollView.bounds.minY != contentOffset {
|
||||
let deltaOffset = self.scrollView.bounds.minY - contentOffset
|
||||
transition.animateBoundsOrigin(view: self.scrollView, from: CGPoint(x: 0.0, y: -deltaOffset), to: CGPoint(), additive: true)
|
||||
|
||||
@ -683,7 +683,7 @@ final class StoragePeerListPanelComponent: Component {
|
||||
if self.scrollView.contentSize != contentSize {
|
||||
self.scrollView.contentSize = contentSize
|
||||
}
|
||||
self.scrollView.scrollIndicatorInsets = environment.containerInsets
|
||||
self.scrollView.verticalScrollIndicatorInsets = environment.containerInsets
|
||||
if !transition.animation.isImmediate && self.scrollView.bounds.minY != contentOffset {
|
||||
let deltaOffset = self.scrollView.bounds.minY - contentOffset
|
||||
transition.animateBoundsOrigin(view: self.scrollView, from: CGPoint(x: 0.0, y: -deltaOffset), to: CGPoint(), additive: true)
|
||||
|
||||
@ -1006,7 +1006,7 @@ final class StorageUsageScreenComponent: Component {
|
||||
} else {
|
||||
let style: UIActivityIndicatorView.Style
|
||||
if environment.theme.overallDarkAppearance {
|
||||
style = .whiteLarge
|
||||
style = .large
|
||||
} else {
|
||||
if #available(iOS 13.0, *) {
|
||||
style = .large
|
||||
|
||||
@ -1047,8 +1047,8 @@ final class StoryItemSetViewListComponent: Component {
|
||||
if self.scrollView.contentInset != scrollContentInsets {
|
||||
self.scrollView.contentInset = scrollContentInsets
|
||||
}
|
||||
if self.scrollView.scrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.scrollIndicatorInsets = scrollIndicatorInsets
|
||||
if self.scrollView.verticalScrollIndicatorInsets != scrollIndicatorInsets {
|
||||
self.scrollView.verticalScrollIndicatorInsets = scrollIndicatorInsets
|
||||
}
|
||||
if self.scrollView.contentSize != scrollContentSize {
|
||||
self.scrollView.contentSize = scrollContentSize
|
||||
|
||||
@ -84,38 +84,48 @@ private func isKeyboardViewContainer(view: NSObject) -> Bool {
|
||||
}
|
||||
|
||||
private class ApplicationStatusBarHost: StatusBarHost {
|
||||
private let application = UIApplication.shared
|
||||
private let scene: UIWindowScene
|
||||
|
||||
init(scene: UIWindowScene) {
|
||||
self.scene = scene
|
||||
}
|
||||
|
||||
var isApplicationInForeground: Bool {
|
||||
switch self.application.applicationState {
|
||||
switch self.scene.activationState {
|
||||
case .unattached:
|
||||
return false
|
||||
case .foregroundActive:
|
||||
return true
|
||||
case .foregroundInactive:
|
||||
return true
|
||||
case .background:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
@unknown default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
var statusBarFrame: CGRect {
|
||||
return self.application.statusBarFrame
|
||||
return self.scene.statusBarManager?.statusBarFrame ?? CGRect()
|
||||
}
|
||||
var statusBarStyle: UIStatusBarStyle {
|
||||
get {
|
||||
return self.application.statusBarStyle
|
||||
return self.scene.statusBarManager?.statusBarStyle ?? .default
|
||||
} set(value) {
|
||||
self.setStatusBarStyle(value, animated: false)
|
||||
}
|
||||
}
|
||||
|
||||
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool) {
|
||||
if self.shouldChangeStatusBarStyle?(style) ?? true {
|
||||
/*if self.shouldChangeStatusBarStyle?(style) ?? true {
|
||||
self.application.internalSetStatusBarStyle(style, animated: animated)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
var shouldChangeStatusBarStyle: ((UIStatusBarStyle) -> Bool)?
|
||||
|
||||
func setStatusBarHidden(_ value: Bool, animated: Bool) {
|
||||
self.application.internalSetStatusBarHidden(value, animation: animated ? .fade : .none)
|
||||
//self.application.internalSetStatusBarHidden(value, animation: animated ? .fade : .none)
|
||||
}
|
||||
|
||||
var keyboardWindow: UIWindow? {
|
||||
@ -158,17 +168,13 @@ protocol SupportedStartCallIntent {
|
||||
var contacts: [INPerson]? { get }
|
||||
}
|
||||
|
||||
@available(iOS 10.0, *)
|
||||
extension INStartAudioCallIntent: SupportedStartCallIntent {}
|
||||
extension INStartCallIntent: SupportedStartCallIntent {}
|
||||
|
||||
protocol SupportedStartVideoCallIntent {
|
||||
@available(iOS 10.0, *)
|
||||
var contacts: [INPerson]? { get }
|
||||
}
|
||||
|
||||
@available(iOS 10.0, *)
|
||||
extension INStartVideoCallIntent: SupportedStartVideoCallIntent {}
|
||||
|
||||
private enum QueuedWakeup: Int32 {
|
||||
case call
|
||||
case backgroundLocation
|
||||
@ -235,7 +241,6 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
let hasActiveAudioSession = Promise<Bool>(false)
|
||||
|
||||
private let sharedContextPromise = Promise<SharedApplicationContext>()
|
||||
//private let watchCommunicationManagerPromise = Promise<WatchCommunicationManager?>()
|
||||
|
||||
private var accountManager: AccountManager<TelegramAccountManagerTypes>?
|
||||
private var accountManagerState: AccountManagerState?
|
||||
@ -339,8 +344,8 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
|
||||
let launchStartTime = CFAbsoluteTimeGetCurrent()
|
||||
|
||||
let statusBarHost = ApplicationStatusBarHost()
|
||||
let (window, hostView) = nativeWindowHostView()
|
||||
let statusBarHost = ApplicationStatusBarHost(scene: window.windowScene!)
|
||||
self.mainWindow = Window1(hostView: hostView, statusBarHost: statusBarHost)
|
||||
if let traitCollection = window.rootViewController?.traitCollection {
|
||||
if #available(iOS 13.0, *) {
|
||||
@ -1477,9 +1482,9 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
||||
}
|
||||
}
|
||||
|
||||
if UIApplication.shared.isStatusBarHidden {
|
||||
/*if UIApplication.shared.isStatusBarHidden {
|
||||
UIApplication.shared.internalSetStatusBarHidden(false, animation: .none)
|
||||
}
|
||||
}*/
|
||||
|
||||
/*if #available(iOS 13.0, *) {
|
||||
BGTaskScheduler.shared.register(forTaskWithIdentifier: baseAppBundleId + ".refresh", using: nil, launchHandler: { task in
|
||||
|
||||
@ -47,7 +47,7 @@ final class ChatUnblockInputPanelNode: ChatInputPanelNode {
|
||||
self.strings = strings
|
||||
|
||||
self.button = HighlightableButtonNode()
|
||||
self.activityIndicator = UIActivityIndicatorView(style: .gray)
|
||||
self.activityIndicator = UIActivityIndicatorView(style: .medium)
|
||||
self.activityIndicator.isHidden = true
|
||||
|
||||
super.init()
|
||||
|
||||
@ -854,7 +854,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
|
||||
if webView.scrollView.contentInset != scrollInset {
|
||||
webView.scrollView.contentInset = scrollInset
|
||||
webView.scrollView.scrollIndicatorInsets = scrollInset
|
||||
webView.scrollView.horizontalScrollIndicatorInsets = scrollInset
|
||||
webView.scrollView.verticalScrollIndicatorInsets = scrollInset
|
||||
}
|
||||
|
||||
if previousLayout != nil && (previousLayout?.inputHeight ?? 0.0).isZero, let inputHeight = layout.inputHeight, inputHeight > 44.0, transition.isAnimated {
|
||||
|
||||
@ -73,7 +73,7 @@ fi
|
||||
|
||||
COMPILE="y"
|
||||
|
||||
DEPLOYMENT_TARGET="12.0"
|
||||
DEPLOYMENT_TARGET="13.0"
|
||||
|
||||
LIBS_HASH=""
|
||||
for ARCH in $ARCHS
|
||||
|
||||
6
third-party/libjxl/build-libjxl-bazel.sh
vendored
6
third-party/libjxl/build-libjxl-bazel.sh
vendored
@ -14,7 +14,7 @@ CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BE
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
@ -31,7 +31,7 @@ if [ "$ARCH" = "arm64" ]; then
|
||||
elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios12.0-simulator -miphonesimulator-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios13.0-simulator -miphonesimulator-version-min=13.0 -funwind-tables"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
@ -48,7 +48,7 @@ elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
2
third-party/libx264/build-libx264-bazel.sh
vendored
2
third-party/libx264/build-libx264-bazel.sh
vendored
@ -13,7 +13,7 @@ SCRATCH="$BUILD_DIR/scratch"
|
||||
#set -e
|
||||
#devnull='> /dev/null 2>&1'
|
||||
|
||||
DEPLOYMENT_TARGET="9.0"
|
||||
DEPLOYMENT_TARGET="13.0"
|
||||
CONFIGURE_FLAGS="--enable-static --enable-pic --disable-cli --bit-depth=8 --disable-opencl"
|
||||
|
||||
echo "building $RAW_ARCH..."
|
||||
|
||||
8
third-party/mozjpeg/build-mozjpeg-bazel.sh
vendored
8
third-party/mozjpeg/build-mozjpeg-bazel.sh
vendored
@ -10,7 +10,7 @@ BUILD_DIR=$(echo "$(cd "$(dirname "$3")"; pwd -P)/$(basename "$3")")
|
||||
if [ "$ARCH" = "armv7" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-mfloat-abi=softfp -arch armv7 -miphoneos-version-min=9.0"
|
||||
export CFLAGS="-mfloat-abi=softfp -arch armv7 -miphoneos-version-min=13.0"
|
||||
export ASMFLAGS="-no-integrated-as"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
@ -27,7 +27,7 @@ if [ "$ARCH" = "armv7" ]; then
|
||||
elif [ "$ARCH" = "arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=9.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
@ -43,7 +43,7 @@ elif [ "$ARCH" = "arm64" ]; then
|
||||
elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios9.0-simulator -miphonesimulator-version-min=9.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios13.0-simulator -miphonesimulator-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
@ -59,7 +59,7 @@ elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=9.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
|
||||
2
third-party/opus/build-opus-bazel.sh
vendored
2
third-party/opus/build-opus-bazel.sh
vendored
@ -6,7 +6,7 @@ ARCH="$1"
|
||||
BUILD_DIR=$(echo "$(cd "$(dirname "$2")"; pwd -P)/$(basename "$2")")
|
||||
SOURCE_CODE_ARCHIVE="$3"
|
||||
|
||||
MINIOSVERSION="11.0"
|
||||
MINIOSVERSION="13.0"
|
||||
|
||||
OPT_CFLAGS="-Os -g"
|
||||
OPT_LDFLAGS=""
|
||||
|
||||
5
third-party/td/build-td-bazel.sh
vendored
5
third-party/td/build-td-bazel.sh
vendored
@ -15,6 +15,7 @@ options="$options -DOPENSSL_FOUND=1"
|
||||
options="$options -DOPENSSL_CRYPTO_LIBRARY=${openssl_crypto_library}"
|
||||
options="$options -DOPENSSL_INCLUDE_DIR=${OPENSSL_DIR}/src/include"
|
||||
options="$options -DCMAKE_BUILD_TYPE=Release"
|
||||
options="$options -DIOS_DEPLOYMENT_TARGET=13.0"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
|
||||
@ -28,11 +29,11 @@ cd ..
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-arch arm64 -miphoneos-version-min=12.0"
|
||||
export CFLAGS="-arch arm64 -miphoneos-version-min=13.0"
|
||||
elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-arch arm64 --target=arm64-apple-ios12.0-simulator -miphonesimulator-version-min=12.0"
|
||||
export CFLAGS="-arch arm64 --target=arm64-apple-ios13.0-simulator -miphonesimulator-version-min=13.0"
|
||||
else
|
||||
echo "Unsupported architecture $ARCH"
|
||||
exit 1
|
||||
|
||||
6
third-party/webp/build-webp-bazel.sh
vendored
6
third-party/webp/build-webp-bazel.sh
vendored
@ -14,7 +14,7 @@ COMMON_ARGS="-DWEBP_LINK_STATIC=1 -DWEBP_BUILD_CWEBP=0 -DWEBP_BUILD_DWEBP=0 -DWE
|
||||
if [ "$ARCH" = "arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
@ -30,7 +30,7 @@ if [ "$ARCH" = "arm64" ]; then
|
||||
elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios12.0-simulator -miphonesimulator-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios13.0-simulator -miphonesimulator-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
@ -46,7 +46,7 @@ elif [ "$ARCH" = "sim_arm64" ]; then
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform"
|
||||
IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk)
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=12.0 -funwind-tables"
|
||||
export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=13.0 -funwind-tables"
|
||||
|
||||
cd "$BUILD_DIR"
|
||||
mkdir build
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user