mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Add gradient backgrounds in passcode entry screen
This commit is contained in:
@@ -58,7 +58,10 @@ public final class PasscodeEntryController: ViewController {
|
||||
private var inBackground: Bool = false
|
||||
private var inBackgroundDisposable: Disposable?
|
||||
|
||||
public init(applicationBindings: TelegramApplicationBindings, accountManager: AccountManager, appLockContext: AppLockContext, presentationData: PresentationData, presentationDataSignal: Signal<PresentationData, NoError>, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, arguments: PasscodeEntryControllerPresentationArguments) {
|
||||
private let statusBarHost: StatusBarHost?
|
||||
private var previousStatusBarStyle: UIStatusBarStyle?
|
||||
|
||||
public init(applicationBindings: TelegramApplicationBindings, accountManager: AccountManager, appLockContext: AppLockContext, presentationData: PresentationData, presentationDataSignal: Signal<PresentationData, NoError>, statusBarHost: StatusBarHost?, challengeData: PostboxAccessChallengeData, biometrics: PasscodeEntryControllerBiometricsMode, arguments: PasscodeEntryControllerPresentationArguments) {
|
||||
self.applicationBindings = applicationBindings
|
||||
self.accountManager = accountManager
|
||||
self.appLockContext = appLockContext
|
||||
@@ -68,10 +71,12 @@ 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.statusBar.statusBarStyle = .White
|
||||
statusBarHost?.setStatusBarStyle(.lightContent, animated: true)
|
||||
|
||||
self.presentationDataDisposable = (presentationDataSignal
|
||||
|> deliverOnMainQueue).start(next: { [weak self] presentationData in
|
||||
@@ -128,7 +133,7 @@ public final class PasscodeEntryController: ViewController {
|
||||
} else {
|
||||
biometricsType = nil
|
||||
}
|
||||
self.displayNode = PasscodeEntryControllerNode(accountManager: self.accountManager, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.chatWallpaper, passcodeType: passcodeType, biometricsType: biometricsType, arguments: self.arguments, statusBar: self.statusBar, modalPresentation: self.arguments.modalPresentation)
|
||||
self.displayNode = PasscodeEntryControllerNode(accountManager: self.accountManager, presentationData: self.presentationData, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.chatWallpaper, passcodeType: passcodeType, biometricsType: biometricsType, arguments: self.arguments, modalPresentation: self.arguments.modalPresentation)
|
||||
self.displayNodeDidLoad()
|
||||
|
||||
let _ = (self.appLockContext.invalidAttempts
|
||||
@@ -271,6 +276,9 @@ public final class PasscodeEntryController: ViewController {
|
||||
}
|
||||
|
||||
public override func dismiss(completion: (() -> Void)? = 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 {
|
||||
|
||||
Reference in New Issue
Block a user