Hide OverlayStatusController implementation

This commit is contained in:
Peter 2019-10-29 00:12:41 +04:00
parent 2744880667
commit d1e57a24bb
11 changed files with 31 additions and 15 deletions

View File

@ -4,7 +4,12 @@ import AsyncDisplayKit
import TelegramPresentationData import TelegramPresentationData
import RadialStatusNode import RadialStatusNode
public final class LegacyDataImportSplash: WindowCoveringView { public protocol LegacyDataImportSplash: WindowCoveringView {
var progress: (AccountImportProgressType, Float) { get set }
var serviceAction: (() -> Void)? { get set }
}
private final class LegacyDataImportSplashImpl: WindowCoveringView, LegacyDataImportSplash {
private let theme: PresentationTheme? private let theme: PresentationTheme?
private let strings: PresentationStrings? private let strings: PresentationStrings?
@ -78,3 +83,7 @@ public final class LegacyDataImportSplash: WindowCoveringView {
} }
} }
} }
public func makeLegacyDataImportSplash(theme: PresentationTheme?, strings: PresentationStrings?) -> LegacyDataImportSplash {
return LegacyDataImportSplashImpl(theme: theme, strings: strings)
}

View File

@ -133,7 +133,7 @@ public enum OverlayStatusControllerStyle {
case dark case dark
} }
public final class OverlayStatusController: ViewController, StandalonePresentableController { private final class OverlayStatusControllerImpl: ViewController, StandalonePresentableController {
private let style: OverlayStatusControllerStyle private let style: OverlayStatusControllerStyle
private let type: OverlayStatusControllerType private let type: OverlayStatusControllerType
@ -152,7 +152,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
self.statusBar.statusBarStyle = .Ignore self.statusBar.statusBarStyle = .Ignore
} }
required init(coder aDecoder: NSCoder) { required public init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
@ -183,3 +183,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
self.controllerNode.dismiss() self.controllerNode.dismiss()
} }
} }
public func OverlayStatusController(style: OverlayStatusControllerStyle, type: OverlayStatusControllerType) -> ViewController {
return OverlayStatusControllerImpl(style: style, type: type)
}

View File

@ -2,9 +2,8 @@ import Foundation
import UIKit import UIKit
import OverlayStatusController import OverlayStatusController
import TelegramPresentationData import TelegramPresentationData
import Display
public extension OverlayStatusController { public func OverlayStatusController(theme: PresentationTheme, type: OverlayStatusControllerType) -> ViewController {
convenience init(theme: PresentationTheme, type: OverlayStatusControllerType) { return OverlayStatusController(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type)
self.init(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type)
}
} }

View File

