mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 01:10:09 +00:00
Cleanup
This commit is contained in:
parent
e03895329f
commit
3bb622782e
@ -8,6 +8,4 @@ public protocol StatusBarHost {
|
|||||||
var keyboardView: UIView? { get }
|
var keyboardView: UIView? { get }
|
||||||
|
|
||||||
var isApplicationInForeground: Bool { get }
|
var isApplicationInForeground: Bool { get }
|
||||||
|
|
||||||
var shouldChangeStatusBarStyle: ((UIStatusBarStyle) -> Bool)? { get set }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,14 +84,17 @@ private func isKeyboardViewContainer(view: NSObject) -> Bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class ApplicationStatusBarHost: StatusBarHost {
|
private class ApplicationStatusBarHost: StatusBarHost {
|
||||||
private let scene: UIWindowScene
|
private weak var scene: UIWindowScene?
|
||||||
|
|
||||||
init(scene: UIWindowScene) {
|
init(scene: UIWindowScene?) {
|
||||||
self.scene = scene
|
self.scene = scene
|
||||||
}
|
}
|
||||||
|
|
||||||
var isApplicationInForeground: Bool {
|
var isApplicationInForeground: Bool {
|
||||||
switch self.scene.activationState {
|
guard let scene = self.scene else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
switch scene.activationState {
|
||||||
case .unattached:
|
case .unattached:
|
||||||
return false
|
return false
|
||||||
case .foregroundActive:
|
case .foregroundActive:
|
||||||
@ -106,26 +109,10 @@ private class ApplicationStatusBarHost: StatusBarHost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var statusBarFrame: CGRect {
|
var statusBarFrame: CGRect {
|
||||||
return self.scene.statusBarManager?.statusBarFrame ?? CGRect()
|
guard let scene = self.scene else {
|
||||||
}
|
return CGRect()
|
||||||
var statusBarStyle: UIStatusBarStyle {
|
|
||||||
get {
|
|
||||||
return self.scene.statusBarManager?.statusBarStyle ?? .default
|
|
||||||
} set(value) {
|
|
||||||
self.setStatusBarStyle(value, animated: false)
|
|
||||||
}
|
}
|
||||||
}
|
return scene.statusBarManager?.statusBarFrame ?? CGRect()
|
||||||
|
|
||||||
func setStatusBarStyle(_ style: UIStatusBarStyle, animated: Bool) {
|
|
||||||
/*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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var keyboardWindow: UIWindow? {
|
var keyboardWindow: UIWindow? {
|
||||||
@ -345,7 +332,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
let launchStartTime = CFAbsoluteTimeGetCurrent()
|
let launchStartTime = CFAbsoluteTimeGetCurrent()
|
||||||
|
|
||||||
let (window, hostView) = nativeWindowHostView()
|
let (window, hostView) = nativeWindowHostView()
|
||||||
let statusBarHost = ApplicationStatusBarHost(scene: window.windowScene!)
|
let statusBarHost = ApplicationStatusBarHost(scene: window.windowScene)
|
||||||
self.mainWindow = Window1(hostView: hostView, statusBarHost: statusBarHost)
|
self.mainWindow = Window1(hostView: hostView, statusBarHost: statusBarHost)
|
||||||
if let traitCollection = window.rootViewController?.traitCollection {
|
if let traitCollection = window.rootViewController?.traitCollection {
|
||||||
if #available(iOS 13.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user