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 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 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
}
public final class OverlayStatusController: ViewController, StandalonePresentableController {
private final class OverlayStatusControllerImpl: ViewController, StandalonePresentableController {
private let style: OverlayStatusControllerStyle
private let type: OverlayStatusControllerType
@ -152,7 +152,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
self.statusBar.statusBarStyle = .Ignore
}
required init(coder aDecoder: NSCoder) {
required public init(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@ -183,3 +183,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl
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 OverlayStatusController
import TelegramPresentationData
import Display
public extension OverlayStatusController {
convenience init(theme: PresentationTheme, type: OverlayStatusControllerType) {
self.init(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type)
}
public func OverlayStatusController(theme: PresentationTheme, type: OverlayStatusControllerType) -> ViewController {
return OverlayStatusController(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type)
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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