@ -11,6 +11,7 @@ import TelegramPresentationData
import ActivityIndicator import ActivityIndicator
import OverlayStatusController import OverlayStatusController
import AccountContext import AccountContext
import PresentationDataUtils
public final class ProxyServerActionSheetController: ActionSheetController { public final class ProxyServerActionSheetController: ActionSheetController {
private var presentationDisposable: Disposable? private var presentationDisposable: Disposable?

View File

@ -6,6 +6,7 @@ import TelegramCore
import SyncCore import SyncCore
import OverlayStatusController import OverlayStatusController
import AccountContext import AccountContext
import PresentationDataUtils
private let maximumNumberOfAccounts = 3 private let maximumNumberOfAccounts = 3

View File

@ -14,6 +14,7 @@ import AccountContext
import ShareController import ShareController
import SearchUI import SearchUI
import HexColor import HexColor
import PresentationDataUtils
final class ThemeGridController: ViewController { final class ThemeGridController: ViewController {
private var controllerNode: ThemeGridControllerNode { private var controllerNode: ThemeGridControllerNode {

View File

@ -32,6 +32,7 @@ import WalletUrl
import WalletCore import WalletCore
import OpenSSLEncryptionProvider import OpenSSLEncryptionProvider
import AppLock import AppLock
import PresentationDataUtils
#if canImport(BackgroundTasks) #if canImport(BackgroundTasks)
import BackgroundTasks import BackgroundTasks
@ -627,7 +628,7 @@ final class SharedApplicationContext {
return (upgradedAccounts(accountManager: accountManager, rootPath: rootPath, encryptionParameters: encryptionParameters) return (upgradedAccounts(accountManager: accountManager, rootPath: rootPath, encryptionParameters: encryptionParameters)
|> deliverOnMainQueue).start(next: { progress in |> deliverOnMainQueue).start(next: { progress in
if self.dataImportSplash == nil { if self.dataImportSplash == nil {
self.dataImportSplash = LegacyDataImportSplash(theme: nil, strings: nil) self.dataImportSplash = makeLegacyDataImportSplash(theme: nil, strings: nil)
self.dataImportSplash?.serviceAction = { self.dataImportSplash?.serviceAction = {
self.debugPressed() self.debugPressed()
} }
@ -739,7 +740,7 @@ final class SharedApplicationContext {
}, displayUpgradeProgress: { progress in }, displayUpgradeProgress: { progress in
if let progress = progress { if let progress = progress {
if self.dataImportSplash == nil { if self.dataImportSplash == nil {
self.dataImportSplash = LegacyDataImportSplash(theme: initialPresentationDataAndSettings.presentationData.theme, strings: initialPresentationDataAndSettings.presentationData.strings) self.dataImportSplash = makeLegacyDataImportSplash(theme: initialPresentationDataAndSettings.presentationData.theme, strings: initialPresentationDataAndSettings.presentationData.strings)
self.dataImportSplash?.serviceAction = { self.dataImportSplash?.serviceAction = {
self.debugPressed() self.debugPressed()
} }
@ -881,7 +882,7 @@ final class SharedApplicationContext {
case let .progress(type, value): case let .progress(type, value):
Queue.mainQueue().async { Queue.mainQueue().async {
if self.dataImportSplash == nil { if self.dataImportSplash == nil {
self.dataImportSplash = LegacyDataImportSplash(theme: nil, strings: nil) self.dataImportSplash = makeLegacyDataImportSplash(theme: nil, strings: nil)
self.dataImportSplash?.serviceAction = { self.dataImportSplash?.serviceAction = {
self.debugPressed() self.debugPressed()
} }

View File

@ -14,6 +14,7 @@ import ContextUI
import LegacyUI import LegacyUI
import AppBundle import AppBundle
import SaveToCameraRoll import SaveToCameraRoll
import PresentationDataUtils
private struct MessageContextMenuData { private struct MessageContextMenuData {
let starStatus: Bool? let starStatus: Bool?

View File

@ -11,6 +11,7 @@ import MergeLists
import OverlayStatusController import OverlayStatusController
import AccountContext import AccountContext
import StickerPackPreviewUI import StickerPackPreviewUI
import PresentationDataUtils
final class TrendingPaneInteraction { final class TrendingPaneInteraction {
let installPack: (ItemCollectionInfo) -> Void let installPack: (ItemCollectionInfo) -> Void

View File

@ -209,7 +209,7 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur
} }
case let .wallpaper(parameter): case let .wallpaper(parameter):
let presentationData = context.sharedContext.currentPresentationData.with { $0 } let presentationData = context.sharedContext.currentPresentationData.with { $0 }
var controller: OverlayStatusController? var controller: ViewController?
let signal: Signal<TelegramWallpaper, GetWallpaperError> let signal: Signal<TelegramWallpaper, GetWallpaperError>
var options: WallpaperPresentationOptions? var options: WallpaperPresentationOptions?

View File

@ -317,8 +317,6 @@ func walletStringsFormattedNumber(_ count: Int32, _ groupingSeparator: String =
} }
} }
extension OverlayStatusController { func OverlayStatusController(theme: WalletTheme, type: OverlayStatusControllerType) -> ViewController {
convenience init(theme: WalletTheme, type: OverlayStatusControllerType) { return OverlayStatusController(style: theme.keyboardAppearance == .dark ? .dark : .light, type: type)
self.init(style: theme.keyboardAppearance == .dark ? .dark : .light, type: type)
}
} }